001: /*
002:
003: Derby - Class org.apache.derby.iapi.services.classfile.VMOpcode
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to you under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.iapi.services.classfile;
023:
024: /**
025: * This contains all the opcodes for the JVM
026: * as defined in The Java Virtual Machine Specification.
027: *
028: * REMIND: might want a debugging version of this,
029: * that stored the stack depth and operand expectations.
030: */
031: public interface VMOpcode {
032: short BAD = -999; // used in mapping arrays to say "don't do that"
033: short NOP = 0;
034: short ACONST_NULL = 1;
035: short ICONST_M1 = 2;
036: short ICONST_0 = 3;
037: short ICONST_1 = 4;
038: short ICONST_2 = 5;
039: short ICONST_3 = 6;
040: short ICONST_4 = 7;
041: short ICONST_5 = 8;
042: short LCONST_0 = 9;
043: short LCONST_1 = 10;
044: short FCONST_0 = 11;
045: short FCONST_1 = 12;
046: short FCONST_2 = 13;
047: short DCONST_0 = 14;
048: short DCONST_1 = 15;
049: short BIPUSH = 16;
050: short SIPUSH = 17;
051: short LDC = 18;
052: short LDC_W = 19;
053: short LDC2_W = 20;
054: short ILOAD = 21;
055: short LLOAD = 22;
056: short FLOAD = 23;
057: short DLOAD = 24;
058: short ALOAD = 25;
059: short ILOAD_0 = 26;
060: short ILOAD_1 = 27;
061: short ILOAD_2 = 28;
062: short ILOAD_3 = 29;
063: short LLOAD_0 = 30;
064: short LLOAD_1 = 31;
065: short LLOAD_2 = 32;
066: short LLOAD_3 = 33;
067: short FLOAD_0 = 34;
068: short FLOAD_1 = 35;
069: short FLOAD_2 = 36;
070: short FLOAD_3 = 37;
071: short DLOAD_0 = 38;
072: short DLOAD_1 = 39;
073: short DLOAD_2 = 40;
074: short DLOAD_3 = 41;
075: short ALOAD_0 = 42;
076: short ALOAD_1 = 43;
077: short ALOAD_2 = 44;
078: short ALOAD_3 = 45;
079: short IALOAD = 46;
080: short LALOAD = 47;
081: short FALOAD = 48;
082: short DALOAD = 49;
083: short AALOAD = 50;
084: short BALOAD = 51;
085: short CALOAD = 52;
086: short SALOAD = 53;
087: short ISTORE = 54;
088: short LSTORE = 55;
089: short FSTORE = 56;
090: short DSTORE = 57;
091: short ASTORE = 58;
092: short ISTORE_0 = 59;
093: short ISTORE_1 = 60;
094: short ISTORE_2 = 61;
095: short ISTORE_3 = 62;
096: short LSTORE_0 = 63;
097: short LSTORE_1 = 64;
098: short LSTORE_2 = 65;
099: short LSTORE_3 = 66;
100: short FSTORE_0 = 67;
101: short FSTORE_1 = 68;
102: short FSTORE_2 = 69;
103: short FSTORE_3 = 70;
104: short DSTORE_0 = 71;
105: short DSTORE_1 = 72;
106: short DSTORE_2 = 73;
107: short DSTORE_3 = 74;
108: short ASTORE_0 = 75;
109: short ASTORE_1 = 76;
110: short ASTORE_2 = 77;
111: short ASTORE_3 = 78;
112: short IASTORE = 79;
113: short LASTORE = 80;
114: short FASTORE = 81;
115: short DASTORE = 82;
116: short AASTORE = 83;
117: short BASTORE = 84;
118: short CASTORE = 85;
119: short SASTORE = 86;
120: short POP = 87;
121: short POP2 = 88;
122: short DUP = 89;
123: short DUP_X1 = 90;
124: short DUP_X2 = 91;
125: short DUP2 = 92;
126: short DUP2_X1 = 93;
127: short DUP2_X2 = 94;
128: short SWAP = 95;
129: short IADD = 96;
130: short LADD = 97;
131: short FADD = 98;
132: short DADD = 99;
133: short ISUB = 100;
134: short LSUB = 101;
135: short FSUB = 102;
136: short DSUB = 103;
137: short IMUL = 104;
138: short LMUL = 105;
139: short FMUL = 106;
140: short DMUL = 107;
141: short IDIV = 108;
142: short LDIV = 109;
143: short FDIV = 110;
144: short DDIV = 111;
145: short IREM = 112;
146: short LREM = 113;
147: short FREM = 114;
148: short DREM = 115;
149: short INEG = 116;
150: short LNEG = 117;
151: short FNEG = 118;
152: short DNEG = 119;
153: short ISHL = 120;
154: short LSHL = 121;
155: short ISHR = 122;
156: short LSHR = 123;
157: short IUSHR = 124;
158: short LUSHR = 125;
159: short IAND = 126;
160: short LAND = 127;
161: short IOR = 128;
162: short LOR = 129;
163: short IXOR = 130;
164: short LXOR = 131;
165: short IINC = 132;
166: short I2L = 133;
167: short I2F = 134;
168: short I2D = 135;
169: short L2I = 136;
170: short L2F = 137;
171: short L2D = 138;
172: short F2I = 139;
173: short F2L = 140;
174: short F2D = 141;
175: short D2I = 142;
176: short D2L = 143;
177: short D2F = 144;
178: short I2B = 145;
179: short I2C = 146;
180: short I2S = 147;
181: short LCMP = 148;
182: short FCMPL = 149;
183: short FCMPG = 150;
184: short DCMPL = 151;
185: short DCMPG = 152;
186: short IFEQ = 153;
187: short IFNE = 154;
188: short IFLT = 155;
189: short IFGE = 156;
190: short IFGT = 157;
191: short IFLE = 158;
192: short IF_ICMPEQ = 159;
193: short IF_ICMPNE = 160;
194: short IF_ICMPLT = 161;
195: short IF_ICMPGE = 162;
196: short IF_ICMPGT = 163;
197: short IF_ICMPLE = 164;
198: short IF_ACMPEQ = 165;
199: short IF_ACMPNE = 166;
200: short GOTO = 167;
201: short JSR = 168;
202: short RET = 169;
203: short TABLESWITCH = 170;
204: short LOOKUPSWITCH = 171;
205: short IRETURN = 172;
206: short LRETURN = 173;
207: short FRETURN = 174;
208: short DRETURN = 175;
209: short ARETURN = 176;
210: short RETURN = 177;
211: short GETSTATIC = 178;
212: short PUTSTATIC = 179;
213: short GETFIELD = 180;
214: short PUTFIELD = 181;
215: short INVOKEVIRTUAL = 182;
216: short INVOKESPECIAL = 183;
217: short INVOKESTATIC = 184;
218: short INVOKEINTERFACE = 185;
219: short XXXUNUSEDXXX = 186;
220: short NEW = 187;
221: short NEWARRAY = 188;
222: short ANEWARRAY = 189;
223: short ARRAYLENGTH = 190;
224: short ATHROW = 191;
225: short CHECKCAST = 192;
226: short INSTANCEOF = 193;
227: short MONITORENTER = 194;
228: short MONITOREXIT = 195;
229: short WIDE = 196;
230: short MULTIANEWARRAY = 197;
231: short IFNULL = 198;
232: short IFNONNULL = 199;
233: short GOTO_W = 200;
234: short JSR_W = 201;
235: short BREAKPOINT = 202;
236:
237: /**
238: * Maximum code length in a single method.
239: * See section 4.10 of JVM spec version 1.
240: */
241: int MAX_CODE_LENGTH = 65535;
242:
243: /**
244: * Instruction length for IF (IFNULL, IFEQ) etc.
245: * Used in conditional handling.
246: */
247: int IF_INS_LENGTH = 3;
248:
249: /**
250: * Instruction length for GOTO etc.
251: * Used in conditional handling.
252: */
253: int GOTO_INS_LENGTH = 3;
254:
255: /**
256: * Instruction length for GOTO_W.
257: * Used in conditional handling.
258: */
259: int GOTO_W_INS_LENGTH = 5;
260:
261: /**
262: * Maximum number of entries in the constant pool.
263: * See section 4.10 of JVM spec version 1.
264: */
265: int MAX_CONSTANT_POOL_ENTRIES = 65535;
266:
267: }
|