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
FieldsModifier and TypeFieldDescriptionThe map of primitive types to their boxed class counterpart type.protected final booleanWhether or not the current execution environment has a monitor attached.protected final CodeBlockJITThe JIT compiler to generate instructions for.protected final LabelSwitchTheLabelSwitchto look up generated labels.protected final org.objectweb.asm.MethodVisitorTheMethodVisitorto 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
modelPackageFields 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, V24, V25, V9 -
Constructor Summary
ConstructorsConstructorDescriptionByteCodeSwitch(CodeBlockJIT jit, org.objectweb.asm.MethodVisitor mv, LabelSwitch ls) Creates a newByteCodeSwitch. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaastore()protected voidprotected voidaload(int var) Generates an ALOAD instruction.protected voidprotected voidareturn()protected voidastore(int var) Generates an ASTORE instruction.protected voidathrow()static Class<?> Returns the boxed version oftype, ortypeif no boxing required.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Add'.org.objectweb.asm.MethodVisitorcaseAllinst(Allinst object) Returns the result of interpreting the object as an instance of 'Allinst'.org.objectweb.asm.MethodVisitorcaseAllinstIn(AllinstIn object) Returns the result of interpreting the object as an instance of 'Allinst In'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'And'.org.objectweb.asm.MethodVisitorcaseDelete(Delete object) Returns the result of interpreting the object as an instance of 'Delete'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Dup'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Dup X1'.org.objectweb.asm.MethodVisitorcaseEnditerate(Enditerate object) Returns the result of interpreting the object as an instance of 'Enditerate'.org.objectweb.asm.MethodVisitorcaseFindtype(Findtype object) Returns the result of interpreting the object as an instance of 'Findtype'.org.objectweb.asm.MethodVisitorcaseFindtypeS(FindtypeS object) Returns the result of interpreting the object as an instance of 'Findtype S'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Get'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Getcb'.org.objectweb.asm.MethodVisitorcaseGetenv(Getenv object) Returns the result of interpreting the object as an instance of 'Getenv'.org.objectweb.asm.MethodVisitorcaseGetenvtype(Getenvtype object) Returns the result of interpreting the object as an instance of 'Getenvtype'.org.objectweb.asm.MethodVisitorcaseGetStatic(GetStatic object) Returns the result of interpreting the object as an instance of 'Get Static'.org.objectweb.asm.MethodVisitorcaseGetSuper(GetSuper object) Returns the result of interpreting the object as an instance of 'Get Super'.org.objectweb.asm.MethodVisitorcaseGetTrans(GetTrans object) Returns the result of interpreting the object as an instance of 'Get Trans'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Goto'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'If'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Ifn'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Ifte'.org.objectweb.asm.MethodVisitorcaseImplies(Implies object) Returns the result of interpreting the object as an instance of 'Implies'.org.objectweb.asm.MethodVisitorcaseInsert(Insert object) Returns the result of interpreting the object as an instance of 'Insert'.org.objectweb.asm.MethodVisitorcaseInstruction(Instruction object) Returns the result of interpreting the object as an instance of 'Instruction'.org.objectweb.asm.MethodVisitorcaseInvoke(Invoke object) Returns the result of interpreting the object as an instance of 'Invoke'.org.objectweb.asm.MethodVisitorcaseInvokeAllCbs(InvokeAllCbs object) Returns the result of interpreting the object as an instance of 'Invoke All Cbs'.org.objectweb.asm.MethodVisitorcaseInvokeCb(InvokeCb object) Returns the result of interpreting the object as an instance of 'Invoke Cb'.org.objectweb.asm.MethodVisitorcaseInvokeCbS(InvokeCbS object) Returns the result of interpreting the object as an instance of 'Invoke Cb S'.org.objectweb.asm.MethodVisitorcaseInvokeStatic(InvokeStatic object) Returns the result of interpreting the object as an instance of 'Invoke Static'.org.objectweb.asm.MethodVisitorcaseInvokeSuper(InvokeSuper object) Returns the result of interpreting the object as an instance of 'Invoke Super'.org.objectweb.asm.MethodVisitorcaseIsnull(Isnull object) Returns the result of interpreting the object as an instance of 'Isnull'.org.objectweb.asm.MethodVisitorcaseIterate(Iterate object) Returns the result of interpreting the object as an instance of 'Iterate'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Load'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Match'.org.objectweb.asm.MethodVisitorcaseMatchS(MatchS object) Returns the result of interpreting the object as an instance of 'Match S'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'New'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'New S'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Not'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Or'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Pop'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Push'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Pushf'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Pusht'.org.objectweb.asm.MethodVisitorcaseRemove(Remove object) Returns the result of interpreting the object as an instance of 'Remove'.org.objectweb.asm.MethodVisitorcaseReturn(Return object) Returns the result of interpreting the object as an instance of 'Return'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Set'.org.objectweb.asm.MethodVisitorcaseSetStatic(SetStatic object) Returns the result of interpreting the object as an instance of 'Set Static'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Store'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Swap'.org.objectweb.asm.MethodVisitorcaseSwapX1(SwapX1 object) Returns the result of interpreting the object as an instance of 'Swap X1'.org.objectweb.asm.MethodVisitorReturns the result of interpreting the object as an instance of 'Xor'.protected voidprotected voiddup()protected voiddup_x1()protected voiddup_x2()protected voidGenerates a field access instruction.protected voidgenerateBoxing(Class<?> cls, Class<?> selfCls) Generates boxing code for a value of typecls, if necessary.protected voidgeneratePushInt(int value) Generates an optimised instruction for pushing a constant integervalueonto the stack.protected voidgenerateSetPc(Instruction object) Generates frame.setPc(pc) forobject, iffhasMonitorisfalse.protected voidgenerateSubFrame(String opname) Generates bytecode that creates a new sub-StackFrame.protected voidgenerateUnboxing(Class<?> cls) Generates unboxing code for a value of typecls, if necessary.protected voidprotected voidprotected voidgoto_(org.objectweb.asm.Label label) protected voidiconst_0()protected voidiconst_1()protected voidifeq(org.objectweb.asm.Label label) protected voidifne(org.objectweb.asm.Label label) protected voidifnonnull(org.objectweb.asm.Label label) protected voidifnull(org.objectweb.asm.Label label) protected voidinstanceof_(Class<?> cls) protected voidGenerates a method invocation instruction.protected voidinvokeCons(Class<?> owner, Object... argTypes) protected voidinvokeIface(Class<?> owner, String name, Object retType, Object... argTypes) protected voidinvokeSpec(Class<?> owner, String name, Object retClass, Object... argClasses) protected voidinvokeStat(Class<?> owner, String name, Object retType, Object... argTypes) protected voidinvokeVirt(Class<?> owner, String name, Object retType, Object... argTypes) protected voidlabel(org.objectweb.asm.Label label) Inserts a label.protected voidprotected voidlocalVariable(String name, Class<?> type, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index) Generates a local variable table entry.protected voidprotected InstructionnextInstruction(Instruction instruction) Returns the next instruction for the given instruction, ornull.protected voidpop()protected voidprotected voidprotected voidswap()protected voidtryCatchBlock(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 mvTheMethodVisitorto add code to. -
ls
TheLabelSwitchto 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- theMethodVisitorto add code tols- theLabelSwitchto look up generated labels
-
-
Method Details
-
boxed
Returns the boxed version oftype, ortypeif no boxing required.- Parameters:
type- the type to box- Returns:
- the boxed version of
type, ortypeif no boxing required
-
caseInstruction
Description copied from class:EmftvmSwitchReturns 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:
caseInstructionin 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:
casePushin 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:
casePushtin 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:
casePushfin 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:
casePopin 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:
caseLoadin 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:
caseStorein 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:
caseSetin 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:
caseGetin 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:
caseGetTransin 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:
caseSetStaticin 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:
caseGetStaticin 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:
caseFindtypein 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:
caseFindtypeSin 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:
caseNewin 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:
caseNewSin 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:
caseDeletein 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:
caseDupin 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:
caseDupX1in 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:
caseSwapin 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:
caseSwapX1in 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:
caseIfin 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:
caseIfnin 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:
caseGotoin 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:
caseIteratein 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:
caseEnditeratein 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:
caseInvokein 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:
caseInvokeSuperin 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:
caseInvokeStaticin 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:
caseAllinstin 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:
caseAllinstInin 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:
caseMatchin 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:
caseMatchSin 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:
caseAddin 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:
caseRemovein 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:
caseInsertin 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:
caseGetSuperin 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:
caseGetenvin 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:
caseReturnin 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:
caseGetcbin 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:
caseInvokeAllCbsin 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:
caseInvokeCbin 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:
caseInvokeCbSin 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:
caseNotin 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:
caseAndin 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:
caseOrin 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:
caseXorin 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:
caseImpliesin 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:
caseIftein 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:
caseIsnullin 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:
caseGetenvtypein 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, iffhasMonitorisfalse.- 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 integervalueonto 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 fieldClassorType
-
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
-