Package net.bytebuddy.asm
Class Advice.Dispatcher.Inlining.Resolved.AdviceMethodInliner
java.lang.Object
org.objectweb.asm.ClassVisitor
net.bytebuddy.asm.Advice.Dispatcher.Inlining.Resolved.AdviceMethodInliner
- All Implemented Interfaces:
Advice.Dispatcher.Bound
- Enclosing class:
Advice.Dispatcher.Inlining.Resolved
protected class Advice.Dispatcher.Inlining.Resolved.AdviceMethodInliner
extends org.objectweb.asm.ClassVisitor
implements Advice.Dispatcher.Bound
A bound advice method that copies the code by first extracting the exception table and later appending the
code of the method without copying any meta data.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA visitor that only writes try-catch-finally blocks to the supplied method visitor.protected classA class visitor that extracts the exception tables of the advice method.protected classA label substitutor allows to visit an advice method a second time after the exception handlers were already written. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Advice.ArgumentHandler.ForInstrumentedMethodA handler for accessing values on the local variable array.protected final AssignerThe assigner to use.protected final org.objectweb.asm.ClassReaderA class reader for parsing the class file containing the represented advice method.protected final StackManipulationThe exception handler that is resolved for the instrumented method.protected final Implementation.ContextThe implementation context to use.protected final MethodDescriptionThe instrumented method.protected final TypeDescriptionA description of the instrumented type.protected final List<org.objectweb.asm.Label> The labels that were found during parsing the method's exception handler in the order of their discovery.protected final Advice.MethodSizeHandler.ForInstrumentedMethodA handler for computing the method size requirements.protected final org.objectweb.asm.MethodVisitorThe method visitor for writing the instrumented method.protected final Advice.Dispatcher.RelocationHandler.BoundA bound relocation handler that is responsible for considering a non-standard control flow.protected final Advice.StackMapFrameHandler.ForInstrumentedMethodA handler for translating and injecting stack map frames.protected final Advice.Dispatcher.SuppressionHandler.BoundA bound suppression handler that is used for suppressing exceptions of this advice method.Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAdviceMethodInliner(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.ArgumentHandler.ForInstrumentedMethod argumentHandler, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, Advice.Dispatcher.SuppressionHandler.Bound suppressionHandler, Advice.Dispatcher.RelocationHandler.Bound relocationHandler, StackManipulation exceptionHandler, org.objectweb.asm.ClassReader classReader) Creates a new advice method inliner. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply()Applies this dispatcher.voidInitialized the advice's methods local variables.voidprepare()Prepares the advice method's exception handlers.org.objectweb.asm.MethodVisitorvisitMethod(int modifiers, String internalName, String descriptor, String signature, String[] exception) Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate, visit, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation
-
Field Details
-
instrumentedType
A description of the instrumented type. -
instrumentedMethod
The instrumented method. -
methodVisitor
protected final org.objectweb.asm.MethodVisitor methodVisitorThe method visitor for writing the instrumented method. -
implementationContext
The implementation context to use. -
assigner
The assigner to use. -
argumentHandler
A handler for accessing values on the local variable array. -
methodSizeHandler
A handler for computing the method size requirements. -
stackMapFrameHandler
A handler for translating and injecting stack map frames. -
suppressionHandler
A bound suppression handler that is used for suppressing exceptions of this advice method. -
relocationHandler
A bound relocation handler that is responsible for considering a non-standard control flow. -
exceptionHandler
The exception handler that is resolved for the instrumented method. -
classReader
protected final org.objectweb.asm.ClassReader classReaderA class reader for parsing the class file containing the represented advice method. -
labels
The labels that were found during parsing the method's exception handler in the order of their discovery.
-
-
Constructor Details
-
AdviceMethodInliner
protected AdviceMethodInliner(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, Advice.ArgumentHandler.ForInstrumentedMethod argumentHandler, Advice.MethodSizeHandler.ForInstrumentedMethod methodSizeHandler, Advice.StackMapFrameHandler.ForInstrumentedMethod stackMapFrameHandler, Advice.Dispatcher.SuppressionHandler.Bound suppressionHandler, Advice.Dispatcher.RelocationHandler.Bound relocationHandler, StackManipulation exceptionHandler, org.objectweb.asm.ClassReader classReader) Creates a new advice method inliner.- Parameters:
instrumentedType- A description of the instrumented type.instrumentedMethod- The instrumented method.methodVisitor- The method visitor for writing the instrumented method.implementationContext- The implementation context to use.assigner- The assigner to use.argumentHandler- A handler for accessing values on the local variable array.methodSizeHandler- A handler for computing the method size requirements.stackMapFrameHandler- A handler for translating and injecting stack map frames.suppressionHandler- A bound suppression handler that is used for suppressing exceptions of this advice method.relocationHandler- A bound relocation handler that is responsible for considering a non-standard control flow.exceptionHandler- The exception handler that is resolved for the instrumented method.classReader- A class reader for parsing the class file containing the represented advice method.
-
-
Method Details
-
prepare
public void prepare()Prepares the advice method's exception handlers.- Specified by:
preparein interfaceAdvice.Dispatcher.Bound
-
initialize
public void initialize()Initialized the advice's methods local variables.- Specified by:
initializein interfaceAdvice.Dispatcher.Bound
-
apply
public void apply()Applies this dispatcher.- Specified by:
applyin interfaceAdvice.Dispatcher.Bound
-
visitMethod
@MaybeNull public org.objectweb.asm.MethodVisitor visitMethod(int modifiers, String internalName, String descriptor, @MaybeNull String signature, @MaybeNull String[] exception) - Overrides:
visitMethodin classorg.objectweb.asm.ClassVisitor
-