зеркало из https://github.com/mozilla/pluotsorbet.git
Define byte codes only when the compiler needs them.
This commit is contained in:
Родитель
b54cf86587
Коммит
92bec6a73e
413
bytecodes.ts
413
bytecodes.ts
|
@ -426,209 +426,214 @@ module J2ME.Bytecode {
|
|||
release || assert (!isConditionalBranch(opcode) || isBranch(opcode), "a conditional branch must also be a branch");
|
||||
}
|
||||
|
||||
define(Bytecodes.NOP , "nop" , "b" );
|
||||
define(Bytecodes.ACONST_NULL , "aconst_null" , "b" );
|
||||
define(Bytecodes.ICONST_M1 , "iconst_m1" , "b" );
|
||||
define(Bytecodes.ICONST_0 , "iconst_0" , "b" );
|
||||
define(Bytecodes.ICONST_1 , "iconst_1" , "b" );
|
||||
define(Bytecodes.ICONST_2 , "iconst_2" , "b" );
|
||||
define(Bytecodes.ICONST_3 , "iconst_3" , "b" );
|
||||
define(Bytecodes.ICONST_4 , "iconst_4" , "b" );
|
||||
define(Bytecodes.ICONST_5 , "iconst_5" , "b" );
|
||||
define(Bytecodes.LCONST_0 , "lconst_0" , "b" );
|
||||
define(Bytecodes.LCONST_1 , "lconst_1" , "b" );
|
||||
define(Bytecodes.FCONST_0 , "fconst_0" , "b" );
|
||||
define(Bytecodes.FCONST_1 , "fconst_1" , "b" );
|
||||
define(Bytecodes.FCONST_2 , "fconst_2" , "b" );
|
||||
define(Bytecodes.DCONST_0 , "dconst_0" , "b" );
|
||||
define(Bytecodes.DCONST_1 , "dconst_1" , "b" );
|
||||
define(Bytecodes.BIPUSH , "bipush" , "bc" );
|
||||
define(Bytecodes.SIPUSH , "sipush" , "bcc" );
|
||||
define(Bytecodes.LDC , "ldc" , "bi" , Flags.TRAP);
|
||||
define(Bytecodes.LDC_W , "ldc_w" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.LDC2_W , "ldc2_w" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.ILOAD , "iload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD , "lload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD , "fload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD , "dload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD , "aload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.ILOAD_0 , "iload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ILOAD_1 , "iload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ILOAD_2 , "iload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ILOAD_3 , "iload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD_0 , "lload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD_1 , "lload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD_2 , "lload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD_3 , "lload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD_0 , "fload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD_1 , "fload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD_2 , "fload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD_3 , "fload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD_0 , "dload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD_1 , "dload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD_2 , "dload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD_3 , "dload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD_0 , "aload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD_1 , "aload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD_2 , "aload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD_3 , "aload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.IALOAD , "iaload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.LALOAD , "laload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.FALOAD , "faload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.DALOAD , "daload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.AALOAD , "aaload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.BALOAD , "baload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.CALOAD , "caload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.SALOAD , "saload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.ISTORE , "istore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE , "lstore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE , "fstore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE , "dstore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE , "astore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.ISTORE_0 , "istore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ISTORE_1 , "istore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ISTORE_2 , "istore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ISTORE_3 , "istore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE_0 , "lstore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE_1 , "lstore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE_2 , "lstore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE_3 , "lstore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE_0 , "fstore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE_1 , "fstore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE_2 , "fstore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE_3 , "fstore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE_0 , "dstore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE_1 , "dstore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE_2 , "dstore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE_3 , "dstore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE_0 , "astore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE_1 , "astore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE_2 , "astore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE_3 , "astore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.IASTORE , "iastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.LASTORE , "lastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.FASTORE , "fastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.DASTORE , "dastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.AASTORE , "aastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.BASTORE , "bastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.CASTORE , "castore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.SASTORE , "sastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.POP , "pop" , "b" );
|
||||
define(Bytecodes.POP2 , "pop2" , "b" );
|
||||
define(Bytecodes.DUP , "dup" , "b" );
|
||||
define(Bytecodes.DUP_X1 , "dup_x1" , "b" );
|
||||
define(Bytecodes.DUP_X2 , "dup_x2" , "b" );
|
||||
define(Bytecodes.DUP2 , "dup2" , "b" );
|
||||
define(Bytecodes.DUP2_X1 , "dup2_x1" , "b" );
|
||||
define(Bytecodes.DUP2_X2 , "dup2_x2" , "b" );
|
||||
define(Bytecodes.SWAP , "swap" , "b" );
|
||||
define(Bytecodes.IADD , "iadd" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LADD , "ladd" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.FADD , "fadd" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.DADD , "dadd" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.ISUB , "isub" , "b" );
|
||||
define(Bytecodes.LSUB , "lsub" , "b" );
|
||||
define(Bytecodes.FSUB , "fsub" , "b" );
|
||||
define(Bytecodes.DSUB , "dsub" , "b" );
|
||||
define(Bytecodes.IMUL , "imul" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LMUL , "lmul" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.FMUL , "fmul" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.DMUL , "dmul" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.IDIV , "idiv" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.LDIV , "ldiv" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.FDIV , "fdiv" , "b" );
|
||||
define(Bytecodes.DDIV , "ddiv" , "b" );
|
||||
define(Bytecodes.IREM , "irem" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.LREM , "lrem" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.FREM , "frem" , "b" );
|
||||
define(Bytecodes.DREM , "drem" , "b" );
|
||||
define(Bytecodes.INEG , "ineg" , "b" );
|
||||
define(Bytecodes.LNEG , "lneg" , "b" );
|
||||
define(Bytecodes.FNEG , "fneg" , "b" );
|
||||
define(Bytecodes.DNEG , "dneg" , "b" );
|
||||
define(Bytecodes.ISHL , "ishl" , "b" );
|
||||
define(Bytecodes.LSHL , "lshl" , "b" );
|
||||
define(Bytecodes.ISHR , "ishr" , "b" );
|
||||
define(Bytecodes.LSHR , "lshr" , "b" );
|
||||
define(Bytecodes.IUSHR , "iushr" , "b" );
|
||||
define(Bytecodes.LUSHR , "lushr" , "b" );
|
||||
define(Bytecodes.IAND , "iand" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LAND , "land" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.IOR , "ior" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LOR , "lor" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.IXOR , "ixor" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LXOR , "lxor" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.IINC , "iinc" , "bic" , Flags.LOAD | Flags.STORE);
|
||||
define(Bytecodes.I2L , "i2l" , "b" );
|
||||
define(Bytecodes.I2F , "i2f" , "b" );
|
||||
define(Bytecodes.I2D , "i2d" , "b" );
|
||||
define(Bytecodes.L2I , "l2i" , "b" );
|
||||
define(Bytecodes.L2F , "l2f" , "b" );
|
||||
define(Bytecodes.L2D , "l2d" , "b" );
|
||||
define(Bytecodes.F2I , "f2i" , "b" );
|
||||
define(Bytecodes.F2L , "f2l" , "b" );
|
||||
define(Bytecodes.F2D , "f2d" , "b" );
|
||||
define(Bytecodes.D2I , "d2i" , "b" );
|
||||
define(Bytecodes.D2L , "d2l" , "b" );
|
||||
define(Bytecodes.D2F , "d2f" , "b" );
|
||||
define(Bytecodes.I2B , "i2b" , "b" );
|
||||
define(Bytecodes.I2C , "i2c" , "b" );
|
||||
define(Bytecodes.I2S , "i2s" , "b" );
|
||||
define(Bytecodes.LCMP , "lcmp" , "b" );
|
||||
define(Bytecodes.FCMPL , "fcmpl" , "b" );
|
||||
define(Bytecodes.FCMPG , "fcmpg" , "b" );
|
||||
define(Bytecodes.DCMPL , "dcmpl" , "b" );
|
||||
define(Bytecodes.DCMPG , "dcmpg" , "b" );
|
||||
define(Bytecodes.IFEQ , "ifeq" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFNE , "ifne" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFLT , "iflt" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFGE , "ifge" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFGT , "ifgt" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFLE , "ifle" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPEQ , "if_icmpeq" , "boo" , Flags.COMMUTATIVE | Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPNE , "if_icmpne" , "boo" , Flags.COMMUTATIVE | Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPLT , "if_icmplt" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPGE , "if_icmpge" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPGT , "if_icmpgt" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPLE , "if_icmple" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ACMPEQ , "if_acmpeq" , "boo" , Flags.COMMUTATIVE | Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ACMPNE , "if_acmpne" , "boo" , Flags.COMMUTATIVE | Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.GOTO , "goto" , "boo" , Flags.STOP | Flags.BRANCH);
|
||||
define(Bytecodes.JSR , "jsr" , "boo" , Flags.STOP | Flags.BRANCH);
|
||||
define(Bytecodes.RET , "ret" , "bi" , Flags.STOP);
|
||||
define(Bytecodes.TABLESWITCH , "tableswitch" , "" , Flags.STOP);
|
||||
define(Bytecodes.LOOKUPSWITCH , "lookupswitch" , "" , Flags.STOP);
|
||||
define(Bytecodes.IRETURN , "ireturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.LRETURN , "lreturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.FRETURN , "freturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.DRETURN , "dreturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.ARETURN , "areturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.RETURN , "return" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.GETSTATIC , "getstatic" , "bjj" , Flags.TRAP | Flags.FIELD_READ);
|
||||
define(Bytecodes.PUTSTATIC , "putstatic" , "bjj" , Flags.TRAP | Flags.FIELD_WRITE);
|
||||
define(Bytecodes.GETFIELD , "getfield" , "bjj" , Flags.TRAP | Flags.FIELD_READ);
|
||||
define(Bytecodes.PUTFIELD , "putfield" , "bjj" , Flags.TRAP | Flags.FIELD_WRITE);
|
||||
define(Bytecodes.INVOKEVIRTUAL , "invokevirtual" , "bjj" , Flags.TRAP | Flags.INVOKE);
|
||||
define(Bytecodes.INVOKESPECIAL , "invokespecial" , "bjj" , Flags.TRAP | Flags.INVOKE);
|
||||
define(Bytecodes.INVOKESTATIC , "invokestatic" , "bjj" , Flags.TRAP | Flags.INVOKE);
|
||||
define(Bytecodes.INVOKEINTERFACE , "invokeinterface" , "bjja_", Flags.TRAP | Flags.INVOKE);
|
||||
define(Bytecodes.XXXUNUSEDXXX , "xxxunusedxxx" , "" );
|
||||
define(Bytecodes.NEW , "new" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.NEWARRAY , "newarray" , "bc" , Flags.TRAP);
|
||||
define(Bytecodes.ANEWARRAY , "anewarray" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.ARRAYLENGTH , "arraylength" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.ATHROW , "athrow" , "b" , Flags.TRAP | Flags.STOP);
|
||||
define(Bytecodes.CHECKCAST , "checkcast" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.INSTANCEOF , "instanceof" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.MONITORENTER , "monitorenter" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.MONITOREXIT , "monitorexit" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.WIDE , "wide" , "" );
|
||||
define(Bytecodes.MULTIANEWARRAY , "multianewarray" , "biic" , Flags.TRAP);
|
||||
define(Bytecodes.IFNULL , "ifnull" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFNONNULL , "ifnonnull" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.GOTO_W , "goto_w" , "boooo", Flags.STOP | Flags.BRANCH);
|
||||
define(Bytecodes.JSR_W , "jsr_w" , "boooo", Flags.STOP | Flags.BRANCH);
|
||||
define(Bytecodes.BREAKPOINT , "breakpoint" , "b" , Flags.TRAP);
|
||||
/**
|
||||
* Only call this before the compiler is used.
|
||||
*/
|
||||
export function defineBytecodes() {
|
||||
define(Bytecodes.NOP , "nop" , "b" );
|
||||
define(Bytecodes.ACONST_NULL , "aconst_null" , "b" );
|
||||
define(Bytecodes.ICONST_M1 , "iconst_m1" , "b" );
|
||||
define(Bytecodes.ICONST_0 , "iconst_0" , "b" );
|
||||
define(Bytecodes.ICONST_1 , "iconst_1" , "b" );
|
||||
define(Bytecodes.ICONST_2 , "iconst_2" , "b" );
|
||||
define(Bytecodes.ICONST_3 , "iconst_3" , "b" );
|
||||
define(Bytecodes.ICONST_4 , "iconst_4" , "b" );
|
||||
define(Bytecodes.ICONST_5 , "iconst_5" , "b" );
|
||||
define(Bytecodes.LCONST_0 , "lconst_0" , "b" );
|
||||
define(Bytecodes.LCONST_1 , "lconst_1" , "b" );
|
||||
define(Bytecodes.FCONST_0 , "fconst_0" , "b" );
|
||||
define(Bytecodes.FCONST_1 , "fconst_1" , "b" );
|
||||
define(Bytecodes.FCONST_2 , "fconst_2" , "b" );
|
||||
define(Bytecodes.DCONST_0 , "dconst_0" , "b" );
|
||||
define(Bytecodes.DCONST_1 , "dconst_1" , "b" );
|
||||
define(Bytecodes.BIPUSH , "bipush" , "bc" );
|
||||
define(Bytecodes.SIPUSH , "sipush" , "bcc" );
|
||||
define(Bytecodes.LDC , "ldc" , "bi" , Flags.TRAP);
|
||||
define(Bytecodes.LDC_W , "ldc_w" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.LDC2_W , "ldc2_w" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.ILOAD , "iload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD , "lload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD , "fload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD , "dload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD , "aload" , "bi" , Flags.LOAD);
|
||||
define(Bytecodes.ILOAD_0 , "iload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ILOAD_1 , "iload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ILOAD_2 , "iload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ILOAD_3 , "iload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD_0 , "lload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD_1 , "lload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD_2 , "lload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.LLOAD_3 , "lload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD_0 , "fload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD_1 , "fload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD_2 , "fload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.FLOAD_3 , "fload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD_0 , "dload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD_1 , "dload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD_2 , "dload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.DLOAD_3 , "dload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD_0 , "aload_0" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD_1 , "aload_1" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD_2 , "aload_2" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.ALOAD_3 , "aload_3" , "b" , Flags.LOAD);
|
||||
define(Bytecodes.IALOAD , "iaload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.LALOAD , "laload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.FALOAD , "faload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.DALOAD , "daload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.AALOAD , "aaload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.BALOAD , "baload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.CALOAD , "caload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.SALOAD , "saload" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.ISTORE , "istore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE , "lstore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE , "fstore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE , "dstore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE , "astore" , "bi" , Flags.STORE);
|
||||
define(Bytecodes.ISTORE_0 , "istore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ISTORE_1 , "istore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ISTORE_2 , "istore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ISTORE_3 , "istore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE_0 , "lstore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE_1 , "lstore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE_2 , "lstore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.LSTORE_3 , "lstore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE_0 , "fstore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE_1 , "fstore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE_2 , "fstore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.FSTORE_3 , "fstore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE_0 , "dstore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE_1 , "dstore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE_2 , "dstore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.DSTORE_3 , "dstore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE_0 , "astore_0" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE_1 , "astore_1" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE_2 , "astore_2" , "b" , Flags.STORE);
|
||||
define(Bytecodes.ASTORE_3 , "astore_3" , "b" , Flags.STORE);
|
||||
define(Bytecodes.IASTORE , "iastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.LASTORE , "lastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.FASTORE , "fastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.DASTORE , "dastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.AASTORE , "aastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.BASTORE , "bastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.CASTORE , "castore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.SASTORE , "sastore" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.POP , "pop" , "b" );
|
||||
define(Bytecodes.POP2 , "pop2" , "b" );
|
||||
define(Bytecodes.DUP , "dup" , "b" );
|
||||
define(Bytecodes.DUP_X1 , "dup_x1" , "b" );
|
||||
define(Bytecodes.DUP_X2 , "dup_x2" , "b" );
|
||||
define(Bytecodes.DUP2 , "dup2" , "b" );
|
||||
define(Bytecodes.DUP2_X1 , "dup2_x1" , "b" );
|
||||
define(Bytecodes.DUP2_X2 , "dup2_x2" , "b" );
|
||||
define(Bytecodes.SWAP , "swap" , "b" );
|
||||
define(Bytecodes.IADD , "iadd" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LADD , "ladd" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.FADD , "fadd" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.DADD , "dadd" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.ISUB , "isub" , "b" );
|
||||
define(Bytecodes.LSUB , "lsub" , "b" );
|
||||
define(Bytecodes.FSUB , "fsub" , "b" );
|
||||
define(Bytecodes.DSUB , "dsub" , "b" );
|
||||
define(Bytecodes.IMUL , "imul" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LMUL , "lmul" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.FMUL , "fmul" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.DMUL , "dmul" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.IDIV , "idiv" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.LDIV , "ldiv" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.FDIV , "fdiv" , "b" );
|
||||
define(Bytecodes.DDIV , "ddiv" , "b" );
|
||||
define(Bytecodes.IREM , "irem" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.LREM , "lrem" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.FREM , "frem" , "b" );
|
||||
define(Bytecodes.DREM , "drem" , "b" );
|
||||
define(Bytecodes.INEG , "ineg" , "b" );
|
||||
define(Bytecodes.LNEG , "lneg" , "b" );
|
||||
define(Bytecodes.FNEG , "fneg" , "b" );
|
||||
define(Bytecodes.DNEG , "dneg" , "b" );
|
||||
define(Bytecodes.ISHL , "ishl" , "b" );
|
||||
define(Bytecodes.LSHL , "lshl" , "b" );
|
||||
define(Bytecodes.ISHR , "ishr" , "b" );
|
||||
define(Bytecodes.LSHR , "lshr" , "b" );
|
||||
define(Bytecodes.IUSHR , "iushr" , "b" );
|
||||
define(Bytecodes.LUSHR , "lushr" , "b" );
|
||||
define(Bytecodes.IAND , "iand" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LAND , "land" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.IOR , "ior" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LOR , "lor" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.IXOR , "ixor" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.LXOR , "lxor" , "b" , Flags.COMMUTATIVE | Flags.ASSOCIATIVE);
|
||||
define(Bytecodes.IINC , "iinc" , "bic" , Flags.LOAD | Flags.STORE);
|
||||
define(Bytecodes.I2L , "i2l" , "b" );
|
||||
define(Bytecodes.I2F , "i2f" , "b" );
|
||||
define(Bytecodes.I2D , "i2d" , "b" );
|
||||
define(Bytecodes.L2I , "l2i" , "b" );
|
||||
define(Bytecodes.L2F , "l2f" , "b" );
|
||||
define(Bytecodes.L2D , "l2d" , "b" );
|
||||
define(Bytecodes.F2I , "f2i" , "b" );
|
||||
define(Bytecodes.F2L , "f2l" , "b" );
|
||||
define(Bytecodes.F2D , "f2d" , "b" );
|
||||
define(Bytecodes.D2I , "d2i" , "b" );
|
||||
define(Bytecodes.D2L , "d2l" , "b" );
|
||||
define(Bytecodes.D2F , "d2f" , "b" );
|
||||
define(Bytecodes.I2B , "i2b" , "b" );
|
||||
define(Bytecodes.I2C , "i2c" , "b" );
|
||||
define(Bytecodes.I2S , "i2s" , "b" );
|
||||
define(Bytecodes.LCMP , "lcmp" , "b" );
|
||||
define(Bytecodes.FCMPL , "fcmpl" , "b" );
|
||||
define(Bytecodes.FCMPG , "fcmpg" , "b" );
|
||||
define(Bytecodes.DCMPL , "dcmpl" , "b" );
|
||||
define(Bytecodes.DCMPG , "dcmpg" , "b" );
|
||||
define(Bytecodes.IFEQ , "ifeq" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFNE , "ifne" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFLT , "iflt" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFGE , "ifge" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFGT , "ifgt" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFLE , "ifle" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPEQ , "if_icmpeq" , "boo" , Flags.COMMUTATIVE | Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPNE , "if_icmpne" , "boo" , Flags.COMMUTATIVE | Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPLT , "if_icmplt" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPGE , "if_icmpge" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPGT , "if_icmpgt" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ICMPLE , "if_icmple" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ACMPEQ , "if_acmpeq" , "boo" , Flags.COMMUTATIVE | Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IF_ACMPNE , "if_acmpne" , "boo" , Flags.COMMUTATIVE | Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.GOTO , "goto" , "boo" , Flags.STOP | Flags.BRANCH);
|
||||
define(Bytecodes.JSR , "jsr" , "boo" , Flags.STOP | Flags.BRANCH);
|
||||
define(Bytecodes.RET , "ret" , "bi" , Flags.STOP);
|
||||
define(Bytecodes.TABLESWITCH , "tableswitch" , "" , Flags.STOP);
|
||||
define(Bytecodes.LOOKUPSWITCH , "lookupswitch" , "" , Flags.STOP);
|
||||
define(Bytecodes.IRETURN , "ireturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.LRETURN , "lreturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.FRETURN , "freturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.DRETURN , "dreturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.ARETURN , "areturn" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.RETURN , "return" , "b" , Flags.TRAP | Flags.STOP | Flags.RETURN);
|
||||
define(Bytecodes.GETSTATIC , "getstatic" , "bjj" , Flags.TRAP | Flags.FIELD_READ);
|
||||
define(Bytecodes.PUTSTATIC , "putstatic" , "bjj" , Flags.TRAP | Flags.FIELD_WRITE);
|
||||
define(Bytecodes.GETFIELD , "getfield" , "bjj" , Flags.TRAP | Flags.FIELD_READ);
|
||||
define(Bytecodes.PUTFIELD , "putfield" , "bjj" , Flags.TRAP | Flags.FIELD_WRITE);
|
||||
define(Bytecodes.INVOKEVIRTUAL , "invokevirtual" , "bjj" , Flags.TRAP | Flags.INVOKE);
|
||||
define(Bytecodes.INVOKESPECIAL , "invokespecial" , "bjj" , Flags.TRAP | Flags.INVOKE);
|
||||
define(Bytecodes.INVOKESTATIC , "invokestatic" , "bjj" , Flags.TRAP | Flags.INVOKE);
|
||||
define(Bytecodes.INVOKEINTERFACE , "invokeinterface" , "bjja_", Flags.TRAP | Flags.INVOKE);
|
||||
define(Bytecodes.XXXUNUSEDXXX , "xxxunusedxxx" , "" );
|
||||
define(Bytecodes.NEW , "new" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.NEWARRAY , "newarray" , "bc" , Flags.TRAP);
|
||||
define(Bytecodes.ANEWARRAY , "anewarray" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.ARRAYLENGTH , "arraylength" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.ATHROW , "athrow" , "b" , Flags.TRAP | Flags.STOP);
|
||||
define(Bytecodes.CHECKCAST , "checkcast" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.INSTANCEOF , "instanceof" , "bii" , Flags.TRAP);
|
||||
define(Bytecodes.MONITORENTER , "monitorenter" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.MONITOREXIT , "monitorexit" , "b" , Flags.TRAP);
|
||||
define(Bytecodes.WIDE , "wide" , "" );
|
||||
define(Bytecodes.MULTIANEWARRAY , "multianewarray" , "biic" , Flags.TRAP);
|
||||
define(Bytecodes.IFNULL , "ifnull" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.IFNONNULL , "ifnonnull" , "boo" , Flags.FALL_THROUGH | Flags.BRANCH);
|
||||
define(Bytecodes.GOTO_W , "goto_w" , "boooo", Flags.STOP | Flags.BRANCH);
|
||||
define(Bytecodes.JSR_W , "jsr_w" , "boooo", Flags.STOP | Flags.BRANCH);
|
||||
define(Bytecodes.BREAKPOINT , "breakpoint" , "b" , Flags.TRAP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the length of an instruction denoted by a given opcode.
|
||||
|
@ -956,7 +961,7 @@ module J2ME.Bytecode {
|
|||
private _nextBCI: number;
|
||||
|
||||
constructor(code: Uint8Array) {
|
||||
assert (code);
|
||||
assert (code, "No Code");
|
||||
this._code = code;
|
||||
this.setBCI(0);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче