private boolean shouldVisit(int offset) { return isTraced(offset) == traced; } }
private boolean shouldVisit(int offset) { return isTraced(offset) == traced; } }
/** * Returns whether the instruction at the given offset has ever been * executed during the partial evaluation. */ public boolean isTraced(int instructionOffset) { return partialEvaluator.isTraced(instructionOffset); }
/** * Returns whether the specified instruction was traced in the most * recently analyzed code attribute. */ public boolean isTraced(int instructionOffset) { return partialEvaluator.isTraced(instructionOffset); }
/** * Returns whether the instruction at the given offset has ever been * executed during the partial evaluation. */ public boolean isTraced(int instructionOffset) { return partialEvaluator.isTraced(instructionOffset); }
/** * Returns whether the instruction at the given offset has ever been * executed during the partial evaluation. */ public boolean isTraced(int instructionOffset) { return partialEvaluator.isTraced(instructionOffset); }
private boolean shouldVisit(int offset) { return isTraced(offset) == traced; } }
/** * Returns whether the specified instruction was traced in the most * recently analyzed code attribute. */ public boolean isTraced(int instructionOffset) { return partialEvaluator.isTraced(instructionOffset); }
/** * Returns whether the specified instruction was traced in the most * recently analyzed code attribute. */ public boolean isTraced(int instructionOffset) { return partialEvaluator.isTraced(instructionOffset); }
/** * Returns whether a block of instructions is ever used. */ public boolean isTraced(int startOffset, int endOffset) { for (int index = startOffset; index < endOffset; index++) { if (isTraced(index)) { return true; } } return false; }
/** * Returns whether a block of instructions is ever used. */ public boolean isTraced(int startOffset, int endOffset) { for (int index = startOffset; index < endOffset; index++) { if (isTraced(index)) { return true; } } return false; }
/** * Returns whether a block of instructions is ever used. */ public boolean isTraced(int startOffset, int endOffset) { for (int index = startOffset; index < endOffset; index++) { if (isTraced(index)) { return true; } } return false; }
/** * Returns whether a block of instructions is ever used. */ public boolean isTraced(int startOffset, int endOffset) { for (int index = startOffset; index < endOffset; index++) { if (isTraced(index)) { return true; } } return false; }
public void visitExceptionInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, ExceptionInfo exceptionInfo) { // Are any variables alive at the start of the handler? long alive = isAliveBefore[exceptionInfo.u2handlerPC]; if (alive != 0L) { // Set the same liveness flags for the entire try block. int startOffset = exceptionInfo.u2startPC; int endOffset = exceptionInfo.u2endPC; for (int offset = startOffset; offset < endOffset; offset++) { if (partialEvaluator.isTraced(offset)) { if ((~(isAliveBefore[offset] & isAliveAfter[offset]) & alive) != 0L) { isAliveBefore[offset] |= alive; isAliveAfter[offset] |= alive; // Check again after having marked this try block. checkAgain = true; } } } } }
/** * 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; }
/** * 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 any traced but unnecessary instruction between the two * given offsets is branching over the second given offset. */ private boolean isAnyUnnecessaryInstructionBranchingOver(int instructionOffset1, int instructionOffset2) { for (int offset = instructionOffset1; offset < instructionOffset2; offset++) { // Is it a traced but unmarked straddling branch? if (partialEvaluator.isTraced(offset) && !isInstructionNecessary(offset) && isAnyLargerThan(partialEvaluator.branchTargets(offset), instructionOffset2)) { return true; } } return false; }
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); } } } }