public void visitExceptionInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, ExceptionInfo exceptionInfo) { // Mark the exception handler if it's relevant. if (!isReachable(exceptionInfo.u2handlerPC) && isReachable(exceptionInfo.u2startPC, exceptionInfo.u2endPC)) { markCode(clazz, method, codeAttribute, exceptionInfo.u2handlerPC); evaluateExceptions = true; } }
public void visitEnclosingMethodAttribute(Clazz clazz, EnclosingMethodAttribute enclosingMethodAttribute) { // Check whether the class itself is retargeted. checkTarget(clazz); // Check whether the referenced class is retargeted. checkTarget(enclosingMethodAttribute.referencedClass); }
/** * Returns whether the subroutine at the given offset is ever returning * by means of a regular 'ret' instruction. */ public boolean isSubroutineReturning(int instructionOffset) { return branchTargetFinder.isSubroutineReturning(instructionOffset); }
/** * Returns whether the instruction at the given offset is the target of a * branch instruction or an exception. */ public boolean isBranchOrExceptionTarget(int instructionOffset) { return branchTargetFinder.isBranchTarget(instructionOffset) || branchTargetFinder.isExceptionHandler(instructionOffset); }
public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute) { // Change the referenced classes. updateReferencedClasses(signatureAttribute.referencedClasses); }
/** * Marks the branch targets of the given jump offsets for the instruction * at the given offset. */ private void markBranchTargets(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, int[] jumpOffsets) { for (int index = 0; index < jumpOffsets.length; index++) { markCode(clazz, method, codeAttribute, offset + jumpOffsets[index]); } }
/** * Returns the offset after the subroutine that starts at the given * offset. */ public int subroutineEnd(int instructionOffset) { return branchTargetFinder.subroutineEnd(instructionOffset); }
/** * Returns whether the method is an instance initializer. */ public boolean isInitializer() { return branchTargetFinder.isInitializer(); }
/** * Sets the global return value to true if the given class is retargeted. */ private void checkTarget(Clazz clazz) { if (clazz != null && ClassMerger.getTargetClass(clazz) != null) { retargeted = true; } } }
/** * Marks the branch targets of the given jump offsets for the instruction * at the given offset. */ private void markBranchTargets(int offset, int[] jumpOffsets) { for (int index = 0; index < jumpOffsets.length; index++) { markBranchTarget(offset, jumpOffsets[index]); } }
public void visitConstantElementValue(Clazz clazz, Annotation annotation, ConstantElementValue constantElementValue) { // Change the referenced annotation class and method. visitAnyElementValue(clazz, annotation, constantElementValue); }
/** * Returns whether the instruction at the given offset is a subroutine * invocation. */ public boolean isSubroutineInvocation(int instructionOffset) { return branchTargetFinder.isSubroutineInvocation(instructionOffset); }
public void visitLibraryField(LibraryClass libraryClass, LibraryField libraryField) { // Change the referenced class. libraryField.referencedClass = updateReferencedClass(libraryField.referencedClass); }
/** * Returns the instruction offset at which this initializer is calling * the "super" or "this" initializer method, or <code>NONE</code> if it is * not an initializer. */ public int superInitializationOffset() { return branchTargetFinder.superInitializationOffset(); }
/** * Returns the offset of the 'new' instruction that corresponds to the * invocation of the instance initializer at the given offset, or * <code>AT_METHOD_ENTRY</code> if the invocation is calling the "super" or * "this" initializer method, , or <code>NONE</code> if it is not a 'new' * instruction. */ public int creationOffset(int offset) { return branchTargetFinder.creationOffset(offset); }
/** * Returns the instruction offset at which the object instance that is * created at the given 'new' instruction offset is initialized, or * <code>NONE</code> if it is not being created. */ public int initializationOffset(int instructionOffset) { return branchTargetFinder.initializationOffset(instructionOffset); }
public void visitLocalVariableTypeInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeInfo localVariableTypeInfo) { // Change the referenced classes. updateReferencedClasses(localVariableTypeInfo.referencedClasses); }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Check whether the referenced class is retargeted. checkTarget(classConstant.referencedClass); }
/** * Marks the branch target at the given offset. */ private void markBranchTarget(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset) { boolean oldNext = next; markCode(clazz, method, codeAttribute, offset); next = oldNext; }
public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod) { // Change the referenced classes. updateReferencedClasses(libraryMethod.referencedClasses); }