/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * The contents of this file are subject to the Netscape Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/NPL/
 *
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express oqr
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 * The Original Code is Rhino code, released
 * May 6, 1999.
 *
 * The Initial Developer of the Original Code is Netscape
 * Communications Corporation.  Portions created by Netscape are
 * Copyright (C) 1997-1999 Netscape Communications Corporation. All
 * Rights Reserved.
 *
 * Contributor(s): 
 * Roger Lawrence
 *
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU Public License (the "GPL"), in which case the
 * provisions of the GPL are applicable instead of those above.
 * If you wish to allow use of your version of this file only
 * under the terms of the GPL and not to allow others to use your
 * version of this file under the NPL, indicate your decision by
 * deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL.  If you do not delete
 * the provisions above, a recipient may use your version of this
 * file under either the NPL or the GPL.
 */

package org.mozilla.classfile;

/**
 * This class provides opcode values expected by the JVM in Java class files.
 * 
 * It also provides tables for internal use by the ClassFileWriter.
 * 
 * @author Roger Lawrence
 */
public class ByteCode {

    /**
     * The byte opcodes defined by the Java Virtual Machine.
     */
    public static final byte
        NOP = 0x00,
        ACONST_NULL = 0x01,
        ICONST_M1 = 0x02,
        ICONST_0 = 0x03,
        ICONST_1 = 0x04,
        ICONST_2 = 0x05,
        ICONST_3 = 0x06,
        ICONST_4 = 0x07,
        ICONST_5 = 0x08,
        LCONST_0 = 0x09,
        LCONST_1 = 0x0A,
        FCONST_0 = 0x0B,
        FCONST_1 = 0x0C,
        FCONST_2 = 0x0D,
        DCONST_0 = 0x0E,
        DCONST_1 = 0x0F,
        BIPUSH = 0x10,
        SIPUSH = 0x11,
        LDC = 0x12,
        LDC_W = 0x13,
        LDC2_W = 0x14,
        ILOAD = 0x15,
        LLOAD = 0x16,
        FLOAD = 0x17,
        DLOAD = 0x18,
        ALOAD = 0x19,
        ILOAD_0 = 0x1A,
        ILOAD_1 = 0x1B,
        ILOAD_2 = 0x1C,
        ILOAD_3 = 0x1D,
        LLOAD_0 = 0x1E,
        LLOAD_1 = 0x1F,
        LLOAD_2 = 0x20,
        LLOAD_3 = 0x21,
        FLOAD_0 = 0x22,
        FLOAD_1 = 0x23,
        FLOAD_2 = 0x24,
        FLOAD_3 = 0x25,
        DLOAD_0 = 0x26,
        DLOAD_1 = 0x27,
        DLOAD_2 = 0x28,
        DLOAD_3 = 0x29,
        ALOAD_0 = 0x2A,
        ALOAD_1 = 0x2B,
        ALOAD_2 = 0x2C,
        ALOAD_3 = 0x2D,
        IALOAD = 0x2E,
        LALOAD = 0x2F,
        FALOAD = 0x30,
        DALOAD = 0x31,
        AALOAD = 0x32,
        BALOAD = 0x33,
        CALOAD = 0x34,
        SALOAD = 0x35,
        ISTORE = 0x36,
        LSTORE = 0x37,
        FSTORE = 0x38,
        DSTORE = 0x39,
        ASTORE = 0x3A,
        ISTORE_0 = 0x3B,
        ISTORE_1 = 0x3C,
        ISTORE_2 = 0x3D,
        ISTORE_3 = 0x3E,
        LSTORE_0 = 0x3F,
        LSTORE_1 = 0x40,
        LSTORE_2 = 0x41,
        LSTORE_3 = 0x42,
        FSTORE_0 = 0x43,
        FSTORE_1 = 0x44,
        FSTORE_2 = 0x45,
        FSTORE_3 = 0x46,
        DSTORE_0 = 0x47,
        DSTORE_1 = 0x48,
        DSTORE_2 = 0x49,
        DSTORE_3 = 0x4A,
        ASTORE_0 = 0x4B,
        ASTORE_1 = 0x4C,
        ASTORE_2 = 0x4D,
        ASTORE_3 = 0x4E,
        IASTORE = 0x4F,
        LASTORE = 0x50,
        FASTORE = 0x51,
        DASTORE = 0x52,
        AASTORE = 0x53,
        BASTORE = 0x54,
        CASTORE = 0x55,
        SASTORE = 0x56,
        POP = 0x57,
        POP2 = 0x58,
        DUP = 0x59,
        DUP_X1 = 0x5A,
        DUP_X2 = 0x5B,
        DUP2 = 0x5C,
        DUP2_X1 = 0x5D,
        DUP2_X2 = 0x5E,
        SWAP = 0x5F,
        IADD = 0x60,
        LADD = 0x61,
        FADD = 0x62,
        DADD = 0x63,
        ISUB = 0x64,
        LSUB = 0x65,
        FSUB = 0x66,
        DSUB = 0x67,
        IMUL = 0x68,
        LMUL = 0x69,
        FMUL = 0x6A,
        DMUL = 0x6B,
        IDIV = 0x6C,
        LDIV = 0x6D,
        FDIV = 0x6E,
        DDIV = 0x6F,
        IREM = 0x70,
        LREM = 0x71,
        FREM = 0x72,
        DREM = 0x73,
        INEG = 0x74,
        LNEG = 0x75,
        FNEG = 0x76,
        DNEG = 0x77,
        ISHL = 0x78,
        LSHL = 0x79,
        ISHR = 0x7A,
        LSHR = 0x7B,
        IUSHR = 0x7C,
        LUSHR = 0x7D,
        IAND = 0x7E,
        LAND = 0x7F,
        IOR = (byte)0x80,
        LOR = (byte)0x81,
        IXOR = (byte)0x82,
        LXOR = (byte)0x83,
        IINC = (byte)0x84,
        I2L = (byte)0x85,
        I2F = (byte)0x86,
        I2D = (byte)0x87,
        L2I = (byte)0x88,
        L2F = (byte)0x89,
        L2D = (byte)0x8A,
        F2I = (byte)0x8B,
        F2L = (byte)0x8C,
        F2D = (byte)0x8D,
        D2I = (byte)0x8E,
        D2L = (byte)0x8F,
        D2F = (byte)0x90,
        I2B = (byte)0x91,
        I2C = (byte)0x92,
        I2S = (byte)0x93,
        LCMP = (byte)0x94,
        FCMPL = (byte)0x95,
        FCMPG = (byte)0x96,
        DCMPL = (byte)0x97,
        DCMPG = (byte)0x98,
        IFEQ = (byte)0x99,
        IFNE = (byte)0x9A,
        IFLT = (byte)0x9B,
        IFGE = (byte)0x9C,
        IFGT = (byte)0x9D,
        IFLE = (byte)0x9E,
        IF_ICMPEQ = (byte)0x9F,
        IF_ICMPNE = (byte)0xA0,
        IF_ICMPLT = (byte)0xA1,
        IF_ICMPGE = (byte)0xA2,
        IF_ICMPGT = (byte)0xA3,
        IF_ICMPLE = (byte)0xA4,
        IF_ACMPEQ = (byte)0xA5,
        IF_ACMPNE = (byte)0xA6,
        GOTO = (byte)0xA7,
        JSR = (byte)0xA8,
        RET = (byte)0xA9,
        TABLESWITCH = (byte)0xAA,
        LOOKUPSWITCH = (byte)0xAB,
        IRETURN = (byte)0xAC,
        LRETURN = (byte)0xAD,
        FRETURN = (byte)0xAE,
        DRETURN = (byte)0xAF,
        ARETURN = (byte)0xB0,
        RETURN = (byte)0xB1,
        GETSTATIC = (byte)0xB2,
        PUTSTATIC = (byte)0xB3,
        GETFIELD = (byte)0xB4,
        PUTFIELD = (byte)0xB5,
        INVOKEVIRTUAL = (byte)0xB6,
        INVOKESPECIAL = (byte)0xB7,
        INVOKESTATIC = (byte)0xB8,
        INVOKEINTERFACE = (byte)0xB9,
        XXXUNUSEDXXX = (byte)0xBA,
        NEW = (byte)0xBB,
        NEWARRAY = (byte)0xBC,
        ANEWARRAY = (byte)0xBD,
        ARRAYLENGTH = (byte)0xBE,
        ATHROW = (byte)0xBF,
        CHECKCAST = (byte)0xC0,
        INSTANCEOF = (byte)0xC1,
        MONITORENTER = (byte)0xC2,
        MONITOREXIT = (byte)0xC3,
        WIDE = (byte)0xC4,
        MULTIANEWARRAY = (byte)0xC5,
        IFNULL = (byte)0xC6,
        IFNONNULL = (byte)0xC7,
        GOTO_W = (byte)0xC8,
        JSR_W = (byte)0xC9,
        BREAKPOINT = (byte)0xCA,
        LDC_QUICK = (byte)0xCB,
        LDC_W_QUICK = (byte)0xCC,
        LDC2_W_QUICK = (byte)0xCD,
        GETFIELD_QUICK = (byte)0xCE,
        PUTFIELD_QUICK = (byte)0xCF,
        GETFIELD2_QUICK = (byte)0xD0,
        PUTFIELD2_QUICK = (byte)0xD1,
        GETSTATIC_QUICK = (byte)0xD2,
        PUTSTATIC_QUICK = (byte)0xD3,
        GETSTATIC2_QUICK = (byte)0xD4,
        PUTSTATIC2_QUICK = (byte)0xD5,
        INVOKEVIRTUAL_QUICK = (byte)0xD6,
        INVOKENONVIRTUAL_QUICK = (byte)0xD7,
        INVOKESUPER_QUICK = (byte)0xD8,
        INVOKESTATIC_QUICK = (byte)0xD9,
        INVOKEINTERFACE_QUICK = (byte)0xDA,
        INVOKEVIRTUALOBJECT_QUICK = (byte)0xDB,

        NEW_QUICK = (byte)0xDD,
        ANEWARRAY_QUICK = (byte)0xDE,
        MULTIANEWARRAY_QUICK = (byte)0xDF,
        CHECKCAST_QUICK = (byte)0xE0,
        INSTANCEOF_QUICK = (byte)0xE1,
        INVOKEVIRTUAL_QUICK_W = (byte)0xE2,
        GETFIELD_QUICK_W = (byte)0xE3,
        PUTFIELD_QUICK_W = (byte)0xE4,
        IMPDEP1 = (byte)0xFE,
        IMPDEP2 = (byte)0xFF;
    
    
        /** 
         * Types for the NEWARRAY opcode.
         */
        public static final byte
            T_BOOLEAN = 4,
            T_CHAR = 5,
            T_FLOAT = 6,
            T_DOUBLE = 7,
            T_BYTE = 8,
            T_SHORT = 9,
            T_INT = 10,
            T_LONG = 11;

        /**
         *  Number of bytes of operands generated after the opcode.
         */
        static final byte[] extra = {   
        /* NOP */ 0,
        /* ACONST_NULL */ 0,
        /* ICONST_M1 */ 0,
        /* ICONST_0 */ 0,
        /* ICONST_1 */ 0,
        /* ICONST_2 */ 0,
        /* ICONST_3 */ 0,
        /* ICONST_4 */ 0,
        /* ICONST_5 */ 0,
        /* LCONST_0 */ 0,
        /* LCONST_1 */ 0,
        /* FCONST_0 */ 0,
        /* FCONST_1 */ 0,
        /* FCONST_2 */ 0,
        /* DCONST_0 */ 0,
        /* DCONST_1 */ 0,
        /* BIPUSH */ 1,
        /* SIPUSH */ 2,
        /* LDC */ 1,
        /* LDC_W */ 2,
        /* LDC2_W */ 2,
        /* ILOAD */ 1,
        /* LLOAD */ 1,
        /* FLOAD */ 1,
        /* DLOAD */ 1,
        /* ALOAD */ 1,
        /* ILOAD_0 */ 0,
        /* ILOAD_1 */ 0,
        /* ILOAD_2 */ 0,
        /* ILOAD_3 */ 0,
        /* LLOAD_0 */ 0,
        /* LLOAD_1 */ 0,
        /* LLOAD_2 */ 0,
        /* LLOAD_3 */ 0,
        /* FLOAD_0 */ 0,
        /* FLOAD_1 */ 0,
        /* FLOAD_2 */ 0,
        /* FLOAD_3 */ 0,
        /* DLOAD_0 */ 0,
        /* DLOAD_1 */ 0,
        /* DLOAD_2 */ 0,
        /* DLOAD_3 */ 0,
        /* ALOAD_0 */ 0,
        /* ALOAD_1 */ 0,
        /* ALOAD_2 */ 0,
        /* ALOAD_3 */ 0,
        /* IALOAD */ 0,
        /* LALOAD */ 0,
        /* FALOAD */ 0,
        /* DALOAD */ 0,
        /* AALOAD */ 0,
        /* BALOAD */ 0,
        /* CALOAD */ 0,
        /* SALOAD */ 0,
        /* ISTORE */ 1,
        /* LSTORE */ 1,
        /* FSTORE */ 1,
        /* DSTORE */ 1,
        /* ASTORE */ 1,
        /* ISTORE_0 */ 0,
        /* ISTORE_1 */ 0,
        /* ISTORE_2 */ 0,
        /* ISTORE_3 */ 0,
        /* LSTORE_0 */ 0,
        /* LSTORE_1 */ 0,
        /* LSTORE_2 */ 0,
        /* LSTORE_3 */ 0,
        /* FSTORE_0 */ 0,
        /* FSTORE_1 */ 0,
        /* FSTORE_2 */ 0,
        /* FSTORE_3 */ 0,
        /* DSTORE_0 */ 0,
        /* DSTORE_1 */ 0,
        /* DSTORE_2 */ 0,
        /* DSTORE_3 */ 0,
        /* ASTORE_0 */ 0,
        /* ASTORE_1 */ 0,
        /* ASTORE_2 */ 0,
        /* ASTORE_3 */ 0,
        /* IASTORE */ 0,
        /* LASTORE */ 0,
        /* FASTORE */ 0,
        /* DASTORE */ 0,
        /* AASTORE */ 0,
        /* BASTORE */ 0,
        /* CASTORE */ 0,
        /* SASTORE */ 0,
        /* POP */ 0,
        /* POP2 */ 0,
        /* DUP */ 0,
        /* DUP_X1 */ 0,
        /* DUP_X2 */ 0,
        /* DUP2 */ 0,
        /* DUP2_X1 */ 0,
        /* DUP2_X2 */ 0,
        /* SWAP */ 0,
        /* IADD */ 0,
        /* LADD */ 0,
        /* FADD */ 0,
        /* DADD */ 0,
        /* ISUB */ 0,
        /* LSUB */ 0,
        /* FSUB */ 0,
        /* DSUB */ 0,
        /* IMUL */ 0,
        /* LMUL */ 0,
        /* FMUL */ 0,
        /* DMUL */ 0,
        /* IDIV */ 0,
        /* LDIV */ 0,
        /* FDIV */ 0,
        /* DDIV */ 0,
        /* IREM */ 0,
        /* LREM */ 0,
        /* FREM */ 0,
        /* DREM */ 0,
        /* INEG */ 0,
        /* LNEG */ 0,
        /* FNEG */ 0,
        /* DNEG */ 0,
        /* ISHL */ 0,
        /* LSHL */ 0,
        /* ISHR */ 0,
        /* LSHR */ 0,
        /* IUSHR */ 0,
        /* LUSHR */ 0,
        /* IAND */ 0,
        /* LAND */ 0,
        /* IOR */ 0,
        /* LOR */ 0,
        /* IXOR */ 0,
        /* LXOR */ 0,
        /* IINC */ 2,
        /* I2L */ 0,
        /* I2F */ 0,
        /* I2D */ 0,
        /* L2I */ 0,
        /* L2F */ 0,
        /* L2D */ 0,
        /* F2I */ 0,
        /* F2L */ 0,
        /* F2D */ 0,
        /* D2I */ 0,
        /* D2L */ 0,
        /* D2F */ 0,
        /* I2B */ 0,
        /* I2C */ 0,
        /* I2S */ 0,
        /* LCMP */ 0,
        /* FCMPL */ 0,
        /* FCMPG */ 0,
        /* DCMPL */ 0,
        /* DCMPG */ 0,
        /* IFEQ */ 2,
        /* IFNE */ 2,
        /* IFLT */ 2,
        /* IFGE */ 2,
        /* IFGT */ 2,
        /* IFLE */ 2,
        /* IF_ICMPEQ */ 2,
        /* IF_ICMPNE */ 2,
        /* IF_ICMPLT */ 2,
        /* IF_ICMPGE */ 2,
        /* IF_ICMPGT */ 2,
        /* IF_ICMPLE */ 2,
        /* IF_ACMPEQ */ 2,
        /* IF_ACMPNE */ 2,
        /* GOTO */ 2,
        /* JSR */ 2,
        /* RET */ 1,
        /* TABLESWITCH */ -1,       // depends on alignment
        /* LOOKUPSWITCH */ -1,      // depends on alignment
        /* IRETURN */ 0,
        /* LRETURN */ 0,
        /* FRETURN */ 0,
        /* DRETURN */ 0,
        /* ARETURN */ 0,
        /* RETURN */ 0,
        /* GETSTATIC */ 2,
        /* PUTSTATIC */ 2,
        /* GETFIELD */ 2,
        /* PUTFIELD */ 2,
        /* INVOKEVIRTUAL */ 2,
        /* INVOKESPECIAL */ 2,
        /* INVOKESTATIC */ 2,
        /* INVOKEINTERFACE */ 2,
        /* XXXUNUSEDXXX */ 0,
        /* NEW */ 2,
        /* NEWARRAY */ 1,
        /* ANEWARRAY */ 2,
        /* ARRAYLENGTH */ 0,
        /* ATHROW */ 0,
        /* CHECKCAST */ 2,
        /* INSTANCEOF */ 2,
        /* MONITORENTER */ 0,
        /* MONITOREXIT */ 0,
        /* WIDE */ 0,
        /* MULTIANEWARRAY */ 3,
        /* IFNULL */ 2,
        /* IFNONNULL */ 2,
        /* GOTO_W */ 4,
        /* JSR_W */ 4,
        /* BREAKPOINT */ 0,
        /* LDC_QUICK */ 1,
        /* LDC_W_QUICK */ 2,
        /* LDC2_W_QUICK */ 2,
        /* GETFIELD_QUICK */ 2,
        /* PUTFIELD_QUICK */ 2,
        /* GETFIELD2_QUICK */ 2,
        /* PUTFIELD2_QUICK */ 2,
        /* GETSTATIC_QUICK */ 2,
        /* PUTSTATIC_QUICK */ 2,
        /* GETSTATIC2_QUICK */ 2,
        /* PUTSTATIC2_QUICK */ 2,
        /* INVOKEVIRTUAL_QUICK */ 2,
        /* INVOKENONVIRTUAL_QUICK */ 2,
        /* INVOKESUPER_QUICK */ 2,
        /* INVOKESTATIC_QUICK */ 2,
        /* INVOKEINTERFACE_QUICK */ 2,
        /* INVOKEVIRTUALOBJECT_QUICK */ 2,
        /* XXXUNUSEDXXX */ 0,
        /* NEW_QUICK */ 2,
        /* ANEWARRAY_QUICK */ 2,
        /* MULTIANEWARRAY_QUICK */ 3,
        /* CHECKCAST_QUICK */ 2,
        /* INSTANCEOF_QUICK */ 2,
        /* INVOKEVIRTUAL_QUICK_W */ 0,
        /* GETFIELD_QUICK_W */ 2,
        /* PUTFIELD_QUICK_W */ 2,
        /* XXXUNUSEDXXX */ 0,
         /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* IMPDEP1 */ 0,
        /* IMPDEP2 */ 0
        };

        /**
         * Number of operands accompanying the opcode.
         */
        static final byte[] opcodeCount = {   
        /* NOP */ 0,
        /* ACONST_NULL */ 0,
        /* ICONST_M1 */ 0,
        /* ICONST_0 */ 0,
        /* ICONST_1 */ 0,
        /* ICONST_2 */ 0,
        /* ICONST_3 */ 0,
        /* ICONST_4 */ 0,
        /* ICONST_5 */ 0,
        /* LCONST_0 */ 0,
        /* LCONST_1 */ 0,
        /* FCONST_0 */ 0,
        /* FCONST_1 */ 0,
        /* FCONST_2 */ 0,
        /* DCONST_0 */ 0,
        /* DCONST_1 */ 0,
        /* BIPUSH */ 1,
        /* SIPUSH */ 1,
        /* LDC */ 1,
        /* LDC_W */ 1,
        /* LDC2_W */ 1,
        /* ILOAD */ 1,
        /* LLOAD */ 1,
        /* FLOAD */ 1,
        /* DLOAD */ 1,
        /* ALOAD */ 1,
        /* ILOAD_0 */ 0,
        /* ILOAD_1 */ 0,
        /* ILOAD_2 */ 0,
        /* ILOAD_3 */ 0,
        /* LLOAD_0 */ 0,
        /* LLOAD_1 */ 0,
        /* LLOAD_2 */ 0,
        /* LLOAD_3 */ 0,
        /* FLOAD_0 */ 0,
        /* FLOAD_1 */ 0,
        /* FLOAD_2 */ 0,
        /* FLOAD_3 */ 0,
        /* DLOAD_0 */ 0,
        /* DLOAD_1 */ 0,
        /* DLOAD_2 */ 0,
        /* DLOAD_3 */ 0,
        /* ALOAD_0 */ 0,
        /* ALOAD_1 */ 0,
        /* ALOAD_2 */ 0,
        /* ALOAD_3 */ 0,
        /* IALOAD */ 0,
        /* LALOAD */ 0,
        /* FALOAD */ 0,
        /* DALOAD */ 0,
        /* AALOAD */ 0,
        /* BALOAD */ 0,
        /* CALOAD */ 0,
        /* SALOAD */ 0,
        /* ISTORE */ 1,
        /* LSTORE */ 1,
        /* FSTORE */ 1,
        /* DSTORE */ 1,
        /* ASTORE */ 1,
        /* ISTORE_0 */ 0,
        /* ISTORE_1 */ 0,
        /* ISTORE_2 */ 0,
        /* ISTORE_3 */ 0,
        /* LSTORE_0 */ 0,
        /* LSTORE_1 */ 0,
        /* LSTORE_2 */ 0,
        /* LSTORE_3 */ 0,
        /* FSTORE_0 */ 0,
        /* FSTORE_1 */ 0,
        /* FSTORE_2 */ 0,
        /* FSTORE_3 */ 0,
        /* DSTORE_0 */ 0,
        /* DSTORE_1 */ 0,
        /* DSTORE_2 */ 0,
        /* DSTORE_3 */ 0,
        /* ASTORE_0 */ 0,
        /* ASTORE_1 */ 0,
        /* ASTORE_2 */ 0,
        /* ASTORE_3 */ 0,
        /* IASTORE */ 0,
        /* LASTORE */ 0,
        /* FASTORE */ 0,
        /* DASTORE */ 0,
        /* AASTORE */ 0,
        /* BASTORE */ 0,
        /* CASTORE */ 0,
        /* SASTORE */ 0,
        /* POP */ 0,
        /* POP2 */ 0,
        /* DUP */ 0,
        /* DUP_X1 */ 0,
        /* DUP_X2 */ 0,
        /* DUP2 */ 0,
        /* DUP2_X1 */ 0,
        /* DUP2_X2 */ 0,
        /* SWAP */ 0,
        /* IADD */ 0,
        /* LADD */ 0,
        /* FADD */ 0,
        /* DADD */ 0,
        /* ISUB */ 0,
        /* LSUB */ 0,
        /* FSUB */ 0,
        /* DSUB */ 0,
        /* IMUL */ 0,
        /* LMUL */ 0,
        /* FMUL */ 0,
        /* DMUL */ 0,
        /* IDIV */ 0,
        /* LDIV */ 0,
        /* FDIV */ 0,
        /* DDIV */ 0,
        /* IREM */ 0,
        /* LREM */ 0,
        /* FREM */ 0,
        /* DREM */ 0,
        /* INEG */ 0,
        /* LNEG */ 0,
        /* FNEG */ 0,
        /* DNEG */ 0,
        /* ISHL */ 0,
        /* LSHL */ 0,
        /* ISHR */ 0,
        /* LSHR */ 0,
        /* IUSHR */ 0,
        /* LUSHR */ 0,
        /* IAND */ 0,
        /* LAND */ 0,
        /* IOR */ 0,
        /* LOR */ 0,
        /* IXOR */ 0,
        /* LXOR */ 0,
        /* IINC */ 2,
        /* I2L */ 0,
        /* I2F */ 0,
        /* I2D */ 0,
        /* L2I */ 0,
        /* L2F */ 0,
        /* L2D */ 0,
        /* F2I */ 0,
        /* F2L */ 0,
        /* F2D */ 0,
        /* D2I */ 0,
        /* D2L */ 0,
        /* D2F */ 0,
        /* I2B */ 0,
        /* I2C */ 0,
        /* I2S */ 0,
        /* LCMP */ 0,
        /* FCMPL */ 0,
        /* FCMPG */ 0,
        /* DCMPL */ 0,
        /* DCMPG */ 0,
        /* IFEQ */ 1,
        /* IFNE */ 1,
        /* IFLT */ 1,
        /* IFGE */ 1,
        /* IFGT */ 1,
        /* IFLE */ 1,
        /* IF_ICMPEQ */ 1,
        /* IF_ICMPNE */ 1,
        /* IF_ICMPLT */ 1,
        /* IF_ICMPGE */ 1,
        /* IF_ICMPGT */ 1,
        /* IF_ICMPLE */ 1,
        /* IF_ACMPEQ */ 1,
        /* IF_ACMPNE */ 1,
        /* GOTO */ 1,
        /* JSR */ 1,
        /* RET */ 1,
        /* TABLESWITCH */ -1,
        /* LOOKUPSWITCH */ -1,
        /* IRETURN */ 0,
        /* LRETURN */ 0,
        /* FRETURN */ 0,
        /* DRETURN */ 0,
        /* ARETURN */ 0,
        /* RETURN */ 0,
        /* GETSTATIC */ 1,
        /* PUTSTATIC */ 1,
        /* GETFIELD */ 1,
        /* PUTFIELD */ 1,
        /* INVOKEVIRTUAL */ 1,
        /* INVOKESPECIAL */ 1,
        /* INVOKESTATIC */ 1,
        /* INVOKEINTERFACE */ 1,
        /* XXXUNUSEDXXX */ 0,
        /* NEW */ 1,
        /* NEWARRAY */ 1,
        /* ANEWARRAY */ 1,
        /* ARRAYLENGTH */ 0,
        /* ATHROW */ 0,
        /* CHECKCAST */ 1,
        /* INSTANCEOF */ 1,
        /* MONITORENTER */ 0,
        /* MONITOREXIT */ 0,
        /* WIDE */ 0,
        /* MULTIANEWARRAY */ 2,
        /* IFNULL */ 1,
        /* IFNONNULL */ 1,
        /* GOTO_W */ 1,
        /* JSR_W */ 1,
        /* BREAKPOINT */ 0,
        /* LDC_QUICK */ -1,
        /* LDC_W_QUICK */ -1,
        /* LDC2_W_QUICK */ -1,
        /* GETFIELD_QUICK */ -1,
        /* PUTFIELD_QUICK */ -1,
        /* GETFIELD2_QUICK */ -1,
        /* PUTFIELD2_QUICK */ -1,
        /* GETSTATIC_QUICK */ -1,
        /* PUTSTATIC_QUICK */ -1,
        /* GETSTATIC2_QUICK */ -1,
        /* PUTSTATIC2_QUICK */ -1,
        /* INVOKEVIRTUAL_QUICK */ -1,
        /* INVOKENONVIRTUAL_QUICK */ -1,
        /* INVOKESUPER_QUICK */ -1,
        /* INVOKESTATIC_QUICK */ -1,
        /* INVOKEINTERFACE_QUICK */ -1,
        /* INVOKEVIRTUALOBJECT_QUICK */ -1,
        /* XXXUNUSEDXXX */ -1,
        /* NEW_QUICK */ -1,
        /* ANEWARRAY_QUICK */ -1,
        /* MULTIANEWARRAY_QUICK */ -1,
        /* CHECKCAST_QUICK */ -1,
        /* INSTANCEOF_QUICK */ -1,
        /* INVOKEVIRTUAL_QUICK_W */ -1,
        /* GETFIELD_QUICK_W */ -1,
        /* PUTFIELD_QUICK_W */ -1,
        /* XXXUNUSEDXXX */ 0,
         /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* IMPDEP1 */ 0,
        /* IMPDEP2 */ 0
        };

        /**
         *  The effect on the operand stack of a given opcode.
         */
        static final byte[] stackChange = {    
        /* NOP */ 0,
        /* ACONST_NULL */ 1,
        /* ICONST_M1 */ 1,
        /* ICONST_0 */ 1,
        /* ICONST_1 */ 1,
        /* ICONST_2 */ 1,
        /* ICONST_3 */ 1,
        /* ICONST_4 */ 1,
        /* ICONST_5 */ 1,
        /* LCONST_0 */ 2,
        /* LCONST_1 */ 2,
        /* FCONST_0 */ 1,
        /* FCONST_1 */ 1,
        /* FCONST_2 */ 1,
        /* DCONST_0 */ 2,
        /* DCONST_1 */ 2,
        /* BIPUSH */ 1,
        /* SIPUSH */ 1,
        /* LDC */ 1,
        /* LDC_W */ 1,
        /* LDC2_W */ 2,
        /* ILOAD */ 1,
        /* LLOAD */ 2,
        /* FLOAD */ 1,
        /* DLOAD */ 2,
        /* ALOAD */ 1,
        /* ILOAD_0 */ 1,
        /* ILOAD_1 */ 1,
        /* ILOAD_2 */ 1,
        /* ILOAD_3 */ 1,
        /* LLOAD_0 */ 2,
        /* LLOAD_1 */ 2,
        /* LLOAD_2 */ 2,
        /* LLOAD_3 */ 2,
        /* FLOAD_0 */ 1,
        /* FLOAD_1 */ 1,
        /* FLOAD_2 */ 1,
        /* FLOAD_3 */ 1,
        /* DLOAD_0 */ 2,
        /* DLOAD_1 */ 2,
        /* DLOAD_2 */ 2,
        /* DLOAD_3 */ 2,
        /* ALOAD_0 */ 1,
        /* ALOAD_1 */ 1,
        /* ALOAD_2 */ 1,
        /* ALOAD_3 */ 1,
        /* IALOAD */ -1,
        /* LALOAD */ 0,
        /* FALOAD */ -1,
        /* DALOAD */ 0,
        /* AALOAD */ -1,
        /* BALOAD */ -1,
        /* CALOAD */ -1,
        /* SALOAD */ -1,
        /* ISTORE */ -1,
        /* LSTORE */ -2,
        /* FSTORE */ -1,
        /* DSTORE */ -2,
        /* ASTORE */ -1,
        /* ISTORE_0 */ -1,
        /* ISTORE_1 */ -1,
        /* ISTORE_2 */ -1,
        /* ISTORE_3 */ -1,
        /* LSTORE_0 */ -2,
        /* LSTORE_1 */ -2,
        /* LSTORE_2 */ -2,
        /* LSTORE_3 */ -2,
        /* FSTORE_0 */ -1,
        /* FSTORE_1 */ -1,
        /* FSTORE_2 */ -1,
        /* FSTORE_3 */ -1,
        /* DSTORE_0 */ -2,
        /* DSTORE_1 */ -2,
        /* DSTORE_2 */ -2,
        /* DSTORE_3 */ -2,
        /* ASTORE_0 */ -1,
        /* ASTORE_1 */ -1,
        /* ASTORE_2 */ -1,
        /* ASTORE_3 */ -1,
        /* IASTORE */ -3,
        /* LASTORE */ -4,
        /* FASTORE */ -3,
        /* DASTORE */ -4,
        /* AASTORE */ -3,
        /* BASTORE */ -3,
        /* CASTORE */ -3,
        /* SASTORE */ -3,
        /* POP */ -1,
        /* POP2 */ -2,
        /* DUP */ 1,
        /* DUP_X1 */ 1,
        /* DUP_X2 */ 1,
        /* DUP2 */ 2,
        /* DUP2_X1 */ 2,
        /* DUP2_X2 */ 2,
        /* SWAP */ 0,
        /* IADD */ -1,
        /* LADD */ -2,
        /* FADD */ -1,
        /* DADD */ -2,
        /* ISUB */ -1,
        /* LSUB */ -2,
        /* FSUB */ -1,
        /* DSUB */ -2,
        /* IMUL */ -1,
        /* LMUL */ -2,
        /* FMUL */ -1,
        /* DMUL */ -2,
        /* IDIV */ -1,
        /* LDIV */ -2,
        /* FDIV */ -1,
        /* DDIV */ -2,
        /* IREM */ -1,
        /* LREM */ -2,
        /* FREM */ -1,
        /* DREM */ -2,
        /* INEG */ 0,
        /* LNEG */ 0,
        /* FNEG */ 0,
        /* DNEG */ 0,
        /* ISHL */ -1,
        /* LSHL */ -1,
        /* ISHR */ -1,
        /* LSHR */ -1,
        /* IUSHR */ -1,
        /* LUSHR */ -1,
        /* IAND */ -1,
        /* LAND */ -2,
        /* IOR */ -1,
        /* LOR */ -2,
        /* IXOR */ -1,
        /* LXOR */ -2,
        /* IINC */ 0,
        /* I2L */ 1,
        /* I2F */ 0,
        /* I2D */ 1,
        /* L2I */ -1,
        /* L2F */ -1,
        /* L2D */ 0,
        /* F2I */ 0,
        /* F2L */ 1,
        /* F2D */ 1,
        /* D2I */ -1,
        /* D2L */ 0,
        /* D2F */ -1,
        /* I2B */ 0,
        /* I2C */ 0,
        /* I2S */ 0,
        /* LCMP */ -3,
        /* FCMPL */ -1,
        /* FCMPG */ -1,
        /* DCMPL */ -3,
        /* DCMPG */ -3,
        /* IFEQ */ -1,
        /* IFNE */ -1,
        /* IFLT */ -1,
        /* IFGE */ -1,
        /* IFGT */ -1,
        /* IFLE */ -1,
        /* IF_ICMPEQ */ -2,
        /* IF_ICMPNE */ -2,
        /* IF_ICMPLT */ -2,
        /* IF_ICMPGE */ -2,
        /* IF_ICMPGT */ -2,
        /* IF_ICMPLE */ -2,
        /* IF_ACMPEQ */ -2,
        /* IF_ACMPNE */ -2,
        /* GOTO */ 0,
        /* JSR */ 1,
        /* RET */ 0,
        /* TABLESWITCH */ -1,
        /* LOOKUPSWITCH */ -1,
        /* IRETURN */ -1,
        /* LRETURN */ -2,
        /* FRETURN */ -1,
        /* DRETURN */ -2,
        /* ARETURN */ -1,
        /* RETURN */ 0,
        /* GETSTATIC */ 0,
        /* PUTSTATIC */ 0,
        /* GETFIELD */ -1,
        /* PUTFIELD */ -1,
        /* INVOKEVIRTUAL */ -1,         // pops 'this' (unless static)
        /* INVOKESPECIAL */ -1,         // but needs to account for
        /* INVOKESTATIC */ 0,           // parameters and return type
        /* INVOKEINTERFACE */ -1,       //
        /* XXXUNUSEDXXX */ 0,
        /* NEW */ 1,
        /* NEWARRAY */ 0,
        /* ANEWARRAY */ 0,
        /* ARRAYLENGTH */ 0,
        /* ATHROW */ -1,
        /* CHECKCAST */ 0,
        /* INSTANCEOF */ 0,
        /* MONITORENTER */ -1,
        /* MONITOREXIT */ -1,
        /* WIDE */ 0,
        /* MULTIANEWARRAY */ 1,
        /* IFNULL */ -1,
        /* IFNONNULL */ -1,
        /* GOTO_W */ 0,
        /* JSR_W */ 1,
        /* BREAKPOINT */ 0,
        /* LDC_QUICK */ 1,
        /* LDC_W_QUICK */ 1,
        /* LDC2_W_QUICK */ 2,
        /* GETFIELD_QUICK */ 0,
        /* PUTFIELD_QUICK */ 0,
        /* GETFIELD2_QUICK */ 0,
        /* PUTFIELD2_QUICK */ 0,
        /* GETSTATIC_QUICK */ 0,
        /* PUTSTATIC_QUICK */ 0,
        /* GETSTATIC2_QUICK */ 0,
        /* PUTSTATIC2_QUICK */ 0,
        /* INVOKEVIRTUAL_QUICK */ 0,
        /* INVOKENONVIRTUAL_QUICK */ 0,
        /* INVOKESUPER_QUICK */ 0,
        /* INVOKESTATIC_QUICK */ 0,
        /* INVOKEINTERFACE_QUICK */ 0,
        /* INVOKEVIRTUALOBJECT_QUICK */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* NEW_QUICK */ 1,
        /* ANEWARRAY_QUICK */ 1,
        /* MULTIANEWARRAY_QUICK */ 1,
        /* CHECKCAST_QUICK */ -1,
        /* INSTANCEOF_QUICK */ 0,
        /* INVOKEVIRTUAL_QUICK_W */ 0,
        /* GETFIELD_QUICK_W */ 0,
        /* PUTFIELD_QUICK_W */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* XXXUNUSEDXXX */ 0,
        /* IMPDEP1 */ 0,
        /* IMPDEP2 */ 0
        };
}
