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 class
A visitor that only writes try-catch-finally blocks to the supplied method visitor.protected class
A class visitor that extracts the exception tables of the advice method.protected class
A 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.ForInstrumentedMethod
A handler for accessing values on the local variable array.protected final Assigner
The assigner to use.protected final org.objectweb.asm.ClassReader
A class reader for parsing the class file containing the represented advice method.protected final StackManipulation
The exception handler that is resolved for the instrumented method.protected final Implementation.Context
The implementation context to use.protected final MethodDescription
The instrumented method.protected final TypeDescription
A 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.ForInstrumentedMethod
A handler for computing the method size requirements.protected final org.objectweb.asm.MethodVisitor
The method visitor for writing the instrumented method.protected final Advice.Dispatcher.RelocationHandler.Bound
A bound relocation handler that is responsible for considering a non-standard control flow.protected final Advice.StackMapFrameHandler.ForInstrumentedMethod
A handler for translating and injecting stack map frames.protected final Advice.Dispatcher.SuppressionHandler.Bound
A 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
ConstructorsModifierConstructorDescriptionprotected
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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply()
Applies this dispatcher.void
Initialized the advice's methods local variables.void
prepare()
Prepares the advice method's exception handlers.org.objectweb.asm.MethodVisitor
visitMethod
(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:
prepare
in interfaceAdvice.Dispatcher.Bound
-
initialize
public void initialize()Initialized the advice's methods local variables.- Specified by:
initialize
in interfaceAdvice.Dispatcher.Bound
-
apply
public void apply()Applies this dispatcher.- Specified by:
apply
in interfaceAdvice.Dispatcher.Bound
-
visitMethod
@MaybeNull public org.objectweb.asm.MethodVisitor visitMethod(int modifiers, String internalName, String descriptor, @MaybeNull String signature, @MaybeNull String[] exception) - Overrides:
visitMethod
in classorg.objectweb.asm.ClassVisitor
-