protected abstract static class Advice.Dispatcher.Inlining.CodeTranslationVisitor extends MethodVisitor implements Advice.Dispatcher.SuppressionHandler.ReturnValueProducer
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Advice.Dispatcher.Inlining.CodeTranslationVisitor.ForMethodEnter
A code translation visitor that retains the return value of the represented advice method.
|
protected static class |
Advice.Dispatcher.Inlining.CodeTranslationVisitor.ForMethodExit
A code translation visitor that discards the return value of the represented advice method.
|
| Modifier and Type | Field and Description |
|---|---|
protected MethodDescription.InDefinedShape |
adviceMethod
The advice method.
|
protected Label |
endOfMethod
A label indicating the end of the advice byte code.
|
protected Implementation.Context |
implementationContext
The implementation context to use.
|
protected MethodDescription |
instrumentedMethod
The instrumented method.
|
protected Advice.MethodSizeHandler.ForAdvice |
methodSizeHandler
A handler for computing the method size requirements.
|
protected MethodVisitor |
methodVisitor
The original method visitor to which all instructions are eventually written to.
|
protected Advice.StackMapFrameHandler.ForAdvice |
stackMapFrameHandler
A handler for translating and injecting stack map frames.
|
api, mv| Modifier | Constructor and Description |
|---|---|
protected |
CodeTranslationVisitor(MethodVisitor methodVisitor,
Implementation.Context implementationContext,
Advice.MethodSizeHandler.ForAdvice methodSizeHandler,
Advice.StackMapFrameHandler.ForAdvice stackMapFrameHandler,
MethodDescription instrumentedMethod,
MethodDescription.InDefinedShape adviceMethod,
Map<Integer,Advice.OffsetMapping.Target> offsetMappings,
Advice.Dispatcher.SuppressionHandler.Bound suppressionHandler)
Creates a new code translation visitor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract int |
adjust(int offset)
Adjusts the offset of a variable instruction within the advice method such that no arguments to
the instrumented method are overridden.
|
protected abstract void |
onMethodReturn()
Invoked after returning from the advice method.
|
protected void |
propagateHandler(Label label)
Propagates a label for an exception handler that is typically suppressed by the overlaying
Advice.Dispatcher.Inlining.Resolved.AdviceMethodInliner.ExceptionTableSubstitutor. |
AnnotationVisitor |
visitAnnotation(String descriptor,
boolean visible) |
AnnotationVisitor |
visitAnnotationDefault() |
void |
visitAttribute(Attribute attribute) |
void |
visitCode() |
void |
visitEnd() |
void |
visitFrame(int type,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack) |
void |
visitIincInsn(int offset,
int value) |
abstract void |
visitInsn(int opcode) |
void |
visitMaxs(int stackSize,
int localVariableLength) |
void |
visitParameter(String name,
int modifiers) |
AnnotationVisitor |
visitParameterAnnotation(int index,
String descriptor,
boolean visible) |
AnnotationVisitor |
visitTypeAnnotation(int typeReference,
TypePath typePath,
String descriptor,
boolean visible) |
void |
visitVarInsn(int opcode,
int offset) |
visitFieldInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeInsnclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonDefaultValueprotected final MethodVisitor methodVisitor
protected final Implementation.Context implementationContext
protected final Advice.MethodSizeHandler.ForAdvice methodSizeHandler
protected final Advice.StackMapFrameHandler.ForAdvice stackMapFrameHandler
protected final MethodDescription instrumentedMethod
protected final MethodDescription.InDefinedShape adviceMethod
protected final Label endOfMethod
protected CodeTranslationVisitor(MethodVisitor methodVisitor, Implementation.Context implementationContext, Advice.MethodSizeHandler.ForAdvice methodSizeHandler, Advice.StackMapFrameHandler.ForAdvice stackMapFrameHandler, MethodDescription instrumentedMethod, MethodDescription.InDefinedShape adviceMethod, Map<Integer,Advice.OffsetMapping.Target> offsetMappings, Advice.Dispatcher.SuppressionHandler.Bound suppressionHandler)
methodVisitor - A method visitor for writing the instrumented method's byte code.implementationContext - The implementation context to use.methodSizeHandler - A handler for computing the method size requirements.stackMapFrameHandler - A handler for translating and injecting stack map frames.instrumentedMethod - The instrumented method.adviceMethod - The advice method.offsetMappings - A mapping of offsets to resolved target offsets in the instrumented method.suppressionHandler - The suppression handler to use.protected void propagateHandler(Label label)
Advice.Dispatcher.Inlining.Resolved.AdviceMethodInliner.ExceptionTableSubstitutor.label - The label to register as a target for an exception handler.public void visitParameter(String name, int modifiers)
visitParameter in class MethodVisitorpublic AnnotationVisitor visitAnnotationDefault()
visitAnnotationDefault in class MethodVisitorpublic AnnotationVisitor visitAnnotation(String descriptor, boolean visible)
visitAnnotation in class MethodVisitorpublic AnnotationVisitor visitTypeAnnotation(int typeReference, TypePath typePath, String descriptor, boolean visible)
visitTypeAnnotation in class MethodVisitorpublic AnnotationVisitor visitParameterAnnotation(int index, String descriptor, boolean visible)
visitParameterAnnotation in class MethodVisitorpublic void visitAttribute(Attribute attribute)
visitAttribute in class MethodVisitorpublic void visitCode()
visitCode in class MethodVisitorpublic void visitFrame(int type,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack)
visitFrame in class MethodVisitorpublic void visitEnd()
visitEnd in class MethodVisitorpublic void visitMaxs(int stackSize,
int localVariableLength)
visitMaxs in class MethodVisitorpublic void visitVarInsn(int opcode,
int offset)
visitVarInsn in class MethodVisitorpublic void visitIincInsn(int offset,
int value)
visitIincInsn in class MethodVisitorprotected abstract int adjust(int offset)
offset - The original offset.public abstract void visitInsn(int opcode)
visitInsn in class MethodVisitorprotected abstract void onMethodReturn()
Copyright © 2014–2017. All rights reserved.