aoqi@0: /* aoqi@0: * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package com.sun.tools.javac.jvm; aoqi@0: aoqi@0: aoqi@0: /** Bytecode instruction codes, as well as typecodes used as aoqi@0: * instruction modifiers. aoqi@0: * aoqi@0: *

This is NOT part of any supported API. aoqi@0: * If you write code that depends on this, you do so at your own risk. aoqi@0: * This code and its internal interfaces are subject to change or aoqi@0: * deletion without notice. aoqi@0: */ aoqi@0: public interface ByteCodes { aoqi@0: aoqi@0: /** Byte code instruction codes. aoqi@0: */ aoqi@0: int illegal = -1, aoqi@0: nop = 0, aoqi@0: aconst_null = 1, aoqi@0: iconst_m1 = 2, aoqi@0: iconst_0 = 3, aoqi@0: iconst_1 = 4, aoqi@0: iconst_2 = 5, aoqi@0: iconst_3 = 6, aoqi@0: iconst_4 = 7, aoqi@0: iconst_5 = 8, aoqi@0: lconst_0 = 9, aoqi@0: lconst_1 = 10, aoqi@0: fconst_0 = 11, aoqi@0: fconst_1 = 12, aoqi@0: fconst_2 = 13, aoqi@0: dconst_0 = 14, aoqi@0: dconst_1 = 15, aoqi@0: bipush = 16, aoqi@0: sipush = 17, aoqi@0: ldc1 = 18, aoqi@0: ldc2 = 19, aoqi@0: ldc2w = 20, aoqi@0: iload = 21, aoqi@0: lload = 22, aoqi@0: fload = 23, aoqi@0: dload = 24, aoqi@0: aload = 25, aoqi@0: iload_0 = 26, aoqi@0: iload_1 = 27, aoqi@0: iload_2 = 28, aoqi@0: iload_3 = 29, aoqi@0: lload_0 = 30, aoqi@0: lload_1 = 31, aoqi@0: lload_2 = 32, aoqi@0: lload_3 = 33, aoqi@0: fload_0 = 34, aoqi@0: fload_1 = 35, aoqi@0: fload_2 = 36, aoqi@0: fload_3 = 37, aoqi@0: dload_0 = 38, aoqi@0: dload_1 = 39, aoqi@0: dload_2 = 40, aoqi@0: dload_3 = 41, aoqi@0: aload_0 = 42, aoqi@0: aload_1 = 43, aoqi@0: aload_2 = 44, aoqi@0: aload_3 = 45, aoqi@0: iaload = 46, aoqi@0: laload = 47, aoqi@0: faload = 48, aoqi@0: daload = 49, aoqi@0: aaload = 50, aoqi@0: baload = 51, aoqi@0: caload = 52, aoqi@0: saload = 53, aoqi@0: istore = 54, aoqi@0: lstore = 55, aoqi@0: fstore = 56, aoqi@0: dstore = 57, aoqi@0: astore = 58, aoqi@0: istore_0 = 59, aoqi@0: istore_1 = 60, aoqi@0: istore_2 = 61, aoqi@0: istore_3 = 62, aoqi@0: lstore_0 = 63, aoqi@0: lstore_1 = 64, aoqi@0: lstore_2 = 65, aoqi@0: lstore_3 = 66, aoqi@0: fstore_0 = 67, aoqi@0: fstore_1 = 68, aoqi@0: fstore_2 = 69, aoqi@0: fstore_3 = 70, aoqi@0: dstore_0 = 71, aoqi@0: dstore_1 = 72, aoqi@0: dstore_2 = 73, aoqi@0: dstore_3 = 74, aoqi@0: astore_0 = 75, aoqi@0: astore_1 = 76, aoqi@0: astore_2 = 77, aoqi@0: astore_3 = 78, aoqi@0: iastore = 79, aoqi@0: lastore = 80, aoqi@0: fastore = 81, aoqi@0: dastore = 82, aoqi@0: aastore = 83, aoqi@0: bastore = 84, aoqi@0: castore = 85, aoqi@0: sastore = 86, aoqi@0: pop = 87, aoqi@0: pop2 = 88, aoqi@0: dup = 89, aoqi@0: dup_x1 = 90, aoqi@0: dup_x2 = 91, aoqi@0: dup2 = 92, aoqi@0: dup2_x1 = 93, aoqi@0: dup2_x2 = 94, aoqi@0: swap = 95, aoqi@0: iadd = 96, aoqi@0: ladd = 97, aoqi@0: fadd = 98, aoqi@0: dadd = 99, aoqi@0: isub = 100, aoqi@0: lsub = 101, aoqi@0: fsub = 102, aoqi@0: dsub = 103, aoqi@0: imul = 104, aoqi@0: lmul = 105, aoqi@0: fmul = 106, aoqi@0: dmul = 107, aoqi@0: idiv = 108, aoqi@0: ldiv = 109, aoqi@0: fdiv = 110, aoqi@0: ddiv = 111, aoqi@0: imod = 112, aoqi@0: lmod = 113, aoqi@0: fmod = 114, aoqi@0: dmod = 115, aoqi@0: ineg = 116, aoqi@0: lneg = 117, aoqi@0: fneg = 118, aoqi@0: dneg = 119, aoqi@0: ishl = 120, aoqi@0: lshl = 121, aoqi@0: ishr = 122, aoqi@0: lshr = 123, aoqi@0: iushr = 124, aoqi@0: lushr = 125, aoqi@0: iand = 126, aoqi@0: land = 127, aoqi@0: ior = 128, aoqi@0: lor = 129, aoqi@0: ixor = 130, aoqi@0: lxor = 131, aoqi@0: iinc = 132, aoqi@0: i2l = 133, aoqi@0: i2f = 134, aoqi@0: i2d = 135, aoqi@0: l2i = 136, aoqi@0: l2f = 137, aoqi@0: l2d = 138, aoqi@0: f2i = 139, aoqi@0: f2l = 140, aoqi@0: f2d = 141, aoqi@0: d2i = 142, aoqi@0: d2l = 143, aoqi@0: d2f = 144, aoqi@0: int2byte = 145, aoqi@0: int2char = 146, aoqi@0: int2short = 147, aoqi@0: lcmp = 148, aoqi@0: fcmpl = 149, aoqi@0: fcmpg = 150, aoqi@0: dcmpl = 151, aoqi@0: dcmpg = 152, aoqi@0: ifeq = 153, aoqi@0: ifne = 154, aoqi@0: iflt = 155, aoqi@0: ifge = 156, aoqi@0: ifgt = 157, aoqi@0: ifle = 158, aoqi@0: if_icmpeq = 159, aoqi@0: if_icmpne = 160, aoqi@0: if_icmplt = 161, aoqi@0: if_icmpge = 162, aoqi@0: if_icmpgt = 163, aoqi@0: if_icmple = 164, aoqi@0: if_acmpeq = 165, aoqi@0: if_acmpne = 166, aoqi@0: goto_ = 167, aoqi@0: jsr = 168, aoqi@0: ret = 169, aoqi@0: tableswitch = 170, aoqi@0: lookupswitch = 171, aoqi@0: ireturn = 172, aoqi@0: lreturn = 173, aoqi@0: freturn = 174, aoqi@0: dreturn = 175, aoqi@0: areturn = 176, aoqi@0: return_ = 177, aoqi@0: getstatic = 178, aoqi@0: putstatic = 179, aoqi@0: getfield = 180, aoqi@0: putfield = 181, aoqi@0: invokevirtual = 182, aoqi@0: invokespecial = 183, aoqi@0: invokestatic = 184, aoqi@0: invokeinterface = 185, aoqi@0: invokedynamic = 186, aoqi@0: new_ = 187, aoqi@0: newarray = 188, aoqi@0: anewarray = 189, aoqi@0: arraylength = 190, aoqi@0: athrow = 191, aoqi@0: checkcast = 192, aoqi@0: instanceof_ = 193, aoqi@0: monitorenter = 194, aoqi@0: monitorexit = 195, aoqi@0: wide = 196, aoqi@0: multianewarray = 197, aoqi@0: if_acmp_null = 198, aoqi@0: if_acmp_nonnull = 199, aoqi@0: goto_w = 200, aoqi@0: jsr_w = 201, aoqi@0: breakpoint = 202, aoqi@0: ByteCodeCount = 203; aoqi@0: aoqi@0: /** Virtual instruction codes; used for constant folding. aoqi@0: */ aoqi@0: int string_add = 256, // string + aoqi@0: bool_not = 257, // boolean ! aoqi@0: bool_and = 258, // boolean && aoqi@0: bool_or = 259; // boolean || aoqi@0: aoqi@0: /** Virtual opcodes; used for shifts with long shiftcount aoqi@0: */ aoqi@0: int ishll = 270, // int shift left with long count aoqi@0: lshll = 271, // long shift left with long count aoqi@0: ishrl = 272, // int shift right with long count aoqi@0: lshrl = 273, // long shift right with long count aoqi@0: iushrl = 274, // int unsigned shift right with long count aoqi@0: lushrl = 275; // long unsigned shift right with long count aoqi@0: aoqi@0: /** Virtual opcode for null reference checks aoqi@0: */ aoqi@0: int nullchk = 276; // return operand if non-null, aoqi@0: // otherwise throw NullPointerException. aoqi@0: aoqi@0: /** Virtual opcode for disallowed operations. aoqi@0: */ aoqi@0: int error = 277; aoqi@0: aoqi@0: /** All conditional jumps come in pairs. To streamline the aoqi@0: * treatment of jumps, we also introduce a negation of an aoqi@0: * unconditional jump. That opcode happens to be jsr. aoqi@0: */ aoqi@0: int dontgoto = jsr; aoqi@0: aoqi@0: /** Shift and mask constants for shifting prefix instructions. aoqi@0: * a pair of instruction codes such as LCMP ; IFEQ is encoded aoqi@0: * in Symtab as {@literal (LCMP << preShift) + IFEQ }. aoqi@0: */ aoqi@0: int preShift = 9; aoqi@0: int preMask = (1 << preShift) - 1; aoqi@0: aoqi@0: /** Type codes. aoqi@0: */ aoqi@0: int INTcode = 0, aoqi@0: LONGcode = 1, aoqi@0: FLOATcode = 2, aoqi@0: DOUBLEcode = 3, aoqi@0: OBJECTcode = 4, aoqi@0: BYTEcode = 5, aoqi@0: CHARcode = 6, aoqi@0: SHORTcode = 7, aoqi@0: VOIDcode = 8, aoqi@0: TypeCodeCount = 9; aoqi@0: aoqi@0: static final String[] typecodeNames = { aoqi@0: "int", aoqi@0: "long", aoqi@0: "float", aoqi@0: "double", aoqi@0: "object", aoqi@0: "byte", aoqi@0: "char", aoqi@0: "short", aoqi@0: "void", aoqi@0: "oops" aoqi@0: }; aoqi@0: }