⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jvmbytecodesdebug.jrag

📁 JDK1.4编译器后端
💻 JRAG
📖 第 1 页 / 共 3 页
字号:
/* * The JastAdd Extensible Java Compiler (http://jastadd.org) is covered * by the modified BSD License. You should have received a copy of the * modified BSD license with this compiler. *  * Copyright (c) 2005-2008, Torbjorn Ekman * All rights reserved. */import java.io.*;aspect JVMBytecodesDebug  {  class BytecodeDebug extends Bytecode {    public static int stackChange(byte b) {      int change = 0;      switch(b) {        // no change        case Bytecode.NOP:         case Bytecode.LALOAD:        case Bytecode.DALOAD:        case Bytecode.SWAP:        case Bytecode.IINC:        case Bytecode.I2F:        case Bytecode.L2D:        case Bytecode.F2I:        case Bytecode.D2L:        case Bytecode.I2B:        case Bytecode.I2C:        case Bytecode.I2S:        case Bytecode.GOTO:        case Bytecode.RET:        case Bytecode.RETURN:        case Bytecode.NEWARRAY:        case Bytecode.ANEWARRAY:        case Bytecode.ARRAYLENGTH:        case Bytecode.CHECKCAST:        case Bytecode.INSTANCEOF:        case Bytecode.GOTO_W:        case Bytecode.BREAKPOINT:        case Bytecode.IMPDEP1:        case Bytecode.IMPDEP2:        case Bytecode.WIDE:        case Bytecode.INEG:        case Bytecode.FNEG:        case Bytecode.LNEG:        case Bytecode.DNEG:        case Bytecode.JSR:        case Bytecode.JSR_W:          change = 0;          break;          // add 1        case Bytecode.ACONST_NULL:        case Bytecode.ICONST_M1:        case Bytecode.ICONST_0:        case Bytecode.ICONST_1:        case Bytecode.ICONST_2:        case Bytecode.ICONST_3:        case Bytecode.ICONST_4:        case Bytecode.ICONST_5:        case Bytecode.FCONST_0:        case Bytecode.FCONST_1:        case Bytecode.FCONST_2:         case Bytecode.BIPUSH:        case Bytecode.SIPUSH:        case Bytecode.LDC:        case Bytecode.LDC_W:        case Bytecode.ILOAD:        case Bytecode.FLOAD:        case Bytecode.ALOAD:        case Bytecode.ILOAD_0:        case Bytecode.ILOAD_1:        case Bytecode.ILOAD_2:        case Bytecode.ILOAD_3:        case Bytecode.FLOAD_0:        case Bytecode.FLOAD_1:        case Bytecode.FLOAD_2:        case Bytecode.FLOAD_3:        case Bytecode.ALOAD_0:        case Bytecode.ALOAD_1:        case Bytecode.ALOAD_2:        case Bytecode.ALOAD_3:        case Bytecode.DUP:        case Bytecode.DUP_X1:        case Bytecode.DUP_X2:        case Bytecode.I2L:        case Bytecode.I2D:        case Bytecode.F2L:        case Bytecode.F2D:        case Bytecode.NEW:          change = 1;          break;          // add 2        case Bytecode.LCONST_0:        case Bytecode.LCONST_1:        case Bytecode.DCONST_0:        case Bytecode.DCONST_1:        case Bytecode.LDC2_W:        case Bytecode.LLOAD:        case Bytecode.DLOAD:        case Bytecode.LLOAD_0:        case Bytecode.LLOAD_1:        case Bytecode.LLOAD_2:        case Bytecode.LLOAD_3:        case Bytecode.DLOAD_0:        case Bytecode.DLOAD_1:        case Bytecode.DLOAD_2:        case Bytecode.DLOAD_3:        case Bytecode.DUP2:        case Bytecode.DUP2_X1:        case Bytecode.DUP2_X2:          change = 2;          break;          // sub 1        case Bytecode.IALOAD:        case Bytecode.FALOAD:        case Bytecode.AALOAD:        case Bytecode.BALOAD:        case Bytecode.CALOAD:        case Bytecode.SALOAD:        case Bytecode.ISTORE:        case Bytecode.FSTORE:        case Bytecode.ASTORE:        case Bytecode.ISTORE_0:        case Bytecode.ISTORE_1:        case Bytecode.ISTORE_2:        case Bytecode.ISTORE_3:        case Bytecode.FSTORE_0:        case Bytecode.FSTORE_1:        case Bytecode.FSTORE_2:        case Bytecode.FSTORE_3:        case Bytecode.ASTORE_0:        case Bytecode.ASTORE_1:        case Bytecode.ASTORE_2:        case Bytecode.ASTORE_3:        case Bytecode.POP:        case Bytecode.IADD:        case Bytecode.FADD:        case Bytecode.ISUB:        case Bytecode.FSUB:        case Bytecode.IMUL:        case Bytecode.FMUL:        case Bytecode.IDIV:        case Bytecode.FDIV:        case Bytecode.IREM:        case Bytecode.FREM:        case Bytecode.ISHL:        case Bytecode.ISHR:        case Bytecode.IUSHR:        case Bytecode.LSHL:        case Bytecode.LSHR:        case Bytecode.LUSHR:        case Bytecode.IAND:        case Bytecode.IOR:        case Bytecode.IXOR:        case Bytecode.L2I:        case Bytecode.L2F:        case Bytecode.D2I:        case Bytecode.D2F:        case Bytecode.FCMPL:        case Bytecode.FCMPG:        case Bytecode.IFEQ:        case Bytecode.IFNE:        case Bytecode.IFLT:        case Bytecode.IFGE:        case Bytecode.IFGT:        case Bytecode.IFLE:        case Bytecode.TABLESWITCH:        case Bytecode.LOOKUPSWITCH:         case Bytecode.IRETURN:        case Bytecode.FRETURN:        case Bytecode.ARETURN:        case Bytecode.MONITORENTER:        case Bytecode.MONITOREXIT:        case Bytecode.IFNULL:        case Bytecode.IFNONNULL:        case Bytecode.ATHROW: // remember to add one to each catch block          change = -1;          break;          // sub 2        case Bytecode.DSTORE:        case Bytecode.LSTORE:        case Bytecode.LSTORE_0:        case Bytecode.LSTORE_1:        case Bytecode.LSTORE_2:        case Bytecode.LSTORE_3:        case Bytecode.DSTORE_0:        case Bytecode.DSTORE_1:        case Bytecode.DSTORE_2:        case Bytecode.DSTORE_3:        case Bytecode.POP2:        case Bytecode.LADD:        case Bytecode.DADD:        case Bytecode.LSUB:        case Bytecode.DSUB:        case Bytecode.LMUL:        case Bytecode.DMUL:        case Bytecode.LDIV:        case Bytecode.DDIV:        case Bytecode.LREM:        case Bytecode.DREM:        case Bytecode.LAND:        case Bytecode.LOR:        case Bytecode.LXOR:        case Bytecode.IF_ICMPEQ:        case Bytecode.IF_ICMPNE:        case Bytecode.IF_ICMPLT:        case Bytecode.IF_ICMPGE:        case Bytecode.IF_ICMPGT:        case Bytecode.IF_ICMPLE:        case Bytecode.IF_ACMPEQ:        case Bytecode.IF_ACMPNE:        case Bytecode.LRETURN:        case Bytecode.DRETURN:          change = -2;          break;          // sub 3        case Bytecode.IASTORE:        case Bytecode.FASTORE:        case Bytecode.AASTORE:        case Bytecode.BASTORE:        case Bytecode.CASTORE:        case Bytecode.SASTORE:        case Bytecode.LCMP:        case Bytecode.DCMPL:        case Bytecode.DCMPG:          change = -3;          break;          // sub 4        case Bytecode.LASTORE:        case Bytecode.DASTORE:          change = -4;          break;        case Bytecode.GETSTATIC:        case Bytecode.PUTSTATIC:        case Bytecode.GETFIELD:        case Bytecode.PUTFIELD:        case Bytecode.INVOKEVIRTUAL:        case Bytecode.INVOKESPECIAL:        case Bytecode.INVOKESTATIC:        case Bytecode.INVOKEINTERFACE:        case Bytecode.MULTIANEWARRAY:        default:          throw new Error("Can not compute stack change for bytecode: " + b);      }      return change;    }    public static String toString(byte code) {      String res = "";      switch(code)       {        case NOP: res = "nop";break;        case ACONST_NULL: res = "aconst_null";break;        case ICONST_M1: res = "iconst_m1";break;        case ICONST_0: res = "iconst_0";break;        case ICONST_1: res = "iconst_1";break;        case ICONST_2: res = "iconst_2";break;        case ICONST_3: res = "iconst_3";break;        case ICONST_4: res = "iconst_4";break;        case ICONST_5: res = "iconst_5";break;        case LCONST_0: res = "lconst_0";break;        case LCONST_1: res = "lconst_1";break;        case FCONST_0: res = "fconst_0";break;        case FCONST_1: res = "fconst_1";break;        case FCONST_2: res = "fconst_2";break;        case DCONST_0: res = "dconst_0";break;        case DCONST_1: res = "dconst_1";break;        case BIPUSH: res = "bipush";break;        case SIPUSH: res = "sipush";break;        case LDC: res = "ldc";break;        case LDC_W: res = "ldc_w";break;        case LDC2_W: res = "ldc2_w";break;        case ILOAD: res = "iload";break;        case LLOAD: res = "lload";break;        case FLOAD: res = "fload";break;        case DLOAD: res = "dload";break;        case ALOAD: res = "aload";break;        case ILOAD_0: res = "iload_0";break;        case ILOAD_1: res = "iload_1";break;        case ILOAD_2: res = "iload_2";break;        case ILOAD_3: res = "iload_3";break;        case LLOAD_0: res = "lload_0";break;        case LLOAD_1: res = "lload_1";break;        case LLOAD_2: res = "lload_2";break;        case LLOAD_3: res = "lload_3";break;        case FLOAD_0: res = "fload_0";break;        case FLOAD_1: res = "fload_1";break;        case FLOAD_2: res = "fload_2";break;        case FLOAD_3: res = "fload_3";break;        case DLOAD_0: res = "dload_0";break;        case DLOAD_1: res = "dload_1";break;        case DLOAD_2: res = "dload_2";break;        case DLOAD_3: res = "dload_3";break;        case ALOAD_0: res = "aload_0";break;        case ALOAD_1: res = "aload_1";break;        case ALOAD_2: res = "aload_2";break;        case ALOAD_3: res = "aload_3";break;        case IALOAD: res = "iaload";break;        case LALOAD: res = "laload";break;        case FALOAD: res = "faload";break;        case DALOAD: res = "daload";break;        case AALOAD: res = "aaload";break;        case BALOAD: res = "baload";break;        case CALOAD: res = "caload";break;        case SALOAD: res = "saload";break;        case ISTORE: res = "istore";break;        case LSTORE: res = "lstore";break;        case FSTORE: res = "fstore";break;        case DSTORE: res = "dstore";break;        case ASTORE: res = "astore";break;        case ISTORE_0: res = "istore_0";break;        case ISTORE_1: res = "istore_1";break;        case ISTORE_2: res = "istore_2";break;        case ISTORE_3: res = "istore_3";break;        case LSTORE_0: res = "lstore_0";break;        case LSTORE_1: res = "lstore_1";break;        case LSTORE_2: res = "lstore_2";break;        case LSTORE_3: res = "lstore_3";break;        case FSTORE_0: res = "fstore_0";break;        case FSTORE_1: res = "fstore_1";break;        case FSTORE_2: res = "fstore_2";break;        case FSTORE_3: res = "fstore_3";break;        case DSTORE_0: res = "dstore_0";break;        case DSTORE_1: res = "dstore_1";break;        case DSTORE_2: res = "dstore_2";break;        case DSTORE_3: res = "dstore_3";break;        case ASTORE_0: res = "astore_0";break;        case ASTORE_1: res = "astore_1";break;        case ASTORE_2: res = "astore_2";break;        case ASTORE_3: res = "astore_3";break;        case IASTORE: res = "iastore";break;        case LASTORE: res = "lastore";break;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -