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 givenMethodVisitor, and returns it.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.Class<?>,java.lang.Class<?>>BOXED_CLASSESThe map of primitive types to their boxed class counterpart type.protected booleanhasMonitorWhether or not the current execution environment has a monitor attached.protected CodeBlockJITjitThe JIT compiler to generate instructions for.protected LabelSwitchlsTheLabelSwitchto look up generated labels.protected org.objectweb.asm.MethodVisitormvTheMethodVisitorto add code to.protected java.util.Set<Instruction>skipInstructionsSet 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, V9
-
-
Constructor Summary
Constructors Constructor Description ByteCodeSwitch(CodeBlockJIT jit, org.objectweb.asm.MethodVisitor mv, LabelSwitch ls)Creates a newByteCodeSwitch.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaastore()protected voidaconst_null()protected voidaload(int var)Generates an ALOAD instruction.protected voidanewarray(java.lang.Class<?> cls)protected voidareturn()protected voidastore(int var)Generates an ASTORE instruction.protected voidathrow()static java.lang.Class<?>boxed(java.lang.Class<?> type)Returns the boxed version oftype, ortypeif no boxing required.org.objectweb.asm.MethodVisitorcaseAdd(Add object)Returns 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.MethodVisitorcaseAnd(And object)Returns 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.MethodVisitorcaseDup(Dup object)Returns the result of interpreting the object as an instance of 'Dup'.org.objectweb.asm.MethodVisitorcaseDupX1(DupX1 object)Returns 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.MethodVisitorcaseGet(Get object)Returns the result of interpreting the object as an instance of 'Get'.org.objectweb.asm.MethodVisitorcaseGetcb(Getcb object)Returns 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.MethodVisitorcaseGoto(Goto object)Returns the result of interpreting the object as an instance of 'Goto'.org.objectweb.asm.MethodVisitorcaseIf(If object)Returns the result of interpreting the object as an instance of 'If'.org.objectweb.asm.MethodVisitorcaseIfn(Ifn object)Returns the result of interpreting the object as an instance of 'Ifn'.org.objectweb.asm.MethodVisitorcaseIfte(Ifte object)Returns 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.MethodVisitorcaseLoad(Load object)Returns the result of interpreting the object as an instance of 'Load'.org.objectweb.asm.MethodVisitorcaseMatch(Match object)Returns 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.MethodVisitorcaseNew(New object)Returns the result of interpreting the object as an instance of 'New'.org.objectweb.asm.MethodVisitorcaseNewS(NewS object)Returns the result of interpreting the object as an instance of 'New S'.org.objectweb.asm.MethodVisitorcaseNot(Not object)Returns the result of interpreting the object as an instance of 'Not'.org.objectweb.asm.MethodVisitorcaseOr(Or object)Returns the result of interpreting the object as an instance of 'Or'.org.objectweb.asm.MethodVisitorcasePop(Pop object)Returns the result of interpreting the object as an instance of 'Pop'.org.objectweb.asm.MethodVisitorcasePush(Push object)Returns the result of interpreting the object as an instance of 'Push'.org.objectweb.asm.MethodVisitorcasePushf(Pushf object)Returns the result of interpreting the object as an instance of 'Pushf'.org.objectweb.asm.MethodVisitorcasePusht(Pusht object)Returns 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.MethodVisitorcaseSet(Set object)Returns 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.MethodVisitorcaseStore(Store object)Returns the result of interpreting the object as an instance of 'Store'.org.objectweb.asm.MethodVisitorcaseSwap(Swap object)Returns 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.MethodVisitorcaseXor(Xor object)Returns the result of interpreting the object as an instance of 'Xor'.protected voidcheckcast(java.lang.Class<?> cls)protected voiddup()protected voiddup_x1()protected voiddup_x2()protected voidfield(int opcode, java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)Generates a field access instruction.protected voidgenerateBoxing(java.lang.Class<?> cls, java.lang.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(java.lang.String opname)Generates bytecode that creates a new sub-StackFrame.protected voidgenerateUnboxing(java.lang.Class<?> cls)Generates unboxing code for a value of typecls, if necessary.protected voidgetField(java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)protected voidgetStatic(java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)protected 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_(java.lang.Class<?> cls)protected voidinvoke(int opcode, java.lang.Class<?> owner, java.lang.String name, java.lang.Object retType, java.lang.Object... argTypes)Generates a method invocation instruction.protected voidinvokeCons(java.lang.Class<?> owner, java.lang.Object... argTypes)protected voidinvokeIface(java.lang.Class<?> owner, java.lang.String name, java.lang.Object retType, java.lang.Object... argTypes)protected voidinvokeSpec(java.lang.Class<?> owner, java.lang.String name, java.lang.Object retClass, java.lang.Object... argClasses)protected voidinvokeStat(java.lang.Class<?> owner, java.lang.String name, java.lang.Object retType, java.lang.Object... argTypes)protected voidinvokeVirt(java.lang.Class<?> owner, java.lang.String name, java.lang.Object retType, java.lang.Object... argTypes)protected voidlabel(org.objectweb.asm.Label label)Inserts a label.protected voidldc(java.lang.Object object)protected voidlocalVariable(java.lang.String name, java.lang.Class<?> type, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index)Generates a local variable table entry.protected voidnew_(java.lang.Class<?> cls)protected InstructionnextInstruction(Instruction instruction)Returns the next instruction for the given instruction, ornull.protected voidpop()protected voidputField(java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)protected voidputStatic(java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)protected voidswap()protected voidtryCatchBlock(org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.Label handler, java.lang.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 Detail
-
BOXED_CLASSES
public static final java.util.Map<java.lang.Class<?>,java.lang.Class<?>> BOXED_CLASSES
The map of primitive types to their boxed class counterpart type.
-
mv
protected final org.objectweb.asm.MethodVisitor mv
TheMethodVisitorto add code to.
-
ls
protected final LabelSwitch ls
TheLabelSwitchto look up generated labels.
-
jit
protected final CodeBlockJIT jit
The JIT compiler to generate instructions for.
-
hasMonitor
protected final boolean hasMonitor
Whether or not the current execution environment has a monitor attached.
-
skipInstructions
protected final java.util.Set<Instruction> skipInstructions
Set of instructions to skip while generating bytecode.
-
-
Constructor Detail
-
ByteCodeSwitch
public ByteCodeSwitch(CodeBlockJIT jit, org.objectweb.asm.MethodVisitor mv, LabelSwitch ls)
Creates a newByteCodeSwitch.- Parameters:
jit- the JIT compiler to generate instructions formv- theMethodVisitorto add code tols- theLabelSwitchto look up generated labels
-
-
Method Detail
-
boxed
public static java.lang.Class<?> boxed(java.lang.Class<?> type)
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
public org.objectweb.asm.MethodVisitor caseInstruction(Instruction object)
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:
doSwitch(EObject)
-
casePush
public org.objectweb.asm.MethodVisitor casePush(Push object)
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:
doSwitch(EObject)
-
casePusht
public org.objectweb.asm.MethodVisitor casePusht(Pusht object)
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:
doSwitch(EObject)
-
casePushf
public org.objectweb.asm.MethodVisitor casePushf(Pushf object)
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:
doSwitch(EObject)
-
casePop
public org.objectweb.asm.MethodVisitor casePop(Pop object)
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:
doSwitch(EObject)
-
caseLoad
public org.objectweb.asm.MethodVisitor caseLoad(Load object)
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:
doSwitch(EObject)
-
caseStore
public org.objectweb.asm.MethodVisitor caseStore(Store object)
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:
doSwitch(EObject)
-
caseSet
public org.objectweb.asm.MethodVisitor caseSet(Set object)
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:
doSwitch(EObject)
-
caseGet
public org.objectweb.asm.MethodVisitor caseGet(Get object)
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:
doSwitch(EObject)
-
caseGetTrans
public org.objectweb.asm.MethodVisitor caseGetTrans(GetTrans object)
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:
doSwitch(EObject)
-
caseSetStatic
public org.objectweb.asm.MethodVisitor caseSetStatic(SetStatic object)
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:
doSwitch(EObject)
-
caseGetStatic
public org.objectweb.asm.MethodVisitor caseGetStatic(GetStatic object)
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:
doSwitch(EObject)
-
caseFindtype
public org.objectweb.asm.MethodVisitor caseFindtype(Findtype object)
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:
doSwitch(EObject)
-
caseFindtypeS
public org.objectweb.asm.MethodVisitor caseFindtypeS(FindtypeS object)
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:
doSwitch(EObject)
-
caseNew
public org.objectweb.asm.MethodVisitor caseNew(New object)
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:
doSwitch(EObject)
-
caseNewS
public org.objectweb.asm.MethodVisitor caseNewS(NewS object)
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:
doSwitch(EObject)
-
caseDelete
public org.objectweb.asm.MethodVisitor caseDelete(Delete object)
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:
doSwitch(EObject)
-
caseDup
public org.objectweb.asm.MethodVisitor caseDup(Dup object)
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:
doSwitch(EObject)
-
caseDupX1
public org.objectweb.asm.MethodVisitor caseDupX1(DupX1 object)
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:
doSwitch(EObject)
-
caseSwap
public org.objectweb.asm.MethodVisitor caseSwap(Swap object)
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:
doSwitch(EObject)
-
caseSwapX1
public org.objectweb.asm.MethodVisitor caseSwapX1(SwapX1 object)
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:
doSwitch(EObject)
-
caseIf
public org.objectweb.asm.MethodVisitor caseIf(If object)
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:
doSwitch(EObject)
-
caseIfn
public org.objectweb.asm.MethodVisitor caseIfn(Ifn object)
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:
doSwitch(EObject)
-
caseGoto
public org.objectweb.asm.MethodVisitor caseGoto(Goto object)
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:
doSwitch(EObject)
-
caseIterate
public org.objectweb.asm.MethodVisitor caseIterate(Iterate object)
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:
doSwitch(EObject)
-
caseEnditerate
public org.objectweb.asm.MethodVisitor caseEnditerate(Enditerate object)
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:
doSwitch(EObject)
-
caseInvoke
public org.objectweb.asm.MethodVisitor caseInvoke(Invoke object)
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:
doSwitch(EObject)
-
caseInvokeSuper
public org.objectweb.asm.MethodVisitor caseInvokeSuper(InvokeSuper object)
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:
doSwitch(EObject)
-
caseInvokeStatic
public org.objectweb.asm.MethodVisitor caseInvokeStatic(InvokeStatic object)
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:
doSwitch(EObject)
-
caseAllinst
public org.objectweb.asm.MethodVisitor caseAllinst(Allinst object)
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:
doSwitch(EObject)
-
caseAllinstIn
public org.objectweb.asm.MethodVisitor caseAllinstIn(AllinstIn object)
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:
doSwitch(EObject)
-
caseMatch
public org.objectweb.asm.MethodVisitor caseMatch(Match object)
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:
doSwitch(EObject)
-
caseMatchS
public org.objectweb.asm.MethodVisitor caseMatchS(MatchS object)
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:
doSwitch(EObject)
-
caseAdd
public org.objectweb.asm.MethodVisitor caseAdd(Add object)
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:
doSwitch(EObject)
-
caseRemove
public org.objectweb.asm.MethodVisitor caseRemove(Remove object)
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:
doSwitch(EObject)
-
caseInsert
public org.objectweb.asm.MethodVisitor caseInsert(Insert object)
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:
doSwitch(EObject)
-
caseGetSuper
public org.objectweb.asm.MethodVisitor caseGetSuper(GetSuper object)
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:
doSwitch(EObject)
-
caseGetenv
public org.objectweb.asm.MethodVisitor caseGetenv(Getenv object)
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:
doSwitch(EObject)
-
caseReturn
public org.objectweb.asm.MethodVisitor caseReturn(Return object)
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:
doSwitch(EObject)
-
caseGetcb
public org.objectweb.asm.MethodVisitor caseGetcb(Getcb object)
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:
doSwitch(EObject)
-
caseInvokeAllCbs
public org.objectweb.asm.MethodVisitor caseInvokeAllCbs(InvokeAllCbs object)
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:
doSwitch(EObject)
-
caseInvokeCb
public org.objectweb.asm.MethodVisitor caseInvokeCb(InvokeCb object)
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:
doSwitch(EObject)
-
caseInvokeCbS
public org.objectweb.asm.MethodVisitor caseInvokeCbS(InvokeCbS object)
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:
doSwitch(EObject)
-
caseNot
public org.objectweb.asm.MethodVisitor caseNot(Not object)
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:
doSwitch(EObject)
-
caseAnd
public org.objectweb.asm.MethodVisitor caseAnd(And object)
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:
doSwitch(EObject)
-
caseOr
public org.objectweb.asm.MethodVisitor caseOr(Or object)
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:
doSwitch(EObject)
-
caseXor
public org.objectweb.asm.MethodVisitor caseXor(Xor object)
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:
doSwitch(EObject)
-
caseImplies
public org.objectweb.asm.MethodVisitor caseImplies(Implies object)
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:
doSwitch(EObject)
-
caseIfte
public org.objectweb.asm.MethodVisitor caseIfte(Ifte object)
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:
doSwitch(EObject)
-
caseIsnull
public org.objectweb.asm.MethodVisitor caseIsnull(Isnull object)
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:
doSwitch(EObject)
-
caseGetenvtype
public org.objectweb.asm.MethodVisitor caseGetenvtype(Getenvtype object)
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:
doSwitch(EObject)
-
generateSetPc
protected void generateSetPc(Instruction object)
Generates frame.setPc(pc) forobject, iffhasMonitorisfalse.- Parameters:
object- the next instruction
-
generateSubFrame
protected void generateSubFrame(java.lang.String opname)
Generates bytecode that creates a new sub-StackFrame.- Parameters:
opname- the operation name (for debugger)
-
generateBoxing
protected void generateBoxing(java.lang.Class<?> cls, java.lang.Class<?> selfCls)Generates boxing code for a value of typecls, if necessary.- Parameters:
cls- the value classselfCls- the class of self
-
generateUnboxing
protected void generateUnboxing(java.lang.Class<?> cls)
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_
protected void new_(java.lang.Class<?> cls)
-
checkcast
protected void checkcast(java.lang.Class<?> cls)
-
instanceof_
protected void instanceof_(java.lang.Class<?> cls)
-
anewarray
protected void anewarray(java.lang.Class<?> cls)
-
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
protected void ldc(java.lang.Object object)
-
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
protected void invoke(int opcode, java.lang.Class<?> owner, java.lang.String name, java.lang.Object retType, java.lang.Object... argTypes)Generates a method invocation instruction.- Parameters:
opcode- the method invocation instruction opcode (e.g. INVOKEVIRTUAL)owner- the method owner classname- the method nameretType- the method return typeClassorTypeargTypes- the method argument typeClasses orTypes
-
invokeIface
protected void invokeIface(java.lang.Class<?> owner, java.lang.String name, java.lang.Object retType, java.lang.Object... argTypes)
-
invokeVirt
protected void invokeVirt(java.lang.Class<?> owner, java.lang.String name, java.lang.Object retType, java.lang.Object... argTypes)
-
invokeStat
protected void invokeStat(java.lang.Class<?> owner, java.lang.String name, java.lang.Object retType, java.lang.Object... argTypes)
-
invokeSpec
protected void invokeSpec(java.lang.Class<?> owner, java.lang.String name, java.lang.Object retClass, java.lang.Object... argClasses)
-
invokeCons
protected void invokeCons(java.lang.Class<?> owner, java.lang.Object... argTypes)
-
field
protected void field(int opcode, java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)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
protected void getField(java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)
-
putField
protected void putField(java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)
-
getStatic
protected void getStatic(java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)
-
putStatic
protected void putStatic(java.lang.Class<?> owner, java.lang.String name, java.lang.Object type)
-
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(java.lang.String name, java.lang.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:
java.lang.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, java.lang.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:
java.lang.IllegalArgumentException- if one of the labels has already been visited by this visitor (by theMethodVisitor.visitLabel(org.objectweb.asm.Label)method).
-
nextInstruction
protected Instruction nextInstruction(Instruction instruction)
Returns the next instruction for the given instruction, ornull.- Parameters:
instruction- the instruction- Returns:
- the next instruction for the given instruction, or
null
-
-