protected abstract static class Advice.Dispatcher.Inlining.CodeTranslationVisitor
extends org.objectweb.asm.MethodVisitor
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 Advice.ArgumentHandler.ForAdvice |
argumentHandler
A handler for accessing values on the local variable array.
|
protected org.objectweb.asm.Label |
endOfMethod
A label indicating the end of the advice byte code.
|
protected Implementation.Context |
implementationContext
The implementation context to use.
|
protected Advice.MethodSizeHandler.ForAdvice |
methodSizeHandler
A handler for computing the method size requirements.
|
protected org.objectweb.asm.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.
|
Modifier | Constructor and Description |
---|---|
protected |
CodeTranslationVisitor(org.objectweb.asm.MethodVisitor methodVisitor,
Implementation.Context implementationContext,
Advice.ArgumentHandler.ForAdvice argumentHandler,
Advice.MethodSizeHandler.ForAdvice methodSizeHandler,
Advice.StackMapFrameHandler.ForAdvice stackMapFrameHandler,
MethodDescription instrumentedMethod,
MethodDescription.InDefinedShape adviceMethod,
Map<Integer,Advice.OffsetMapping.Target> offsetMappings,
Advice.Dispatcher.SuppressionHandler.Bound suppressionHandler,
Advice.Dispatcher.RelocationHandler.Bound relocationHandler)
Creates a new code translation visitor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract int |
getReturnValueOffset()
Resolves the offset of the advice method's local variable.
|
protected void |
propagateHandler(org.objectweb.asm.Label label)
Propagates a label for an exception handler that is typically suppressed by the overlaying
Advice.Dispatcher.Inlining.Resolved.AdviceMethodInliner.ExceptionTableSubstitutor . |
void |
visitAnnotableParameterCount(int count,
boolean visible) |
org.objectweb.asm.AnnotationVisitor |
visitAnnotation(String descriptor,
boolean visible) |
org.objectweb.asm.AnnotationVisitor |
visitAnnotationDefault() |
void |
visitAttribute(org.objectweb.asm.Attribute attribute) |
void |
visitCode() |
void |
visitEnd() |
void |
visitFrame(int type,
int localVariableLength,
Object[] localVariable,
int stackSize,
Object[] stack) |
void |
visitIincInsn(int offset,
int value) |
void |
visitInsn(int opcode) |
void |
visitMaxs(int stackSize,
int localVariableLength) |
void |
visitParameter(String name,
int modifiers) |
org.objectweb.asm.AnnotationVisitor |
visitParameterAnnotation(int index,
String descriptor,
boolean visible) |
org.objectweb.asm.AnnotationVisitor |
visitTypeAnnotation(int typeReference,
org.objectweb.asm.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, visitTypeInsn
protected final org.objectweb.asm.MethodVisitor methodVisitor
protected final Implementation.Context implementationContext
protected final Advice.ArgumentHandler.ForAdvice argumentHandler
protected final Advice.MethodSizeHandler.ForAdvice methodSizeHandler
protected final Advice.StackMapFrameHandler.ForAdvice stackMapFrameHandler
protected final MethodDescription.InDefinedShape adviceMethod
protected final org.objectweb.asm.Label endOfMethod
protected CodeTranslationVisitor(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Advice.ArgumentHandler.ForAdvice argumentHandler, Advice.MethodSizeHandler.ForAdvice methodSizeHandler, Advice.StackMapFrameHandler.ForAdvice stackMapFrameHandler, MethodDescription instrumentedMethod, MethodDescription.InDefinedShape adviceMethod, Map<Integer,Advice.OffsetMapping.Target> offsetMappings, Advice.Dispatcher.SuppressionHandler.Bound suppressionHandler, Advice.Dispatcher.RelocationHandler.Bound relocationHandler)
methodVisitor
- A method visitor for writing the instrumented method's byte code.implementationContext
- The implementation context 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.instrumentedMethod
- The instrumented method.adviceMethod
- The advice method.offsetMappings
- A mapping of offsets to resolved target offsets in the instrumented method.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.protected void propagateHandler(org.objectweb.asm.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 org.objectweb.asm.MethodVisitor
public void visitAnnotableParameterCount(int count, boolean visible)
visitAnnotableParameterCount
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitAnnotationDefault()
visitAnnotationDefault
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitAnnotation(String descriptor, boolean visible)
visitAnnotation
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int typeReference, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
visitTypeAnnotation
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitParameterAnnotation(int index, String descriptor, boolean visible)
visitParameterAnnotation
in class org.objectweb.asm.MethodVisitor
public void visitAttribute(org.objectweb.asm.Attribute attribute)
visitAttribute
in class org.objectweb.asm.MethodVisitor
public void visitCode()
visitCode
in class org.objectweb.asm.MethodVisitor
public void visitFrame(int type, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack)
visitFrame
in class org.objectweb.asm.MethodVisitor
public void visitVarInsn(int opcode, int offset)
visitVarInsn
in class org.objectweb.asm.MethodVisitor
public void visitIincInsn(int offset, int value)
visitIincInsn
in class org.objectweb.asm.MethodVisitor
public void visitInsn(int opcode)
visitInsn
in class org.objectweb.asm.MethodVisitor
public void visitEnd()
visitEnd
in class org.objectweb.asm.MethodVisitor
public void visitMaxs(int stackSize, int localVariableLength)
visitMaxs
in class org.objectweb.asm.MethodVisitor
protected abstract int getReturnValueOffset()
void
.Copyright © 2014–2019. All rights reserved.