/** * Returns the stack after execution of the instruction at the given * offset. */ public TracedStack getStackAfter(int instructionOffset) { return partialEvaluator.getStackAfter(instructionOffset); }
/** * Returns the stack after execution of the instruction at the given * offset. */ public TracedStack getStackAfter(int instructionOffset) { return partialEvaluator.getStackAfter(instructionOffset); }
/** * Returns the stack after execution of the instruction at the given * offset. */ public TracedStack getStackAfter(int instructionOffset) { return partialEvaluator.getStackAfter(instructionOffset); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * Marks the enum class of the specified pushed type as complex. */ private void markPushedComplexEnumType(int offset) { ReferenceValue referenceValue = partialEvaluator.getStackAfter(offset).getTop(0).referenceValue(); markComplexEnumType(referenceValue); }
/** * Marks the enum class of the specified pushed type as complex. */ private void markPushedComplexEnumType(int offset) { ReferenceValue referenceValue = partialEvaluator.getStackAfter(offset).getTop(0).referenceValue(); markComplexEnumType(referenceValue); }
/** * Marks the enum class of the specified pushed type as complex. */ private void markPushedComplexEnumType(int offset) { ReferenceValue referenceValue = partialEvaluator.getStackAfter(offset).getTop(0).referenceValue(); markComplexEnumType(referenceValue); }
/** * Replaces the reference pushing instruction at the given offset by a * simpler push instruction, if possible. */ private void replaceReferencePushInstruction(Clazz clazz, int offset, Instruction instruction) { Value pushedValue = partialEvaluator.getStackAfter(offset).getTop(0); if (pushedValue.isParticular()) { // A reference value can only be specific if it is null. replaceConstantPushInstruction(clazz, offset, instruction, InstructionConstants.OP_ACONST_NULL, 0); } }
/** * Marks the stack entry and the corresponding producing instructions * of the consumer at the given offset, if the stack entry of the * consumer is marked. * @param consumerOffset the offset of the consumer. * @param consumerStackIndex the index of the stack entry to be checked * (counting from the top). * @param producerStackIndex the index of the stack entry to be marked * (counting from the top). */ private void conditionallyMarkStackEntryProducers(int consumerOffset, int consumerStackIndex, int producerStackIndex) { int top = partialEvaluator.getStackAfter(consumerOffset).size() - 1; if (isStackEntryNecessaryAfter(consumerOffset, top - consumerStackIndex)) { markStackEntryProducers(consumerOffset, producerStackIndex); } }
/** * Marks the stack entry and its initializing instruction * ('invokespecial *.<init>') for the given 'new' instruction offset. * @param newInstructionOffset the offset of the 'new' instruction. */ private void markInitialization(int newInstructionOffset) { int initializationOffset = partialEvaluator.initializationOffset(newInstructionOffset); TracedStack tracedStack = partialEvaluator.getStackAfter(newInstructionOffset); markStackEntryAfter(initializationOffset, tracedStack.size() - 1); markInstruction(initializationOffset); }
/** * Replaces the reference pushing instruction at the given offset by a * simpler push instruction, if possible. */ private void replaceReferencePushInstruction(Clazz clazz, int offset, Instruction instruction) { ReferenceValue pushedValue = partialEvaluator.getStackAfter(offset).getTop(0).referenceValue(); if (pushedValue.isNull() == Value.ALWAYS) { // A reference value can only be specific if it is null. replaceConstantPushInstruction(clazz, offset, instruction, InstructionConstants.OP_ACONST_NULL, 0); } }
/** * Replaces the reference pushing instruction at the given offset by a * simpler push instruction, if possible. */ private void replaceReferencePushInstruction(Clazz clazz, int offset, Instruction instruction) { ReferenceValue pushedValue = partialEvaluator.getStackAfter(offset).getTop(0).referenceValue(); if (pushedValue.isNull() == Value.ALWAYS) { // A reference value can only be specific if it is null. replaceConstantPushInstruction(clazz, offset, instruction, InstructionConstants.OP_ACONST_NULL, 0); } }
/** * Replaces the reference pushing instruction at the given offset by a * simpler push instruction, if possible. */ private void replaceReferencePushInstruction(Clazz clazz, int offset, Instruction instruction) { ReferenceValue pushedValue = partialEvaluator.getStackAfter(offset).getTop(0).referenceValue(); if (pushedValue.isNull() == Value.ALWAYS) { // A reference value can only be specific if it is null. replaceConstantPushInstruction(clazz, offset, instruction, InstructionConstants.OP_ACONST_NULL, 0); } }
/** * Returns whether the instruction at the given offset is pushing a simple * enum class. */ private boolean isPushingSimpleEnum(int offset) { ReferenceValue referenceValue = partialEvaluator.getStackAfter(offset).getTop(0).referenceValue(); Clazz referencedClass = referenceValue.getReferencedClass(); return isSimpleEnum(referencedClass) && !ClassUtil.isInternalArrayType(referenceValue.getType()); }
/** * Returns whether the instruction at the given offset is pushing a simple * enum class. */ private boolean isPushingSimpleEnum(int offset) { ReferenceValue referenceValue = partialEvaluator.getStackAfter(offset).getTop(0).referenceValue(); Clazz referencedClass = referenceValue.getReferencedClass(); return isSimpleEnum(referencedClass) && !ClassUtil.isInternalArrayType(referenceValue.getType()); }
/** * Returns whether the instruction at the given offset is pushing a simple * enum class. */ private boolean isPushingSimpleEnum(int offset) { ReferenceValue referenceValue = partialEvaluator.getStackAfter(offset).getTop(0).referenceValue(); Clazz referencedClass = referenceValue.getReferencedClass(); return isSimpleEnum(referencedClass) && !ClassUtil.isInternalArrayType(referenceValue.getType()); }
/** * Marks the stack entry and the corresponding producing instructions * of the consumer at the given offset, if the stack entry of the * consumer is marked. * @param consumerOffset the offset of the consumer. * @param consumerTopStackIndex the index of the stack entry to be checked * (counting from the top). * @param producerTopStackIndex the index of the stack entry to be marked * (counting from the top). */ private void conditionallyMarkStackEntryProducers(int consumerOffset, int consumerTopStackIndex, int producerTopStackIndex) { int consumerBottomStackIndex = partialEvaluator.getStackAfter(consumerOffset).size() - consumerTopStackIndex - 1; if (isStackEntryNecessaryAfter(consumerOffset, consumerBottomStackIndex)) { int producerBottomStackIndex = partialEvaluator.getStackBefore(consumerOffset).size() - producerTopStackIndex - 1; markStackEntryProducers(consumerOffset, producerBottomStackIndex, true); } }
/** * Marks the stack entry and the corresponding producing instructions * of the consumer at the given offset, if the stack entry of the * consumer is marked. * @param consumerOffset the offset of the consumer. * @param consumerTopStackIndex the index of the stack entry to be checked * (counting from the top). * @param producerTopStackIndex the index of the stack entry to be marked * (counting from the top). */ private void conditionallyMarkStackEntryProducers(int consumerOffset, int consumerTopStackIndex, int producerTopStackIndex) { int consumerBottomStackIndex = partialEvaluator.getStackAfter(consumerOffset).size() - consumerTopStackIndex - 1; if (isStackEntryNecessaryAfter(consumerOffset, consumerBottomStackIndex)) { int producerBottomStackIndex = partialEvaluator.getStackBefore(consumerOffset).size() - producerTopStackIndex - 1; markStackEntryProducers(consumerOffset, producerBottomStackIndex, true); } }