/** * Creates a new LivenessAnalyzer. This private constructor gets around * the constraint that it's not allowed to add statements before calling * 'this'. */ private LivenessAnalyzer(PartialEvaluator partialEvaluator, boolean runPartialEvaluator) { this(partialEvaluator, runPartialEvaluator, new InitializationFinder(partialEvaluator, false), true); }
/** * Returns whether the specified stack entry is initialized. */ public boolean isInitializedBefore(int offset, int stackEntryIndexBottom) { InstructionOffsetValue creationOffsetValue = creationOffsetValue(offset, stackEntryIndexBottom); return isInitializedBefore(offset, creationOffsetValue); }
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { // Special case: variable 0 ('this') in an initializer has to be alive // as long as it hasn't been initialized. if (offset == initializationFinder.superInitializationOffset()) { alive |= 1L; } }
initializationFinder.isInitializer() && offset <= initializationFinder.superInitializationOffset()) if (!initializationFinder.isInitializedBefore(offset, instructionOffsetValue))
/** * Returns the 'new' instruction offset at which the object instance is * created that is initialized at the given offset. */ public int creationOffset(int initializationOffset) { return creationOffsetValue(initializationOffset).instructionOffset(0); }
initializationFinder.visitCodeAttribute(clazz, method, codeAttribute); livenessAnalyzer.visitCodeAttribute(clazz, method, codeAttribute);
initializationFinder.isInitializer() && offset <= initializationFinder.superInitializationOffset()) if (!initializationFinder.isInitializedBefore(offset, instructionOffsetValue))
/** * Returns the 'new' instruction offset at which the object instance is * created that is initialized at the given offset. */ public int creationOffset(int initializationOffset) { return creationOffsetValue(initializationOffset).instructionOffset(0); }
initializationFinder.visitCodeAttribute(clazz, method, codeAttribute); livenessAnalyzer.visitCodeAttribute(clazz, method, codeAttribute);
initializationFinder.isInitializer() && offset <= initializationFinder.superInitializationOffset()) if (!initializationFinder.isInitializedBefore(offset, instructionOffsetValue))
/** * Returns whether the specified stack entry is initialized. */ public boolean isInitializedBefore(int offset, int stackEntryIndexBottom) { InstructionOffsetValue creationOffsetValue = creationOffsetValue(offset, stackEntryIndexBottom); return isInitializedBefore(offset, creationOffsetValue); }
/** * Returns the 'new' instruction offset at which the object instance is * created that is initialized at the given offset. */ public int creationOffset(int initializationOffset) { return creationOffsetValue(initializationOffset).instructionOffset(0); }
initializationFinder.visitCodeAttribute(clazz, method, codeAttribute); livenessAnalyzer.visitCodeAttribute(clazz, method, codeAttribute);
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { // Special case: variable 0 ('this') in an initializer has to be alive // as long as it hasn't been initialized. if (offset == initializationFinder.superInitializationOffset()) { alive |= 1L; } }
/** * Creates a new LivenessAnalyzer. This private constructor gets around * the constraint that it's not allowed to add statements before calling * 'this'. */ private LivenessAnalyzer(PartialEvaluator partialEvaluator, boolean runPartialEvaluator) { this(partialEvaluator, runPartialEvaluator, new InitializationFinder(partialEvaluator, false), true); }
/** * Returns whether the specified stack entry is initialized. */ public boolean isInitializedBefore(int offset, int stackEntryIndexBottom) { InstructionOffsetValue creationOffsetValue = creationOffsetValue(offset, stackEntryIndexBottom); return isInitializedBefore(offset, creationOffsetValue); }
/** * Returns the 'new' instruction offset value (or method parameter) at * which the object instance is created that is initialized at the given * offset. */ private InstructionOffsetValue creationOffsetValue(int initializationOffset) { int stackEntryIndexBottom = partialEvaluator.getStackAfter(initializationOffset).size(); return creationOffsetValue(initializationOffset, stackEntryIndexBottom); }
initializationFinder.visitCodeAttribute(clazz, method, codeAttribute);
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { // Special case: variable 0 ('this') in an initializer has to be alive // as long as it hasn't been initialized. if (offset == initializationFinder.superInitializationOffset()) { alive |= 1L; } }
/** * Creates a new LivenessAnalyzer. This private constructor gets around * the constraint that it's not allowed to add statements before calling * 'this'. */ private LivenessAnalyzer(PartialEvaluator partialEvaluator, boolean runPartialEvaluator) { this(partialEvaluator, runPartialEvaluator, new InitializationFinder(partialEvaluator, false), true); }