public void branchConditionally(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget, int conditional) { if (conditional == Value.ALWAYS) { // Always branch. super.branch(clazz, codeAttribute, offset, branchTarget); isFixed = true; } else if (conditional == Value.MAYBE) { if (!isFixed) { // Maybe branch. super.branchConditionally(clazz, codeAttribute, offset, branchTarget, conditional); } } else { super.wasCalled = true; } } }
public void reset() { super.reset(); isFixed = false; }
public void branchConditionally(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget, int conditional) { if (conditional == Value.ALWAYS) { // Always branch. super.branch(clazz, codeAttribute, offset, branchTarget); } else if (conditional != Value.NEVER) { // Maybe branch. super.branchConditionally(clazz, codeAttribute, offset, branchTarget, conditional); } else { super.setCalled(); } } }
branchUnit.reset(); InstructionOffsetValue branchTargets = branchUnit.getTraceBranchTargets(); int branchTargetCount = branchTargets.instructionOffsetCount(); if (branchUnit.wasCalled()) if (branchUnit.wasCalled())
instruction.length(instructionOffset); InstructionOffsetValue nextInstructionOffsetValue = new InstructionOffsetValue(nextInstructionOffset); branchUnit.resetCalled(); branchUnit.setTraceBranchTargets(nextInstructionOffsetValue); InstructionOffsetValue branchTargets = branchUnit.getTraceBranchTargets(); int branchTargetCount = branchTargets.instructionOffsetCount(); branchUnit.setTraceBranchTargets(traceValue); if (branchUnit.wasCalled()) if (branchUnit.wasCalled())
/** * Creates a new PartialEvaluator. * @param valueFactory the value factory that will create all values * during evaluation. * @param invocationUnit the invocation unit that will handle all * communication with other fields and methods. * @param evaluateAllCode a flag that specifies whether all branch targets * and exception handlers should be evaluated, * even if they are unreachable. */ public PartialEvaluator(ValueFactory valueFactory, InvocationUnit invocationUnit, boolean evaluateAllCode) { this(valueFactory, invocationUnit, evaluateAllCode, evaluateAllCode ? new BasicBranchUnit() : new TracedBranchUnit(), new BranchTargetFinder(), null); }
public void branch(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget) { super.branch(clazz, codeAttribute, offset, branchTarget); isFixed = true; }
branchUnit.reset(); InstructionOffsetValue branchTargets = branchUnit.getTraceBranchTargets(); int branchTargetCount = branchTargets.instructionOffsetCount(); if (branchUnit.wasCalled()) if (branchUnit.wasCalled())
/** * Creates a new PartialEvaluator. * @param valueFactory the value factory that will create all * values during the evaluation. * @param invocationUnit the invocation unit that will handle all * communication with other fields and * methods. * @param evaluateAllCode a flag that specifies whether all branch * targets and exception handlers should be * evaluated, even if they are unreachable. * @param extraInstructionVisitor an optional extra visitor for all * instructions right before they are * executed. */ public PartialEvaluator(ValueFactory valueFactory, InvocationUnit invocationUnit, boolean evaluateAllCode, InstructionVisitor extraInstructionVisitor) { this(valueFactory, invocationUnit, evaluateAllCode, extraInstructionVisitor, evaluateAllCode ? new BasicBranchUnit() : new TracedBranchUnit(), new BranchTargetFinder(), null); }
public void branch(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget) { super.branch(clazz, codeAttribute, offset, branchTarget); isFixed = true; }
branchUnit.reset(); InstructionOffsetValue branchTargets = branchUnit.getTraceBranchTargets(); int branchTargetCount = branchTargets.instructionOffsetCount(); if (branchUnit.wasCalled()) if (branchUnit.wasCalled())
public void branchConditionally(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget, int conditional) { if (conditional == Value.ALWAYS) { // Always branch. super.branch(clazz, codeAttribute, offset, branchTarget); isFixed = true; } else if (conditional == Value.MAYBE) { if (!isFixed) { // Maybe branch. super.branchConditionally(clazz, codeAttribute, offset, branchTarget, conditional); } } else { super.wasCalled = true; } } }
/** * Creates a new PartialEvaluator. * @param valueFactory the value factory that will create all * values during the evaluation. * @param invocationUnit the invocation unit that will handle all * communication with other fields and * methods. * @param evaluateAllCode a flag that specifies whether all branch * targets and exception handlers should be * evaluated, even if they are unreachable. * @param extraInstructionVisitor an optional extra visitor for all * instructions right before they are * executed. */ public PartialEvaluator(ValueFactory valueFactory, InvocationUnit invocationUnit, boolean evaluateAllCode, InstructionVisitor extraInstructionVisitor) { this(valueFactory, invocationUnit, evaluateAllCode, extraInstructionVisitor, evaluateAllCode ? new BasicBranchUnit() : new TracedBranchUnit(), new BranchTargetFinder(), null); }
public void branch(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget) { super.branch(clazz, codeAttribute, offset, branchTarget); isFixed = true; }
public void reset() { super.reset(); isFixed = false; }
public void branchConditionally(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget, int conditional) { if (conditional == Value.ALWAYS) { // Always branch. super.branch(clazz, codeAttribute, offset, branchTarget); isFixed = true; } else if (conditional == Value.MAYBE) { if (!isFixed) { // Maybe branch. super.branchConditionally(clazz, codeAttribute, offset, branchTarget, conditional); } } else { super.wasCalled = true; } } }
/** * Creates a new PartialEvaluator. * @param valueFactory the value factory that will create all * values during the evaluation. * @param invocationUnit the invocation unit that will handle all * communication with other fields and * methods. * @param evaluateAllCode a flag that specifies whether all branch * targets and exception handlers should be * evaluated, even if they are unreachable. * @param extraInstructionVisitor an optional extra visitor for all * instructions right before they are * executed. */ public PartialEvaluator(ValueFactory valueFactory, InvocationUnit invocationUnit, boolean evaluateAllCode, InstructionVisitor extraInstructionVisitor) { this(valueFactory, invocationUnit, evaluateAllCode, extraInstructionVisitor, evaluateAllCode ? new BasicBranchUnit() : new TracedBranchUnit(), new BranchTargetFinder(), null); }
public void reset() { super.reset(); isFixed = false; }