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

    Fields
    Modifier and Type
    Field
    Description
    static final Map<Class<?>,Class<?>>
    The 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
    The LabelSwitch to look up generated labels.
    protected final org.objectweb.asm.MethodVisitor
    The MethodVisitor 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

    Constructors
    Constructor
    Description
    ByteCodeSwitch(CodeBlockJIT jit, org.objectweb.asm.MethodVisitor mv, LabelSwitch ls)
    Creates a new ByteCodeSwitch.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
     
    protected void
    aload(int var)
    Generates an ALOAD instruction.
    protected void
    anewarray(Class<?> cls)
     
    protected void
     
    protected void
    astore(int var)
    Generates an ASTORE instruction.
    protected void
     
    static Class<?>
    boxed(Class<?> type)
    Returns the boxed version of type, or type if no boxing required.
    org.objectweb.asm.MethodVisitor
    caseAdd(Add object)
    Returns the result of interpreting the object as an instance of 'Add'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Allinst'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Allinst In'.
    org.objectweb.asm.MethodVisitor
    caseAnd(And object)
    Returns the result of interpreting the object as an instance of 'And'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Delete'.
    org.objectweb.asm.MethodVisitor
    caseDup(Dup object)
    Returns the result of interpreting the object as an instance of 'Dup'.
    org.objectweb.asm.MethodVisitor
    caseDupX1(DupX1 object)
    Returns the result of interpreting the object as an instance of 'Dup X1'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Enditerate'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Findtype'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Findtype S'.
    org.objectweb.asm.MethodVisitor
    caseGet(Get object)
    Returns the result of interpreting the object as an instance of 'Get'.
    org.objectweb.asm.MethodVisitor
    caseGetcb(Getcb object)
    Returns the result of interpreting the object as an instance of 'Getcb'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Getenv'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Getenvtype'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Get Static'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Get Super'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Get Trans'.
    org.objectweb.asm.MethodVisitor
    caseGoto(Goto object)
    Returns the result of interpreting the object as an instance of 'Goto'.
    org.objectweb.asm.MethodVisitor
    caseIf(If object)
    Returns the result of interpreting the object as an instance of 'If'.
    org.objectweb.asm.MethodVisitor
    caseIfn(Ifn object)
    Returns the result of interpreting the object as an instance of 'Ifn'.
    org.objectweb.asm.MethodVisitor
    caseIfte(Ifte object)
    Returns the result of interpreting the object as an instance of 'Ifte'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Implies'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Insert'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Instruction'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Invoke'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Invoke All Cbs'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Invoke Cb'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Invoke Cb S'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Invoke Static'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Invoke Super'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Isnull'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Iterate'.
    org.objectweb.asm.MethodVisitor
    caseLoad(Load object)
    Returns the result of interpreting the object as an instance of 'Load'.
    org.objectweb.asm.MethodVisitor
    caseMatch(Match object)
    Returns the result of interpreting the object as an instance of 'Match'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Match S'.
    org.objectweb.asm.MethodVisitor
    caseNew(New object)
    Returns the result of interpreting the object as an instance of 'New'.
    org.objectweb.asm.MethodVisitor
    caseNewS(NewS object)
    Returns the result of interpreting the object as an instance of 'New S'.
    org.objectweb.asm.MethodVisitor
    caseNot(Not object)
    Returns the result of interpreting the object as an instance of 'Not'.
    org.objectweb.asm.MethodVisitor
    caseOr(Or object)
    Returns the result of interpreting the object as an instance of 'Or'.
    org.objectweb.asm.MethodVisitor
    casePop(Pop object)
    Returns the result of interpreting the object as an instance of 'Pop'.
    org.objectweb.asm.MethodVisitor
    casePush(Push object)
    Returns the result of interpreting the object as an instance of 'Push'.
    org.objectweb.asm.MethodVisitor
    casePushf(Pushf object)
    Returns the result of interpreting the object as an instance of 'Pushf'.
    org.objectweb.asm.MethodVisitor
    casePusht(Pusht object)
    Returns the result of interpreting the object as an instance of 'Pusht'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Remove'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Return'.
    org.objectweb.asm.MethodVisitor
    caseSet(Set object)
    Returns the result of interpreting the object as an instance of 'Set'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Set Static'.
    org.objectweb.asm.MethodVisitor
    caseStore(Store object)
    Returns the result of interpreting the object as an instance of 'Store'.
    org.objectweb.asm.MethodVisitor
    caseSwap(Swap object)
    Returns the result of interpreting the object as an instance of 'Swap'.
    org.objectweb.asm.MethodVisitor
    Returns the result of interpreting the object as an instance of 'Swap X1'.
    org.objectweb.asm.MethodVisitor
    caseXor(Xor object)
    Returns the result of interpreting the object as an instance of 'Xor'.
    protected void
    checkcast(Class<?> cls)
     
    protected void
    dup()
     
    protected void
     
    protected void
     
    protected void
    field(int opcode, Class<?> owner, String name, Object type)
    Generates a field access instruction.
    protected void
    generateBoxing(Class<?> cls, Class<?> selfCls)
    Generates boxing code for a value of type cls, if necessary.
    protected void
    generatePushInt(int value)
    Generates an optimised instruction for pushing a constant integer value onto the stack.
    protected void
    Generates frame.setPc(pc) for object, iff hasMonitor is false.
    protected void
    Generates bytecode that creates a new sub-StackFrame.
    protected void
    Generates unboxing code for a value of type cls, if necessary.
    protected void
    getField(Class<?> owner, String name, Object type)
     
    protected void
    getStatic(Class<?> owner, String name, Object type)
     
    protected void
    goto_(org.objectweb.asm.Label label)
     
    protected void
     
    protected void
     
    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
     
    protected void
    invoke(int opcode, Class<?> owner, String name, Object retType, Object... argTypes)
    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
    ldc(Object object)
     
    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
    new_(Class<?> cls)
     
    protected Instruction
    Returns the next instruction for the given instruction, or null.
    protected void
    pop()
     
    protected void
    putField(Class<?> owner, String name, Object type)
     
    protected void
    putStatic(Class<?> owner, String name, Object type)
     
    protected void
     
    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 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BOXED_CLASSES

      public static final Map<Class<?>,Class<?>> BOXED_CLASSES
      The map of primitive types to their boxed class counterpart type.
    • mv

      protected final org.objectweb.asm.MethodVisitor mv
      The MethodVisitor to add code to.
    • ls

      protected final LabelSwitch ls
      The LabelSwitch to 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 Set<Instruction> skipInstructions
      Set of instructions to skip while generating bytecode.
  • Constructor Details

    • ByteCodeSwitch

      public ByteCodeSwitch(CodeBlockJIT jit, org.objectweb.asm.MethodVisitor mv, LabelSwitch ls)
      Creates a new ByteCodeSwitch.
      Parameters:
      jit - the JIT compiler to generate instructions for
      mv - the MethodVisitor to add code to
      ls - the LabelSwitch to look up generated labels
  • Method Details

    • boxed

      public static Class<?> boxed(Class<?> type)
      Returns the boxed version of type, or type if no boxing required.
      Parameters:
      type - the type to box
      Returns:
      the boxed version of type, or type if no boxing required
    • caseInstruction

      public org.objectweb.asm.MethodVisitor caseInstruction(Instruction object)
      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 class EmftvmSwitch<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

      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:
      casePush in class EmftvmSwitch<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

      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:
      casePusht in class EmftvmSwitch<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

      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:
      casePushf in class EmftvmSwitch<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

      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:
      casePop in class EmftvmSwitch<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

      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:
      caseLoad in class EmftvmSwitch<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

      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:
      caseStore in class EmftvmSwitch<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

      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:
      caseSet in class EmftvmSwitch<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

      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:
      caseGet in class EmftvmSwitch<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

      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:
      caseGetTrans in class EmftvmSwitch<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

      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:
      caseSetStatic in class EmftvmSwitch<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

      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:
      caseGetStatic in class EmftvmSwitch<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

      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:
      caseFindtype in class EmftvmSwitch<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

      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:
      caseFindtypeS in class EmftvmSwitch<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

      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:
      caseNew in class EmftvmSwitch<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

      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:
      caseNewS in class EmftvmSwitch<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

      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:
      caseDelete in class EmftvmSwitch<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

      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:
      caseDup in class EmftvmSwitch<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

      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:
      caseDupX1 in class EmftvmSwitch<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

      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:
      caseSwap in class EmftvmSwitch<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

      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:
      caseSwapX1 in class EmftvmSwitch<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

      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:
      caseIf in class EmftvmSwitch<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

      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:
      caseIfn in class EmftvmSwitch<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

      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:
      caseGoto in class EmftvmSwitch<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

      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:
      caseIterate in class EmftvmSwitch<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

      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:
      caseEnditerate in class EmftvmSwitch<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

      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:
      caseInvoke in class EmftvmSwitch<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

      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:
      caseInvokeSuper in class EmftvmSwitch<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

      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:
      caseInvokeStatic in class EmftvmSwitch<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

      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:
      caseAllinst in class EmftvmSwitch<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

      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:
      caseAllinstIn in class EmftvmSwitch<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

      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:
      caseMatch in class EmftvmSwitch<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

      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:
      caseMatchS in class EmftvmSwitch<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

      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:
      caseAdd in class EmftvmSwitch<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

      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:
      caseRemove in class EmftvmSwitch<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

      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:
      caseInsert in class EmftvmSwitch<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

      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:
      caseGetSuper in class EmftvmSwitch<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

      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:
      caseGetenv in class EmftvmSwitch<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

      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:
      caseReturn in class EmftvmSwitch<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

      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:
      caseGetcb in class EmftvmSwitch<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

      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:
      caseInvokeAllCbs in class EmftvmSwitch<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

      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:
      caseInvokeCb in class EmftvmSwitch<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

      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:
      caseInvokeCbS in class EmftvmSwitch<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

      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:
      caseNot in class EmftvmSwitch<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

      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:
      caseAnd in class EmftvmSwitch<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

      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:
      caseOr in class EmftvmSwitch<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

      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:
      caseXor in class EmftvmSwitch<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

      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:
      caseImplies in class EmftvmSwitch<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

      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:
      caseIfte in class EmftvmSwitch<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

      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:
      caseIsnull in class EmftvmSwitch<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

      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:
      caseGetenvtype in class EmftvmSwitch<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

      protected void generateSetPc(Instruction object)
      Generates frame.setPc(pc) for object, iff hasMonitor is false.
      Parameters:
      object - the next instruction
    • generateSubFrame

      protected void generateSubFrame(String opname)
      Generates bytecode that creates a new sub-StackFrame.
      Parameters:
      opname - the operation name (for debugger)
    • generateBoxing

      protected void generateBoxing(Class<?> cls, Class<?> selfCls)
      Generates boxing code for a value of type cls, if necessary.
      Parameters:
      cls - the value class
      selfCls - the class of self
    • generateUnboxing

      protected void generateUnboxing(Class<?> cls)
      Generates unboxing code for a value of type cls, if necessary.
      Parameters:
      cls - the value class
    • generatePushInt

      protected void generatePushInt(int value)
      Generates an optimised instruction for pushing a constant integer value 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_

      protected void new_(Class<?> cls)
    • checkcast

      protected void checkcast(Class<?> cls)
    • instanceof_

      protected void instanceof_(Class<?> cls)
    • anewarray

      protected void anewarray(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(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, Class<?> owner, String name, Object retType, Object... argTypes)
      Generates a method invocation instruction.
      Parameters:
      opcode - the method invocation instruction opcode (e.g. INVOKEVIRTUAL)
      owner - the method owner class
      name - the method name
      retType - the method return type Class or Type
      argTypes - the method argument type Classes or Types
    • invokeIface

      protected void invokeIface(Class<?> owner, String name, Object retType, Object... argTypes)
    • invokeVirt

      protected void invokeVirt(Class<?> owner, String name, Object retType, Object... argTypes)
    • invokeStat

      protected void invokeStat(Class<?> owner, String name, Object retType, Object... argTypes)
    • invokeSpec

      protected void invokeSpec(Class<?> owner, String name, Object retClass, Object... argClasses)
    • invokeCons

      protected void invokeCons(Class<?> owner, Object... argTypes)
    • field

      protected void field(int opcode, Class<?> owner, String name, Object type)
      Generates a field access instruction.
      Parameters:
      opcode - the field access opcode (e.g. GETFIELD)
      owner - the field owner class
      name - the field name
      type - the field Class or Type
    • getField

      protected void getField(Class<?> owner, String name, Object type)
    • putField

      protected void putField(Class<?> owner, String name, Object type)
    • getStatic

      protected void getStatic(Class<?> owner, String name, Object type)
    • putStatic

      protected void putStatic(Class<?> owner, String name, 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(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 the MethodVisitor.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 the MethodVisitor.visitLabel(org.objectweb.asm.Label) method).
    • nextInstruction

      protected Instruction nextInstruction(Instruction instruction)
      Returns the next instruction for the given instruction, or null.
      Parameters:
      instruction - the instruction
      Returns:
      the next instruction for the given instruction, or null