Package net.bytebuddy.build
Class CachedReturnPlugin.AdviceResolver.ExitAdviceByteCodeAppender
- java.lang.Object
-
- net.bytebuddy.build.CachedReturnPlugin.AdviceResolver.ExitAdviceByteCodeAppender
-
- All Implemented Interfaces:
ByteCodeAppender
- Enclosing class:
- CachedReturnPlugin.AdviceResolver
@Enhance protected static class CachedReturnPlugin.AdviceResolver.ExitAdviceByteCodeAppender extends java.lang.Object implements ByteCodeAppender
A byte code appender for the exit advice.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.ByteCodeAppender
ByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.Size
-
-
Field Summary
Fields Modifier and Type Field Description private int
branch
A jump instruction that checks if the cached value is already set.private int
convert
An instruction to convert the cached value to a value that is applied on the branch instruction.private int
load
The byte code that loads a value onto the stack from the local variable array.private int
size
The size of the created type on the operand stack.private int
store
The byte code that stores a value to the local variable array.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExitAdviceByteCodeAppender(int load, int store, int convert, int branch, int size)
Creates a byte code appender for exit advice on a cached return plugin.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteCodeAppender.Size
apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)
Applies this byte code appender to a type creation process.
-
-
-
Field Detail
-
load
private final int load
The byte code that loads a value onto the stack from the local variable array.
-
store
private final int store
The byte code that stores a value to the local variable array.
-
convert
private final int convert
An instruction to convert the cached value to a value that is applied on the branch instruction.
-
branch
private final int branch
A jump instruction that checks if the cached value is already set.
-
size
private final int size
The size of the created type on the operand stack.
-
-
Constructor Detail
-
ExitAdviceByteCodeAppender
protected ExitAdviceByteCodeAppender(int load, int store, int convert, int branch, int size)
Creates a byte code appender for exit advice on a cached return plugin.- Parameters:
load
- The byte code that loads a value onto the stack from the local variable array.store
- The byte code that stores a value to the local variable array.convert
- An instruction to convert the cached value to a value that is applied on the branch instruction.branch
- A jump instruction that checks if the cached value is already set.size
- The size of the created type on the operand stack.
-
-
Method Detail
-
apply
public ByteCodeAppender.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)
Applies this byte code appender to a type creation process.- Specified by:
apply
in interfaceByteCodeAppender
- Parameters:
methodVisitor
- The method visitor to which the byte code appender writes its code to.implementationContext
- The implementation context of the current type creation process.instrumentedMethod
- The method that is the target of the instrumentation.- Returns:
- The required size for the applied byte code to run.
-
-