/** * Applies the given instruction visitor to the instruction at the specified * offset. */ public void instructionAccept(Clazz clazz, Method method, int offset, InstructionVisitor instructionVisitor) { Instruction instruction = InstructionFactory.create(code, offset); instruction.accept(clazz, method, this, offset, instructionVisitor); }
/** * Applies the given instruction visitor to the instruction at the specified * offset. */ public void instructionAccept(Clazz clazz, Method method, int offset, InstructionVisitor instructionVisitor) { Instruction instruction = InstructionFactory.create(code, offset); instruction.accept(clazz, method, this, offset, instructionVisitor); }
/** * Applies the given instruction visitor to the instruction at the specified * offset. */ public void instructionAccept(Clazz clazz, Method method, int offset, InstructionVisitor instructionVisitor) { Instruction instruction = InstructionFactory.create(code, offset); instruction.accept(clazz, method, this, offset, instructionVisitor); }
/** * Applies the given instruction visitor to the instruction at the specified * offset. */ public void instructionAccept(Clazz clazz, Method method, int offset, InstructionVisitor instructionVisitor) { Instruction instruction = InstructionFactory.create(code, offset); instruction.accept(clazz, method, this, offset, instructionVisitor); }
/** * Returns whether the specified instruction may throw exceptions. */ public boolean mayThrowExceptions(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset) { Instruction instruction = InstructionFactory.create(codeAttribute.code, offset); return mayThrowExceptions(clazz, method, codeAttribute, offset, instruction); }
/** * Returns whether the specified instruction may throw exceptions. */ public boolean mayThrowExceptions(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset) { Instruction instruction = InstructionFactory.create(codeAttribute.code, offset); return mayThrowExceptions(clazz, method, codeAttribute, offset, instruction); }
/** * Returns whether the specified instruction may throw exceptions. */ public boolean mayThrowExceptions(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset) { Instruction instruction = InstructionFactory.create(codeAttribute.code, offset); return mayThrowExceptions(clazz, method, codeAttribute, offset, instruction); }
/** * Applies the given instruction visitor to all instructions in the * specified range of offsets. */ public void instructionsAccept(Clazz clazz, Method method, int startOffset, int endOffset, InstructionVisitor instructionVisitor) { int offset = startOffset; while (offset < endOffset) { // Note that the instruction is only volatile. Instruction instruction = InstructionFactory.create(code, offset); int instructionLength = instruction.length(offset); instruction.accept(clazz, method, this, offset, instructionVisitor); offset += instructionLength; } }
/** * Applies the given instruction visitor to all instructions in the * specified range of offsets. */ public void instructionsAccept(Clazz clazz, Method method, int startOffset, int endOffset, InstructionVisitor instructionVisitor) { int offset = startOffset; while (offset < endOffset) { // Note that the instruction is only volatile. Instruction instruction = InstructionFactory.create(code, offset); int instructionLength = instruction.length(offset); instruction.accept(clazz, method, this, offset, instructionVisitor); offset += instructionLength; } }
/** * Applies the given instruction visitor to all instructions in the * specified range of offsets. */ public void instructionsAccept(Clazz clazz, Method method, int startOffset, int endOffset, InstructionVisitor instructionVisitor) { int offset = startOffset; while (offset < endOffset) { // Note that the instruction is only volatile. Instruction instruction = InstructionFactory.create(code, offset); int instructionLength = instruction.length(offset); instruction.accept(clazz, method, this, offset, instructionVisitor); offset += instructionLength; } }
/** * Applies the given instruction visitor to all instructions in the * specified range of offsets. */ public void instructionsAccept(Clazz clazz, Method method, int startOffset, int endOffset, InstructionVisitor instructionVisitor) { int offset = startOffset; while (offset < endOffset) { // Note that the instruction is only volatile. Instruction instruction = InstructionFactory.create(code, offset); int instructionLength = instruction.length(offset); instruction.accept(clazz, method, this, offset, instructionVisitor); offset += instructionLength; } }
/** * Returns whether a block of instructions may ever throw an exception. */ private boolean mayThrowExceptions(Clazz clazz, Method method, CodeAttribute codeAttribute, int startOffset, int endOffset) { for (int index = startOffset; index < endOffset; index++) { if (isTraced(index) && (evaluateAllCode || InstructionFactory.create(codeAttribute.code, index).mayThrowExceptions())) { return true; } } return false; }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { boolean delegateVisit = false; // Directly iterate of all instructions and exit early if // we encounter a "NEWARRAY" instruction. for (int offset = 0; offset < codeAttribute.u4codeLength;) { Instruction instruction = InstructionFactory.create(codeAttribute.code, offset); if (instruction.opcode == InstructionConstants.OP_NEWARRAY) { delegateVisit = true; break; } offset += instruction.length(offset); } if (delegateVisit) { acceptedVisitor.visitCodeAttribute(clazz, method, codeAttribute); } } }
/** * Returns whether a block of instructions may ever throw an exception. */ private boolean mayThrowExceptions(Clazz clazz, Method method, CodeAttribute codeAttribute, int startOffset, int endOffset) { for (int index = startOffset; index < endOffset; index++) { if (isTraced(index) && (evaluateAllCode || InstructionFactory.create(codeAttribute.code, index).mayThrowExceptions())) { return true; } } return false; }
/** * Returns whether a block of instructions may ever throw an exception. */ private boolean mayThrowExceptions(Clazz clazz, Method method, CodeAttribute codeAttribute, int startOffset, int endOffset) { for (int index = startOffset; index < endOffset; index++) { if (isTraced(index) && (evaluateAllCode || InstructionFactory.create(codeAttribute.code, index).mayThrowExceptions())) { return true; } } return false; }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { boolean delegateVisit = false; // Directly iterate of all instructions and exit early if // we encounter a "NEWARRAY" instruction. for (int offset = 0; offset < codeAttribute.u4codeLength;) { Instruction instruction = InstructionFactory.create(codeAttribute.code, offset); if (instruction.opcode == InstructionConstants.OP_NEWARRAY) { delegateVisit = true; break; } offset += instruction.length(offset); } if (delegateVisit) { acceptedVisitor.visitCodeAttribute(clazz, method, codeAttribute); } } }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { boolean delegateVisit = false; // Directly iterate of all instructions and exit early if // we encounter a "NEWARRAY" instruction. for (int offset = 0; offset < codeAttribute.u4codeLength;) { Instruction instruction = InstructionFactory.create(codeAttribute.code, offset); if (instruction.opcode == InstructionConstants.OP_NEWARRAY) { delegateVisit = true; break; } offset += instruction.length(offset); } if (delegateVisit) { acceptedVisitor.visitCodeAttribute(clazz, method, codeAttribute); } } }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // Evaluate the method. partialEvaluator.visitCodeAttribute(clazz, method, codeAttribute); int codeLength = codeAttribute.u4codeLength; // Check all traced instructions. for (int offset = 0; offset < codeLength; offset++) { if (partialEvaluator.isTraced(offset)) { Instruction instruction = InstructionFactory.create(codeAttribute.code, offset); instruction.accept(clazz, method, codeAttribute, offset, this); // Check generalized stacks and variables at branch targets. if (partialEvaluator.isBranchOrExceptionTarget(offset)) { checkMixedStackEntriesBefore(offset); checkMixedVariablesBefore(offset); } } } }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // Evaluate the method. partialEvaluator.visitCodeAttribute(clazz, method, codeAttribute); int codeLength = codeAttribute.u4codeLength; // Check all traced instructions. for (int offset = 0; offset < codeLength; offset++) { if (partialEvaluator.isTraced(offset)) { Instruction instruction = InstructionFactory.create(codeAttribute.code, offset); instruction.accept(clazz, method, codeAttribute, offset, this); // Check generalized stacks and variables at branch targets. if (partialEvaluator.isBranchOrExceptionTarget(offset)) { checkMixedStackEntriesBefore(offset); checkMixedVariablesBefore(offset); } } } }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // Evaluate the method. partialEvaluator.visitCodeAttribute(clazz, method, codeAttribute); int codeLength = codeAttribute.u4codeLength; // Check all traced instructions. for (int offset = 0; offset < codeLength; offset++) { if (partialEvaluator.isTraced(offset)) { Instruction instruction = InstructionFactory.create(codeAttribute.code, offset); instruction.accept(clazz, method, codeAttribute, offset, this); // Check generalized stacks and variables at branch targets. if (partialEvaluator.isBranchOrExceptionTarget(offset)) { checkMixedStackEntriesBefore(offset); checkMixedVariablesBefore(offset); } } } }