Top Description Fields Constructors Methods
org.eclipse.persistence.internal.libraries.asm.commons

public Class InstructionAdapter

extends MethodVisitor
Class Inheritance
Imports
org.eclipse.persistence.internal.libraries.asm.ConstantDynamic, .Handle, .Label, .MethodVisitor, .Opcodes, .Type

A MethodVisitor providing a more detailed API to generate and transform instructions.
Author
Eric Bruneton

Field Summary

Modifier and TypeField and Description
public static final Type
OBJECT_TYPE

The type of the java.lang.Object class.

Inherited from org.eclipse.persistence.internal.libraries.asm.MethodVisitor:
apimv

Constructor Summary

AccessConstructor and Description
public
InstructionAdapter(final MethodVisitor
the method visitor to which this adapter delegates calls.
methodVisitor
)

Constructs a new InstructionAdapter.

protected
InstructionAdapter(final int
the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.
api
,
final MethodVisitor
the method visitor to which this adapter delegates calls.
methodVisitor
)

Constructs a new InstructionAdapter.

Method Summary

Modifier and TypeMethod and Description
public void
aconst(final Object
the constant to be pushed on the stack. This parameter must be an Integer, a Float, a Long, a Double, a String, a Type of OBJECT or ARRAY sort for .class constants, for classes whose version is 49, a Type of METHOD sort for MethodType, a Handle for MethodHandle constants, for classes whose version is 51 or a ConstantDynamic for a constant dynamic for classes whose version is 55.
value
)

Generates the instruction to push the given value on the stack.

public void
add(final Type type)

public void
aload(final Type type)

public void
and(final Type type)

public void
anew(final Type type)

public void
areturn(final Type type)

public void
public void
astore(final Type type)

public void
public void
cast(final Type
a Type.
from
,
final Type
a Type.
to
)

Generates the instruction to cast from the first given type to the other.

pack-priv static void
cast(final MethodVisitor
the method visitor to use to generate the instruction.
methodVisitor
,
final Type
a Type.
from
,
final Type
a Type.
to
)

Generates the instruction to cast from the first given type to the other.

public void
cconst(final ConstantDynamic
the constant dynamic to be pushed on the stack.
constantDynamic
)

Generates the instruction to push the given constant dynamic on the stack.

public void
checkcast(final Type type)

public void
cmpg(final Type type)

public void
cmpl(final Type type)

public void
dconst(final double
the constant to be pushed on the stack.
doubleValue
)

Generates the instruction to push the given value on the stack.

public void
div(final Type type)

public void
dup()

public void
dup2()

public void
public void
public void
public void
public void
fconst(final float
the constant to be pushed on the stack.
floatValue
)

Generates the instruction to push the given value on the stack.

public void
getfield(final String owner, final String name, final String descriptor)

public void
getstatic(final String owner, final String name, final String descriptor)

public void
goTo(final Label label)

public void
hconst(final Handle
the handle to be pushed on the stack.
handle
)

Generates the instruction to push the given handle on the stack.

public void
iconst(final int
the constant to be pushed on the stack.
intValue
)

Generates the instruction to push the given value on the stack.

public void
ifacmpeq(final Label label)

public void
ifacmpne(final Label label)

public void
ifeq(final Label label)

public void
ifge(final Label label)

public void
ifgt(final Label label)

public void
ificmpeq(final Label label)

public void
ificmpge(final Label label)

public void
ificmpgt(final Label label)

public void
ificmple(final Label label)

public void
ificmplt(final Label label)

public void
ificmpne(final Label label)

public void
ifle(final Label label)

public void
iflt(final Label label)

public void
ifne(final Label label)

public void
ifnonnull(final Label label)

public void
ifnull(final Label label)

public void
iinc(final int varIndex, final int increment)

public void
instanceOf(final Type type)

public void
invokedynamic(final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
,
final Handle
the bootstrap method.
bootstrapMethodHandle
,
final Object[]
the bootstrap method constant arguments. Each argument must be an Integer, Float, Long, Double, String, Type, Handle or ConstantDynamic value. This method is allowed to modify the content of the array so a caller should expect that this array may change.
bootstrapMethodArguments
)

Generates the instruction to call the given dynamic method.

public void
invokeinterface(final String
the internal name of the method's owner class (see Type#getInternalName()).
owner
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
)

Generates the instruction to call the given interface method.

public void
invokespecial(final String
the internal name of the method's owner class (see Type#getInternalName()).
owner
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
)

Deprecated.
public void
invokespecial(final String
the internal name of the method's owner class (see Type#getInternalName()).
owner
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
,
final boolean
if the method's owner class is an interface.
isInterface
)

Generates the instruction to call the given special method.

public void
invokestatic(final String
the internal name of the method's owner class (see Type#getInternalName()).
owner
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
)

Deprecated.
public void
invokestatic(final String
the internal name of the method's owner class (see Type#getInternalName()).
owner
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
,
final boolean
if the method's owner class is an interface.
isInterface
)

Generates the instruction to call the given static method.

public void
invokevirtual(final String
the internal name of the method's owner class (see Type#getInternalName()).
owner
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
)

Deprecated.
public void
invokevirtual(final String
the internal name of the method's owner class (see Type#getInternalName()).
owner
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
,
final boolean
if the method's owner class is an interface.
isInterface
)

Generates the instruction to call the given virtual method.

public void
jsr(final Label label)

public void
lcmp()

public void
lconst(final long
the constant to be pushed on the stack.
longValue
)

Generates the instruction to push the given value on the stack.

public void
load(final int varIndex, final Type type)

public void
lookupswitch(final Label dflt, final int[] keys, final Label[] labels)

public void
mark(final Label label)

public void
public void
public void
mul(final Type type)

public void
multianewarray(final String descriptor, final int numDimensions)

public void
neg(final Type type)

public void
newarray(final Type
an array Type.
type
)

Generates the instruction to create and push on the stack an array of the given type.

pack-priv static void
newarray(final MethodVisitor
the method visitor to use to generate the instruction.
methodVisitor
,
final Type
an array Type.
type
)

Generates the instruction to create and push on the stack an array of the given type.

public void
nop()

Generates a nop instruction.

public void
or(final Type type)

public void
pop()

public void
pop2()

public void
putfield(final String owner, final String name, final String descriptor)

public void
putstatic(final String owner, final String name, final String descriptor)

public void
rem(final Type type)

public void
ret(final int varIndex)

public void
shl(final Type type)

public void
shr(final Type type)

public void
store(final int varIndex, final Type type)

public void
sub(final Type type)

public void
swap()

public void
tableswitch(final int min, final int max, final Label dflt, final Label... labels)

public void
tconst(final Type
the type to be pushed on the stack.
type
)

Generates the instruction to push the given type on the stack.

public void
ushr(final Type type)

public void
visitFieldInsn(final int
the opcode of the type instruction to be visited. This opcode is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
opcode
,
final String
the internal name of the field's owner class (see Type#getInternalName()).
owner
,
final String
the field's name.
name
,
final String
the field's descriptor (see Type).
descriptor
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitFieldInsn.

Visits a field instruction.
public void
visitIincInsn(final int
index of the local variable to be incremented.
varIndex
,
final int
amount to increment the local variable by.
increment
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitIincInsn.

Visits an IINC instruction.
public void
visitInsn(final int
the opcode of the instruction to be visited. This opcode is either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL, LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B, I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN, FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW, MONITORENTER, or MONITOREXIT.
opcode
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitInsn.

Visits a zero operand instruction.
public void
visitIntInsn(final int
the opcode of the instruction to be visited. This opcode is either BIPUSH, SIPUSH or NEWARRAY.
opcode
,
final int
the operand of the instruction to be visited.
When opcode is BIPUSH, operand value should be between Byte.MIN_VALUE and Byte.MAX_VALUE.
When opcode is SIPUSH, operand value should be between Short.MIN_VALUE and Short.MAX_VALUE.
When opcode is NEWARRAY, operand value should be one of Opcodes#T_BOOLEAN, Opcodes#T_CHAR, Opcodes#T_FLOAT, Opcodes#T_DOUBLE, Opcodes#T_BYTE, Opcodes#T_SHORT, Opcodes#T_INT or Opcodes#T_LONG.
operand
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitIntInsn.

Visits an instruction with a single int operand.
public void
visitInvokeDynamicInsn(final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
,
final Handle
the bootstrap method.
bootstrapMethodHandle
,
final Object...
the bootstrap method constant arguments. Each argument must be an Integer, Float, Long, Double, String, Type, Handle or ConstantDynamic value. This method is allowed to modify the content of the array so a caller should expect that this array may change.
bootstrapMethodArguments
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitInvokeDynamicInsn.

Visits an invokedynamic instruction.
public void
visitJumpInsn(final int
the opcode of the type instruction to be visited. This opcode is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
opcode
,
final Label
the operand of the instruction to be visited. This operand is a label that designates the instruction to which the jump instruction may jump.
label
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitJumpInsn.

Visits a jump instruction.
public void
public void
visitLdcInsn(final Object
the constant to be loaded on the stack. This parameter must be a non null Integer, a Float, a Long, a Double, a String, a Type of OBJECT or ARRAY sort for .class constants, for classes whose version is 49, a Type of METHOD sort for MethodType, a Handle for MethodHandle constants, for classes whose version is 51 or a ConstantDynamic for a constant dynamic for classes whose version is 55.
value
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitLdcInsn.

Visits a LDC instruction.
public void
visitLookupSwitchInsn(final Label
beginning of the default handler block.
dflt
,
final int[]
the values of the keys.
keys
,
final Label[]
beginnings of the handler blocks. labels[i] is the beginning of the handler block for the keys[i] key.
labels
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitLookupSwitchInsn.

Visits a LOOKUPSWITCH instruction.
public void
visitMethodInsn(final int
the opcode of the type instruction to be visited. This opcode is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
opcodeAndSource
,
final String
the internal name of the method's owner class (see Type#getInternalName()).
owner
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
descriptor
,
final boolean
if the method's owner class is an interface.
isInterface
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitMethodInsn.

Visits a method instruction.
public void
visitMultiANewArrayInsn(final String
an array type descriptor (see Type).
descriptor
,
final int
the number of dimensions of the array to allocate.
numDimensions
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitMultiANewArrayInsn.

Visits a MULTIANEWARRAY instruction.
public void
visitTableSwitchInsn(final int
the minimum key value.
min
,
final int
the maximum key value.
max
,
final Label
beginning of the default handler block.
dflt
,
final Label...
beginnings of the handler blocks. labels[i] is the beginning of the handler block for the min + i key.
labels
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitTableSwitchInsn.

Visits a TABLESWITCH instruction.
public void
visitTypeInsn(final int
the opcode of the type instruction to be visited. This opcode is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
opcode
,
final String
the operand of the instruction to be visited. This operand must be the internal name of an object or array class (see Type#getInternalName()).
type
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitTypeInsn.

Visits a type instruction.
public void
visitVarInsn(final int
the opcode of the local variable instruction to be visited. This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.
opcode
,
final int
the operand of the instruction to be visited. This operand is the index of a local variable.
varIndex
)

Overrides org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitVarInsn.

Visits a local variable instruction.
public void
xor(final Type type)

Inherited from org.eclipse.persistence.internal.libraries.asm.MethodVisitor:
getDelegatevisitAnnotableParameterCountvisitAnnotationvisitAnnotationDefaultvisitAttributevisitCodevisitEndvisitFramevisitInsnAnnotationvisitLineNumbervisitLocalVariablevisitLocalVariableAnnotationvisitMaxsvisitMethodInsnvisitParametervisitParameterAnnotationvisitTryCatchAnnotationvisitTryCatchBlockvisitTypeAnnotation