Debian Codegraph @

src/main/java/org/jboss/classfilewriter/code/Opcode.java

raw
1 /*
2 * JBoss, Home of Professional Open Source.
3 *
4 * Copyright 2012 Red Hat, Inc.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18 package org.jboss.classfilewriter.code;
19
20 /**
21 * JVM Instruction Set.
22 *
23 * <p>
24 * This interface defines opcodes and array types for the NEWARRAY instruction.
25 * <p>
26 * This has been shamelessly borrowed from javassist
27 *
28 */
29 public interface Opcode {
30 /* Opcodes */
31
32 int AALOAD = 50;
33 int AASTORE = 83;
34 int ACONST_NULL = 1;
35 int ALOAD = 25;
36 int ALOAD_0 = 42;
37 int ALOAD_1 = 43;
38 int ALOAD_2 = 44;
39 int ALOAD_3 = 45;
40 int ANEWARRAY = 189;
41 int ARETURN = 176;
42 int ARRAYLENGTH = 190;
43 int ASTORE = 58;
44 int ASTORE_0 = 75;
45 int ASTORE_1 = 76;
46 int ASTORE_2 = 77;
47 int ASTORE_3 = 78;
48 int ATHROW = 191;
49 int BALOAD = 51;
50 int BASTORE = 84;
51 int BIPUSH = 16;
52 int CALOAD = 52;
53 int CASTORE = 85;
54 int CHECKCAST = 192;
55 int D2F = 144;
56 int D2I = 142;
57 int D2L = 143;
58 int DADD = 99;
59 int DALOAD = 49;
60 int DASTORE = 82;
61 int DCMPG = 152;
62 int DCMPL = 151;
63 int DCONST_0 = 14;
64 int DCONST_1 = 15;
65 int DDIV = 111;
66 int DLOAD = 24;
67 int DLOAD_0 = 38;
68 int DLOAD_1 = 39;
69 int DLOAD_2 = 40;
70 int DLOAD_3 = 41;
71 int DMUL = 107;
72 int DNEG = 119;
73 int DREM = 115;
74 int DRETURN = 175;
75 int DSTORE = 57;
76 int DSTORE_0 = 71;
77 int DSTORE_1 = 72;
78 int DSTORE_2 = 73;
79 int DSTORE_3 = 74;
80 int DSUB = 103;
81 int DUP = 89;
82 int DUP2 = 92;
83 int DUP2_X1 = 93;
84 int DUP2_X2 = 94;
85 int DUP_X1 = 90;
86 int DUP_X2 = 91;
87 int F2D = 141;
88 int F2I = 139;
89 int F2L = 140;
90 int FADD = 98;
91 int FALOAD = 48;
92 int FASTORE = 81;
93 int FCMPG = 150;
94 int FCMPL = 149;
95 int FCONST_0 = 11;
96 int FCONST_1 = 12;
97 int FCONST_2 = 13;
98 int FDIV = 110;
99 int FLOAD = 23;
100 int FLOAD_0 = 34;
101 int FLOAD_1 = 35;
102 int FLOAD_2 = 36;
103 int FLOAD_3 = 37;
104 int FMUL = 106;
105 int FNEG = 118;
106 int FREM = 114;
107 int FRETURN = 174;
108 int FSTORE = 56;
109 int FSTORE_0 = 67;
110 int FSTORE_1 = 68;
111 int FSTORE_2 = 69;
112 int FSTORE_3 = 70;
113 int FSUB = 102;
114 int GETFIELD = 180;
115 int GETSTATIC = 178;
116 int GOTO = 167;
117 int GOTO_W = 200;
118 int I2B = 145;
119 int I2C = 146;
120 int I2D = 135;
121 int I2F = 134;
122 int I2L = 133;
123 int I2S = 147;
124 int IADD = 96;
125 int IALOAD = 46;
126 int IAND = 126;
127 int IASTORE = 79;
128 int ICONST_0 = 3;
129 int ICONST_1 = 4;
130 int ICONST_2 = 5;
131 int ICONST_3 = 6;
132 int ICONST_4 = 7;
133 int ICONST_5 = 8;
134 int ICONST_M1 = 2;
135 int IDIV = 108;
136 int IFEQ = 153;
137 int IFGE = 156;
138 int IFGT = 157;
139 int IFLE = 158;
140 int IFLT = 155;
141 int IFNE = 154;
142 int IFNONNULL = 199;
143 int IFNULL = 198;
144 int IF_ACMPEQ = 165;
145 int IF_ACMPNE = 166;
146 int IF_ICMPEQ = 159;
147 int IF_ICMPGE = 162;
148 int IF_ICMPGT = 163;
149 int IF_ICMPLE = 164;
150 int IF_ICMPLT = 161;
151 int IF_ICMPNE = 160;
152 int IINC = 132;
153 int ILOAD = 21;
154 int ILOAD_0 = 26;
155 int ILOAD_1 = 27;
156 int ILOAD_2 = 28;
157 int ILOAD_3 = 29;
158 int IMUL = 104;
159 int INEG = 116;
160 int INSTANCEOF = 193;
161 int INVOKEINTERFACE = 185;
162 int INVOKESPECIAL = 183;
163 int INVOKESTATIC = 184;
164 int INVOKEVIRTUAL = 182;
165 int IOR = 128;
166 int IREM = 112;
167 int IRETURN = 172;
168 int ISHL = 120;
169 int ISHR = 122;
170 int ISTORE = 54;
171 int ISTORE_0 = 59;
172 int ISTORE_1 = 60;
173 int ISTORE_2 = 61;
174 int ISTORE_3 = 62;
175 int ISUB = 100;
176 int IUSHR = 124;
177 int IXOR = 130;
178 int JSR = 168;
179 int JSR_W = 201;
180 int L2D = 138;
181 int L2F = 137;
182 int L2I = 136;
183 int LADD = 97;
184 int LALOAD = 47;
185 int LAND = 127;
186 int LASTORE = 80;
187 int LCMP = 148;
188 int LCONST_0 = 9;
189 int LCONST_1 = 10;
190 int LDC = 18;
191 int LDC2_W = 20;
192 int LDC_W = 19;
193 int LDIV = 109;
194 int LLOAD = 22;
195 int LLOAD_0 = 30;
196 int LLOAD_1 = 31;
197 int LLOAD_2 = 32;
198 int LLOAD_3 = 33;
199 int LMUL = 105;
200 int LNEG = 117;
201 int LOOKUPSWITCH = 171;
202 int LOR = 129;
203 int LREM = 113;
204 int LRETURN = 173;
205 int LSHL = 121;
206 int LSHR = 123;
207 int LSTORE = 55;
208 int LSTORE_0 = 63;
209 int LSTORE_1 = 64;
210 int LSTORE_2 = 65;
211 int LSTORE_3 = 66;
212 int LSUB = 101;
213 int LUSHR = 125;
214 int LXOR = 131;
215 int MONITORENTER = 194;
216 int MONITOREXIT = 195;
217 int MULTIANEWARRAY = 197;
218 int NEW = 187;
219 int NEWARRAY = 188;
220 int NOP = 0;
221 int POP = 87;
222 int POP2 = 88;
223 int PUTFIELD = 181;
224 int PUTSTATIC = 179;
225 int RET = 169;
226 int RETURN = 177;
227 int SALOAD = 53;
228 int SASTORE = 86;
229 int SIPUSH = 17;
230 int SWAP = 95;
231 int TABLESWITCH = 170;
232 int WIDE = 196;
233
234 /* array-type code for the newarray instruction */
235
236 int T_BOOLEAN = 4;
237 int T_CHAR = 5;
238 int T_FLOAT = 6;
239 int T_DOUBLE = 7;
240 int T_BYTE = 8;
241 int T_SHORT = 9;
242 int T_INT = 10;
243 int T_LONG = 11;
244
245 /* how many values are pushed on the operand stack. */
246 int[] STACK_GROW = { 0, // nop, 0
247 1, // aconst_null, 1
248 1, // iconst_m1, 2
249 1, // iconst_0, 3
250 1, // iconst_1, 4
251 1, // iconst_2, 5
252 1, // iconst_3, 6
253 1, // iconst_4, 7
254 1, // iconst_5, 8
255 2, // lconst_0, 9
256 2, // lconst_1, 10
257 1, // fconst_0, 11
258 1, // fconst_1, 12
259 1, // fconst_2, 13
260 2, // dconst_0, 14
261 2, // dconst_1, 15
262 1, // bipush, 16
263 1, // sipush, 17
264 1, // ldc, 18
265 1, // ldc_w, 19
266 2, // ldc2_w, 20
267 1, // iload, 21
268 2, // lload, 22
269 1, // fload, 23
270 2, // dload, 24
271 1, // aload, 25
272 1, // iload_0, 26
273 1, // iload_1, 27
274 1, // iload_2, 28
275 1, // iload_3, 29
276 2, // lload_0, 30
277 2, // lload_1, 31
278 2, // lload_2, 32
279 2, // lload_3, 33
280 1, // fload_0, 34
281 1, // fload_1, 35
282 1, // fload_2, 36
283 1, // fload_3, 37
284 2, // dload_0, 38
285 2, // dload_1, 39
286 2, // dload_2, 40
287 2, // dload_3, 41
288 1, // aload_0, 42
289 1, // aload_1, 43
290 1, // aload_2, 44
291 1, // aload_3, 45
292 -1, // iaload, 46
293 0, // laload, 47
294 -1, // faload, 48
295 0, // daload, 49
296 -1, // aaload, 50
297 -1, // baload, 51
298 -1, // caload, 52
299 -1, // saload, 53
300 -1, // istore, 54
301 -2, // lstore, 55
302 -1, // fstore, 56
303 -2, // dstore, 57
304 -1, // astore, 58
305 -1, // istore_0, 59
306 -1, // istore_1, 60
307 -1, // istore_2, 61
308 -1, // istore_3, 62
309 -2, // lstore_0, 63
310 -2, // lstore_1, 64
311 -2, // lstore_2, 65
312 -2, // lstore_3, 66
313 -1, // fstore_0, 67
314 -1, // fstore_1, 68
315 -1, // fstore_2, 69
316 -1, // fstore_3, 70
317 -2, // dstore_0, 71
318 -2, // dstore_1, 72
319 -2, // dstore_2, 73
320 -2, // dstore_3, 74
321 -1, // astore_0, 75
322 -1, // astore_1, 76
323 -1, // astore_2, 77
324 -1, // astore_3, 78
325 -3, // iastore, 79
326 -4, // lastore, 80
327 -3, // fastore, 81
328 -4, // dastore, 82
329 -3, // aastore, 83
330 -3, // bastore, 84
331 -3, // castore, 85
332 -3, // sastore, 86
333 -1, // pop, 87
334 -2, // pop2, 88
335 1, // dup, 89
336 1, // dup_x1, 90
337 1, // dup_x2, 91
338 2, // dup2, 92
339 2, // dup2_x1, 93
340 2, // dup2_x2, 94
341 0, // swap, 95
342 -1, // iadd, 96
343 -2, // ladd, 97
344 -1, // fadd, 98
345 -2, // dadd, 99
346 -1, // isub, 100
347 -2, // lsub, 101
348 -1, // fsub, 102
349 -2, // dsub, 103
350 -1, // imul, 104
351 -2, // lmul, 105
352 -1, // fmul, 106
353 -2, // dmul, 107
354 -1, // idiv, 108
355 -2, // ldiv, 109
356 -1, // fdiv, 110
357 -2, // ddiv, 111
358 -1, // irem, 112
359 -2, // lrem, 113
360 -1, // frem, 114
361 -2, // drem, 115
362 0, // ineg, 116
363 0, // lneg, 117
364 0, // fneg, 118
365 0, // dneg, 119
366 -1, // ishl, 120
367 -1, // lshl, 121
368 -1, // ishr, 122
369 -1, // lshr, 123
370 -1, // iushr, 124
371 -1, // lushr, 125
372 -1, // iand, 126
373 -2, // land, 127
374 -1, // ior, 128
375 -2, // lor, 129
376 -1, // ixor, 130
377 -2, // lxor, 131
378 0, // iinc, 132
379 1, // i2l, 133
380 0, // i2f, 134
381 1, // i2d, 135
382 -1, // l2i, 136
383 -1, // l2f, 137
384 0, // l2d, 138
385 0, // f2i, 139
386 1, // f2l, 140
387 1, // f2d, 141
388 -1, // d2i, 142
389 0, // d2l, 143
390 -1, // d2f, 144
391 0, // i2b, 145
392 0, // i2c, 146
393 0, // i2s, 147
394 -3, // lcmp, 148
395 -1, // fcmpl, 149
396 -1, // fcmpg, 150
397 -3, // dcmpl, 151
398 -3, // dcmpg, 152
399 -1, // ifeq, 153
400 -1, // ifne, 154
401 -1, // iflt, 155
402 -1, // ifge, 156
403 -1, // ifgt, 157
404 -1, // ifle, 158
405 -2, // if_icmpeq, 159
406 -2, // if_icmpne, 160
407 -2, // if_icmplt, 161
408 -2, // if_icmpge, 162
409 -2, // if_icmpgt, 163
410 -2, // if_icmple, 164
411 -2, // if_acmpeq, 165
412 -2, // if_acmpne, 166
413 0, // goto, 167
414 1, // jsr, 168
415 0, // ret, 169
416 -1, // tableswitch, 170
417 -1, // lookupswitch, 171
418 -1, // ireturn, 172
419 -2, // lreturn, 173
420 -1, // freturn, 174
421 -2, // dreturn, 175
422 -1, // areturn, 176
423 0, // return, 177
424 0, // getstatic, 178 depends on the type
425 0, // putstatic, 179 depends on the type
426 0, // getfield, 180 depends on the type
427 0, // putfield, 181 depends on the type
428 0, // invokevirtual, 182 depends on the type
429 0, // invokespecial, 183 depends on the type
430 0, // invokestatic, 184 depends on the type
431 0, // invokeinterface, 185 depends on the type
432 0, // undefined, 186
433 1, // new, 187
434 0, // newarray, 188
435 0, // anewarray, 189
436 0, // arraylength, 190
437 -1, // athrow, 191 stack is cleared
438 0, // checkcast, 192
439 0, // instanceof, 193
440 -1, // monitorenter, 194
441 -1, // monitorexit, 195
442 0, // wide, 196 depends on the following opcode
443 0, // multianewarray, 197 depends on the dimensions
444 -1, // ifnull, 198
445 -1, // ifnonnull, 199
446 0, // goto_w, 200
447 1 // jsr_w, 201
448 };
449 }