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

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