Package org.eclipse.m2m.atl.emftvm.jit
Class ByteCodeSwitch
java.lang.Object
org.eclipse.m2m.atl.emftvm.util.EmftvmSwitch<org.objectweb.asm.MethodVisitor>
org.eclipse.m2m.atl.emftvm.jit.ByteCodeSwitch
- All Implemented Interfaces:
org.objectweb.asm.Opcodes
public class ByteCodeSwitch
extends EmftvmSwitch<org.objectweb.asm.MethodVisitor>
implements org.objectweb.asm.Opcodes
Adds code to the given
MethodVisitor
, and returns it.-
Field Summary
Modifier and TypeFieldDescriptionThe map of primitive types to their boxed class counterpart type.protected final boolean
Whether or not the current execution environment has a monitor attached.protected final CodeBlockJIT
The JIT compiler to generate instructions for.protected final LabelSwitch
TheLabelSwitch
to look up generated labels.protected final org.objectweb.asm.MethodVisitor
TheMethodVisitor
to add code to.protected final Set<Instruction>
Set of instructions to skip while generating bytecode.Fields inherited from class org.eclipse.m2m.atl.emftvm.util.EmftvmSwitch
modelPackage
Fields inherited from interface org.objectweb.asm.Opcodes
AALOAD, AASTORE, ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_DEPRECATED, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_MANDATED, ACC_MODULE, ACC_NATIVE, ACC_OPEN, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_RECORD, ACC_STATIC, ACC_STATIC_PHASE, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_TRANSITIVE, ACC_VARARGS, ACC_VOLATILE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASM10_EXPERIMENTAL, ASM4, ASM5, ASM6, ASM7, ASM8, ASM9, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DMUL, DNEG, DOUBLE, DREM, DRETURN, DSTORE, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F_APPEND, F_CHOP, F_FULL, F_NEW, F_SAME, F_SAME1, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FLOAT, FMUL, FNEG, FREM, FRETURN, FSTORE, FSUB, GETFIELD, GETSTATIC, GOTO, H_GETFIELD, H_GETSTATIC, H_INVOKEINTERFACE, H_INVOKESPECIAL, H_INVOKESTATIC, H_INVOKEVIRTUAL, H_NEWINVOKESPECIAL, H_PUTFIELD, H_PUTSTATIC, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, IMUL, INEG, INSTANCEOF, INTEGER, INVOKEDYNAMIC, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, JSR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDIV, LLOAD, LMUL, LNEG, LONG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, NULL, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SOURCE_DEPRECATED, SOURCE_MASK, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH, TOP, UNINITIALIZED_THIS, V_PREVIEW, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V10, V11, V12, V13, V14, V15, V16, V17, V18, V19, V20, V21, V22, V23, V9
-
Constructor Summary
ConstructorDescriptionByteCodeSwitch
(CodeBlockJIT jit, org.objectweb.asm.MethodVisitor mv, LabelSwitch ls) Creates a newByteCodeSwitch
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
aastore()
protected void
protected void
aload
(int var) Generates an ALOAD instruction.protected void
protected void
areturn()
protected void
astore
(int var) Generates an ASTORE instruction.protected void
athrow()
static Class<?>
Returns the boxed version oftype
, ortype
if no boxing required.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Add'.org.objectweb.asm.MethodVisitor
caseAllinst
(Allinst object) Returns the result of interpreting the object as an instance of 'Allinst'.org.objectweb.asm.MethodVisitor
caseAllinstIn
(AllinstIn object) Returns the result of interpreting the object as an instance of 'Allinst In'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'And'.org.objectweb.asm.MethodVisitor
caseDelete
(Delete object) Returns the result of interpreting the object as an instance of 'Delete'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Dup'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Dup X1'.org.objectweb.asm.MethodVisitor
caseEnditerate
(Enditerate object) Returns the result of interpreting the object as an instance of 'Enditerate'.org.objectweb.asm.MethodVisitor
caseFindtype
(Findtype object) Returns the result of interpreting the object as an instance of 'Findtype'.org.objectweb.asm.MethodVisitor
caseFindtypeS
(FindtypeS object) Returns the result of interpreting the object as an instance of 'Findtype S'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Get'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Getcb'.org.objectweb.asm.MethodVisitor
caseGetenv
(Getenv object) Returns the result of interpreting the object as an instance of 'Getenv'.org.objectweb.asm.MethodVisitor
caseGetenvtype
(Getenvtype object) Returns the result of interpreting the object as an instance of 'Getenvtype'.org.objectweb.asm.MethodVisitor
caseGetStatic
(GetStatic object) Returns the result of interpreting the object as an instance of 'Get Static'.org.objectweb.asm.MethodVisitor
caseGetSuper
(GetSuper object) Returns the result of interpreting the object as an instance of 'Get Super'.org.objectweb.asm.MethodVisitor
caseGetTrans
(GetTrans object) Returns the result of interpreting the object as an instance of 'Get Trans'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Goto'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'If'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Ifn'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Ifte'.org.objectweb.asm.MethodVisitor
caseImplies
(Implies object) Returns the result of interpreting the object as an instance of 'Implies'.org.objectweb.asm.MethodVisitor
caseInsert
(Insert object) Returns the result of interpreting the object as an instance of 'Insert'.org.objectweb.asm.MethodVisitor
caseInstruction
(Instruction object) Returns the result of interpreting the object as an instance of 'Instruction'.org.objectweb.asm.MethodVisitor
caseInvoke
(Invoke object) Returns the result of interpreting the object as an instance of 'Invoke'.org.objectweb.asm.MethodVisitor
caseInvokeAllCbs
(InvokeAllCbs object) Returns the result of interpreting the object as an instance of 'Invoke All Cbs'.org.objectweb.asm.MethodVisitor
caseInvokeCb
(InvokeCb object) Returns the result of interpreting the object as an instance of 'Invoke Cb'.org.objectweb.asm.MethodVisitor
caseInvokeCbS
(InvokeCbS object) Returns the result of interpreting the object as an instance of 'Invoke Cb S'.org.objectweb.asm.MethodVisitor
caseInvokeStatic
(InvokeStatic object) Returns the result of interpreting the object as an instance of 'Invoke Static'.org.objectweb.asm.MethodVisitor
caseInvokeSuper
(InvokeSuper object) Returns the result of interpreting the object as an instance of 'Invoke Super'.org.objectweb.asm.MethodVisitor
caseIsnull
(Isnull object) Returns the result of interpreting the object as an instance of 'Isnull'.org.objectweb.asm.MethodVisitor
caseIterate
(Iterate object) Returns the result of interpreting the object as an instance of 'Iterate'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Load'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Match'.org.objectweb.asm.MethodVisitor
caseMatchS
(MatchS object) Returns the result of interpreting the object as an instance of 'Match S'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'New'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'New S'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Not'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Or'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Pop'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Push'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Pushf'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Pusht'.org.objectweb.asm.MethodVisitor
caseRemove
(Remove object) Returns the result of interpreting the object as an instance of 'Remove'.org.objectweb.asm.MethodVisitor
caseReturn
(Return object) Returns the result of interpreting the object as an instance of 'Return'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Set'.org.objectweb.asm.MethodVisitor
caseSetStatic
(SetStatic object) Returns the result of interpreting the object as an instance of 'Set Static'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Store'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Swap'.org.objectweb.asm.MethodVisitor
caseSwapX1
(SwapX1 object) Returns the result of interpreting the object as an instance of 'Swap X1'.org.objectweb.asm.MethodVisitor
Returns the result of interpreting the object as an instance of 'Xor'.protected void
protected void
dup()
protected void
dup_x1()
protected void
dup_x2()
protected void
Generates a field access instruction.protected void
generateBoxing
(Class<?> cls, Class<?> selfCls) Generates boxing code for a value of typecls
, if necessary.protected void
generatePushInt
(int value) Generates an optimised instruction for pushing a constant integervalue
onto the stack.protected void
generateSetPc
(Instruction object) Generates frame.setPc(pc) forobject
, iffhasMonitor
isfalse
.protected void
generateSubFrame
(String opname) Generates bytecode that creates a new sub-StackFrame
.protected void
generateUnboxing
(Class<?> cls) Generates unboxing code for a value of typecls
, if necessary.protected void
protected void
protected void
goto_
(org.objectweb.asm.Label label) protected void
iconst_0()
protected void
iconst_1()
protected void
ifeq
(org.objectweb.asm.Label label) protected void
ifne
(org.objectweb.asm.Label label) protected void
ifnonnull
(org.objectweb.asm.Label label) protected void
ifnull
(org.objectweb.asm.Label label) protected void
instanceof_
(Class<?> cls) protected void
Generates a method invocation instruction.protected void
invokeCons
(Class<?> owner, Object... argTypes) protected void
invokeIface
(Class<?> owner, String name, Object retType, Object... argTypes) protected void
invokeSpec
(Class<?> owner, String name, Object retClass, Object... argClasses) protected void
invokeStat
(Class<?> owner, String name, Object retType, Object... argTypes) protected void
invokeVirt
(Class<?> owner, String name, Object retType, Object... argTypes) protected void
label
(org.objectweb.asm.Label label) Inserts a label.protected void
protected void
localVariable
(String name, Class<?> type, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index) Generates a local variable table entry.protected void
protected Instruction
nextInstruction
(Instruction instruction) Returns the next instruction for the given instruction, ornull
.protected void
pop()
protected void
protected void
protected void
swap()
protected void
tryCatchBlock
(org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.Label handler, Class<?> type) Generates a try-catch block.Methods inherited from class org.eclipse.m2m.atl.emftvm.util.EmftvmSwitch
caseBranchInstruction, caseCodeBlock, caseCodeBlockInstruction, caseExecEnv, caseFeature, caseField, caseFieldInstruction, caseInputRuleElement, caseInvokeInstruction, caseInvokeOperationInstruction, caseLineNumber, caseLocalVariable, caseLocalVariableInstruction, caseMetamodel, caseModel, caseModelDeclaration, caseModule, caseNamedElement, caseOperation, caseOutputRuleElement, caseParameter, caseRule, caseRuleElement, caseTypedElement, defaultCase, doSwitch, doSwitch, doSwitch
-
Field Details
-
BOXED_CLASSES
The map of primitive types to their boxed class counterpart type. -
mv
protected final org.objectweb.asm.MethodVisitor mvTheMethodVisitor
to add code to. -
ls
TheLabelSwitch
to look up generated labels. -
jit
The JIT compiler to generate instructions for. -
hasMonitor
protected final boolean hasMonitorWhether or not the current execution environment has a monitor attached. -
skipInstructions
Set of instructions to skip while generating bytecode.
-
-
Constructor Details
-
ByteCodeSwitch
Creates a newByteCodeSwitch
.- Parameters:
jit
- the JIT compiler to generate instructions formv
- theMethodVisitor
to add code tols
- theLabelSwitch
to look up generated labels
-
-
Method Details
-
boxed
Returns the boxed version oftype
, ortype
if no boxing required.- Parameters:
type
- the type to box- Returns:
- the boxed version of
type
, ortype
if no boxing required
-
caseInstruction
Description copied from class:EmftvmSwitch
Returns the result of interpreting the object as an instance of 'Instruction'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseInstruction
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Instruction'.
- See Also:
-
casePush
Returns the result of interpreting the object as an instance of 'Push'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
casePush
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Push'.
- See Also:
-
casePusht
Returns the result of interpreting the object as an instance of 'Pusht'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
casePusht
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Pusht'.
- See Also:
-
casePushf
Returns the result of interpreting the object as an instance of 'Pushf'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
casePushf
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Pushf'.
- See Also:
-
casePop
Returns the result of interpreting the object as an instance of 'Pop'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
casePop
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Pop'.
- See Also:
-
caseLoad
Returns the result of interpreting the object as an instance of 'Load'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseLoad
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Load'.
- See Also:
-
caseStore
Returns the result of interpreting the object as an instance of 'Store'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseStore
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Store'.
- See Also:
-
caseSet
Returns the result of interpreting the object as an instance of 'Set'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseSet
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Set'.
- See Also:
-
caseGet
Returns the result of interpreting the object as an instance of 'Get'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseGet
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Get'.
- See Also:
-
caseGetTrans
Returns the result of interpreting the object as an instance of 'Get Trans'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseGetTrans
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Get Trans'.
- See Also:
-
caseSetStatic
Returns the result of interpreting the object as an instance of 'Set Static'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseSetStatic
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Set Static'.
- See Also:
-
caseGetStatic
Returns the result of interpreting the object as an instance of 'Get Static'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseGetStatic
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Get Static'.
- See Also:
-
caseFindtype
Returns the result of interpreting the object as an instance of 'Findtype'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseFindtype
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Findtype'.
- See Also:
-
caseFindtypeS
Returns the result of interpreting the object as an instance of 'Findtype S'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseFindtypeS
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Findtype S'.
- See Also:
-
caseNew
Returns the result of interpreting the object as an instance of 'New'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseNew
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'New'.
- See Also:
-
caseNewS
Returns the result of interpreting the object as an instance of 'New S'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseNewS
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'New S'.
- See Also:
-
caseDelete
Returns the result of interpreting the object as an instance of 'Delete'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseDelete
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Delete'.
- See Also:
-
caseDup
Returns the result of interpreting the object as an instance of 'Dup'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseDup
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Dup'.
- See Also:
-
caseDupX1
Returns the result of interpreting the object as an instance of 'Dup X1'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseDupX1
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Dup X1'.
- See Also:
-
caseSwap
Returns the result of interpreting the object as an instance of 'Swap'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseSwap
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Swap'.
- See Also:
-
caseSwapX1
Returns the result of interpreting the object as an instance of 'Swap X1'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseSwapX1
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Swap X1'.
- See Also:
-
caseIf
Returns the result of interpreting the object as an instance of 'If'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseIf
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'If'.
- See Also:
-
caseIfn
Returns the result of interpreting the object as an instance of 'Ifn'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseIfn
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Ifn'.
- See Also:
-
caseGoto
Returns the result of interpreting the object as an instance of 'Goto'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseGoto
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Goto'.
- See Also:
-
caseIterate
Returns the result of interpreting the object as an instance of 'Iterate'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseIterate
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Iterate'.
- See Also:
-
caseEnditerate
Returns the result of interpreting the object as an instance of 'Enditerate'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseEnditerate
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Enditerate'.
- See Also:
-
caseInvoke
Returns the result of interpreting the object as an instance of 'Invoke'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseInvoke
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Invoke'.
- See Also:
-
caseInvokeSuper
Returns the result of interpreting the object as an instance of 'Invoke Super'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseInvokeSuper
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Invoke Super'.
- See Also:
-
caseInvokeStatic
Returns the result of interpreting the object as an instance of 'Invoke Static'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseInvokeStatic
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Invoke Static'.
- See Also:
-
caseAllinst
Returns the result of interpreting the object as an instance of 'Allinst'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseAllinst
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Allinst'.
- See Also:
-
caseAllinstIn
Returns the result of interpreting the object as an instance of 'Allinst In'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseAllinstIn
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Allinst In'.
- See Also:
-
caseMatch
Returns the result of interpreting the object as an instance of 'Match'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseMatch
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Match'.
- See Also:
-
caseMatchS
Returns the result of interpreting the object as an instance of 'Match S'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseMatchS
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Match S'.
- See Also:
-
caseAdd
Returns the result of interpreting the object as an instance of 'Add'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseAdd
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Add'.
- See Also:
-
caseRemove
Returns the result of interpreting the object as an instance of 'Remove'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseRemove
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Remove'.
- See Also:
-
caseInsert
Returns the result of interpreting the object as an instance of 'Insert'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseInsert
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Insert'.
- See Also:
-
caseGetSuper
Returns the result of interpreting the object as an instance of 'Get Super'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseGetSuper
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Get Super'.
- See Also:
-
caseGetenv
Returns the result of interpreting the object as an instance of 'Getenv'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseGetenv
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Getenv'.
- See Also:
-
caseReturn
Returns the result of interpreting the object as an instance of 'Return'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseReturn
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Return'.
- See Also:
-
caseGetcb
Returns the result of interpreting the object as an instance of 'Getcb'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseGetcb
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Getcb'.
- See Also:
-
caseInvokeAllCbs
Returns the result of interpreting the object as an instance of 'Invoke All Cbs'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseInvokeAllCbs
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Invoke All Cbs'.
- See Also:
-
caseInvokeCb
Returns the result of interpreting the object as an instance of 'Invoke Cb'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseInvokeCb
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Invoke Cb'.
- See Also:
-
caseInvokeCbS
Returns the result of interpreting the object as an instance of 'Invoke Cb S'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseInvokeCbS
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Invoke Cb S'.
- See Also:
-
caseNot
Returns the result of interpreting the object as an instance of 'Not'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseNot
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Not'.
- See Also:
-
caseAnd
Returns the result of interpreting the object as an instance of 'And'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseAnd
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'And'.
- See Also:
-
caseOr
Returns the result of interpreting the object as an instance of 'Or'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseOr
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Or'.
- See Also:
-
caseXor
Returns the result of interpreting the object as an instance of 'Xor'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseXor
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Xor'.
- See Also:
-
caseImplies
Returns the result of interpreting the object as an instance of 'Implies'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseImplies
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Implies'.
- See Also:
-
caseIfte
Returns the result of interpreting the object as an instance of 'Ifte'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseIfte
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Ifte'.
- See Also:
-
caseIsnull
Returns the result of interpreting the object as an instance of 'Isnull'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseIsnull
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Isnull'.
- See Also:
-
caseGetenvtype
Returns the result of interpreting the object as an instance of 'Getenvtype'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseGetenvtype
in classEmftvmSwitch<org.objectweb.asm.MethodVisitor>
- Parameters:
object
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Getenvtype'.
- See Also:
-
generateSetPc
Generates frame.setPc(pc) forobject
, iffhasMonitor
isfalse
.- Parameters:
object
- the next instruction
-
generateSubFrame
Generates bytecode that creates a new sub-StackFrame
.- Parameters:
opname
- the operation name (for debugger)
-
generateBoxing
Generates boxing code for a value of typecls
, if necessary.- Parameters:
cls
- the value classselfCls
- the class of self
-
generateUnboxing
Generates unboxing code for a value of typecls
, if necessary.- Parameters:
cls
- the value class
-
generatePushInt
protected void generatePushInt(int value) Generates an optimised instruction for pushing a constant integervalue
onto the stack.- Parameters:
value
- the constant integer value to push
-
label
protected void label(org.objectweb.asm.Label label) Inserts a label.- Parameters:
label
- the label to insert
-
aload
protected void aload(int var) Generates an ALOAD instruction.- Parameters:
var
- the index of the local variable to load
-
astore
protected void astore(int var) Generates an ASTORE instruction.- Parameters:
var
- the index of the local variable to store
-
new_
-
checkcast
-
instanceof_
-
anewarray
-
dup
protected void dup() -
dup_x1
protected void dup_x1() -
dup_x2
protected void dup_x2() -
pop
protected void pop() -
swap
protected void swap() -
ldc
-
aconst_null
protected void aconst_null() -
aastore
protected void aastore() -
areturn
protected void areturn() -
iconst_1
protected void iconst_1() -
iconst_0
protected void iconst_0() -
invoke
Generates a method invocation instruction. -
invokeIface
-
invokeVirt
-
invokeStat
-
invokeSpec
-
invokeCons
-
field
Generates a field access instruction.- Parameters:
opcode
- the field access opcode (e.g. GETFIELD)owner
- the field owner classname
- the field nametype
- the fieldClass
orType
-
getField
-
putField
-
getStatic
-
putStatic
-
ifne
protected void ifne(org.objectweb.asm.Label label) -
ifeq
protected void ifeq(org.objectweb.asm.Label label) -
goto_
protected void goto_(org.objectweb.asm.Label label) -
ifnull
protected void ifnull(org.objectweb.asm.Label label) -
ifnonnull
protected void ifnonnull(org.objectweb.asm.Label label) -
athrow
protected void athrow() -
localVariable
protected void localVariable(String name, Class<?> type, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index) Generates a local variable table entry.- Parameters:
name
- the name of a local variable.type
- the type of this local variable.start
- the first instruction corresponding to the scope of this local variable (inclusive).end
- the last instruction corresponding to the scope of this local variable (exclusive).index
- the local variable's index.- Throws:
IllegalArgumentException
- if one of the labels has not already been visited by this visitor (by theMethodVisitor.visitLabel(org.objectweb.asm.Label)
method).
-
tryCatchBlock
protected void tryCatchBlock(org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.Label handler, Class<?> type) Generates a try-catch block.- Parameters:
start
- beginning of the exception handler's scope (inclusive).end
- end of the exception handler's scope (exclusive).handler
- beginning of the exception handler's code.type
- internal name of the type of exceptions handled by the handler, or null to catch any exceptions (for "finally" blocks).- Throws:
IllegalArgumentException
- if one of the labels has already been visited by this visitor (by theMethodVisitor.visitLabel(org.objectweb.asm.Label)
method).
-
nextInstruction
Returns the next instruction for the given instruction, ornull
.- Parameters:
instruction
- the instruction- Returns:
- the next instruction for the given instruction, or
null
-