1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.bcel.generic;
21
22 import org.apache.bcel.Const;
23
24
25
26
27
28
29
30
31
32
33
34
35 public final class InstructionConst {
36
37
38
39
40
41
42 public static final Instruction NOP = new NOP();
43
44
45 public static final Instruction ACONST_NULL = new ACONST_NULL();
46
47
48 public static final Instruction ICONST_M1 = new ICONST(-1);
49
50
51 public static final Instruction ICONST_0 = new ICONST(0);
52
53
54 public static final Instruction ICONST_1 = new ICONST(1);
55
56
57 public static final Instruction ICONST_2 = new ICONST(2);
58
59
60 public static final Instruction ICONST_3 = new ICONST(3);
61
62
63 public static final Instruction ICONST_4 = new ICONST(4);
64
65
66 public static final Instruction ICONST_5 = new ICONST(5);
67
68
69 public static final Instruction LCONST_0 = new LCONST(0);
70
71
72 public static final Instruction LCONST_1 = new LCONST(1);
73
74
75 public static final Instruction FCONST_0 = new FCONST(0);
76
77
78 public static final Instruction FCONST_1 = new FCONST(1);
79
80
81 public static final Instruction FCONST_2 = new FCONST(2);
82
83
84 public static final Instruction DCONST_0 = new DCONST(0);
85
86
87 public static final Instruction DCONST_1 = new DCONST(1);
88
89
90 public static final ArrayInstruction IALOAD = new IALOAD();
91
92
93 public static final ArrayInstruction LALOAD = new LALOAD();
94
95
96 public static final ArrayInstruction FALOAD = new FALOAD();
97
98
99 public static final ArrayInstruction DALOAD = new DALOAD();
100
101
102 public static final ArrayInstruction AALOAD = new AALOAD();
103
104
105 public static final ArrayInstruction BALOAD = new BALOAD();
106
107
108 public static final ArrayInstruction CALOAD = new CALOAD();
109
110
111 public static final ArrayInstruction SALOAD = new SALOAD();
112
113
114 public static final ArrayInstruction IASTORE = new IASTORE();
115
116
117 public static final ArrayInstruction LASTORE = new LASTORE();
118
119
120 public static final ArrayInstruction FASTORE = new FASTORE();
121
122
123 public static final ArrayInstruction DASTORE = new DASTORE();
124
125
126 public static final ArrayInstruction AASTORE = new AASTORE();
127
128
129 public static final ArrayInstruction BASTORE = new BASTORE();
130
131
132 public static final ArrayInstruction CASTORE = new CASTORE();
133
134
135 public static final ArrayInstruction SASTORE = new SASTORE();
136
137
138 public static final StackInstruction POP = new POP();
139
140
141 public static final StackInstruction POP2 = new POP2();
142
143
144 public static final StackInstruction DUP = new DUP();
145
146
147 public static final StackInstruction DUP_X1 = new DUP_X1();
148
149
150 public static final StackInstruction DUP_X2 = new DUP_X2();
151
152
153 public static final StackInstruction DUP2 = new DUP2();
154
155
156 public static final StackInstruction DUP2_X1 = new DUP2_X1();
157
158
159 public static final StackInstruction DUP2_X2 = new DUP2_X2();
160
161
162 public static final StackInstruction SWAP = new SWAP();
163
164
165 public static final ArithmeticInstruction IADD = new IADD();
166
167
168 public static final ArithmeticInstruction LADD = new LADD();
169
170
171 public static final ArithmeticInstruction FADD = new FADD();
172
173
174 public static final ArithmeticInstruction DADD = new DADD();
175
176
177 public static final ArithmeticInstruction ISUB = new ISUB();
178
179
180 public static final ArithmeticInstruction LSUB = new LSUB();
181
182
183 public static final ArithmeticInstruction FSUB = new FSUB();
184
185
186 public static final ArithmeticInstruction DSUB = new DSUB();
187
188
189 public static final ArithmeticInstruction IMUL = new IMUL();
190
191
192 public static final ArithmeticInstruction LMUL = new LMUL();
193
194
195 public static final ArithmeticInstruction FMUL = new FMUL();
196
197
198 public static final ArithmeticInstruction DMUL = new DMUL();
199
200
201 public static final ArithmeticInstruction IDIV = new IDIV();
202
203
204 public static final ArithmeticInstruction LDIV = new LDIV();
205
206
207 public static final ArithmeticInstruction FDIV = new FDIV();
208
209
210 public static final ArithmeticInstruction DDIV = new DDIV();
211
212
213 public static final ArithmeticInstruction IREM = new IREM();
214
215
216 public static final ArithmeticInstruction LREM = new LREM();
217
218
219 public static final ArithmeticInstruction FREM = new FREM();
220
221
222 public static final ArithmeticInstruction DREM = new DREM();
223
224
225 public static final ArithmeticInstruction INEG = new INEG();
226
227
228 public static final ArithmeticInstruction LNEG = new LNEG();
229
230
231 public static final ArithmeticInstruction FNEG = new FNEG();
232
233
234 public static final ArithmeticInstruction DNEG = new DNEG();
235
236
237 public static final ArithmeticInstruction ISHL = new ISHL();
238
239
240 public static final ArithmeticInstruction LSHL = new LSHL();
241
242
243 public static final ArithmeticInstruction ISHR = new ISHR();
244
245
246 public static final ArithmeticInstruction LSHR = new LSHR();
247
248
249 public static final ArithmeticInstruction IUSHR = new IUSHR();
250
251
252 public static final ArithmeticInstruction LUSHR = new LUSHR();
253
254
255 public static final ArithmeticInstruction IAND = new IAND();
256
257
258 public static final ArithmeticInstruction LAND = new LAND();
259
260
261 public static final ArithmeticInstruction IOR = new IOR();
262
263
264 public static final ArithmeticInstruction LOR = new LOR();
265
266
267 public static final ArithmeticInstruction IXOR = new IXOR();
268
269
270 public static final ArithmeticInstruction LXOR = new LXOR();
271
272
273 public static final ConversionInstruction I2L = new I2L();
274
275
276 public static final ConversionInstruction I2F = new I2F();
277
278
279 public static final ConversionInstruction I2D = new I2D();
280
281
282 public static final ConversionInstruction L2I = new L2I();
283
284
285 public static final ConversionInstruction L2F = new L2F();
286
287
288 public static final ConversionInstruction L2D = new L2D();
289
290
291 public static final ConversionInstruction F2I = new F2I();
292
293
294 public static final ConversionInstruction F2L = new F2L();
295
296
297 public static final ConversionInstruction F2D = new F2D();
298
299
300 public static final ConversionInstruction D2I = new D2I();
301
302
303 public static final ConversionInstruction D2L = new D2L();
304
305
306 public static final ConversionInstruction D2F = new D2F();
307
308
309 public static final ConversionInstruction I2B = new I2B();
310
311
312 public static final ConversionInstruction I2C = new I2C();
313
314
315 public static final ConversionInstruction I2S = new I2S();
316
317
318 public static final Instruction LCMP = new LCMP();
319
320
321 public static final Instruction FCMPL = new FCMPL();
322
323
324 public static final Instruction FCMPG = new FCMPG();
325
326
327 public static final Instruction DCMPL = new DCMPL();
328
329
330 public static final Instruction DCMPG = new DCMPG();
331
332
333 public static final ReturnInstruction IRETURN = new IRETURN();
334
335
336 public static final ReturnInstruction LRETURN = new LRETURN();
337
338
339 public static final ReturnInstruction FRETURN = new FRETURN();
340
341
342 public static final ReturnInstruction DRETURN = new DRETURN();
343
344
345 public static final ReturnInstruction ARETURN = new ARETURN();
346
347
348 public static final ReturnInstruction RETURN = new RETURN();
349
350
351 public static final Instruction ARRAYLENGTH = new ARRAYLENGTH();
352
353
354 public static final Instruction ATHROW = new ATHROW();
355
356
357 public static final Instruction MONITORENTER = new MONITORENTER();
358
359
360 public static final Instruction MONITOREXIT = new MONITOREXIT();
361
362
363
364
365
366 public static final LocalVariableInstruction THIS = new ALOAD(0);
367
368
369 public static final LocalVariableInstruction ALOAD_0 = THIS;
370
371
372 public static final LocalVariableInstruction ALOAD_1 = new ALOAD(1);
373
374
375 public static final LocalVariableInstruction ALOAD_2 = new ALOAD(2);
376
377
378 public static final LocalVariableInstruction ILOAD_0 = new ILOAD(0);
379
380
381 public static final LocalVariableInstruction ILOAD_1 = new ILOAD(1);
382
383
384 public static final LocalVariableInstruction ILOAD_2 = new ILOAD(2);
385
386
387 public static final LocalVariableInstruction ASTORE_0 = new ASTORE(0);
388
389
390 public static final LocalVariableInstruction ASTORE_1 = new ASTORE(1);
391
392
393 public static final LocalVariableInstruction ASTORE_2 = new ASTORE(2);
394
395
396 public static final LocalVariableInstruction ISTORE_0 = new ISTORE(0);
397
398
399 public static final LocalVariableInstruction ISTORE_1 = new ISTORE(1);
400
401
402 public static final LocalVariableInstruction ISTORE_2 = new ISTORE(2);
403
404
405
406
407 static final Instruction[] INSTRUCTIONS = new Instruction[256];
408
409 static {
410 INSTRUCTIONS[Const.NOP] = NOP;
411 INSTRUCTIONS[Const.ACONST_NULL] = ACONST_NULL;
412 INSTRUCTIONS[Const.ICONST_M1] = ICONST_M1;
413 INSTRUCTIONS[Const.ICONST_0] = ICONST_0;
414 INSTRUCTIONS[Const.ICONST_1] = ICONST_1;
415 INSTRUCTIONS[Const.ICONST_2] = ICONST_2;
416 INSTRUCTIONS[Const.ICONST_3] = ICONST_3;
417 INSTRUCTIONS[Const.ICONST_4] = ICONST_4;
418 INSTRUCTIONS[Const.ICONST_5] = ICONST_5;
419 INSTRUCTIONS[Const.LCONST_0] = LCONST_0;
420 INSTRUCTIONS[Const.LCONST_1] = LCONST_1;
421 INSTRUCTIONS[Const.FCONST_0] = FCONST_0;
422 INSTRUCTIONS[Const.FCONST_1] = FCONST_1;
423 INSTRUCTIONS[Const.FCONST_2] = FCONST_2;
424 INSTRUCTIONS[Const.DCONST_0] = DCONST_0;
425 INSTRUCTIONS[Const.DCONST_1] = DCONST_1;
426 INSTRUCTIONS[Const.IALOAD] = IALOAD;
427 INSTRUCTIONS[Const.LALOAD] = LALOAD;
428 INSTRUCTIONS[Const.FALOAD] = FALOAD;
429 INSTRUCTIONS[Const.DALOAD] = DALOAD;
430 INSTRUCTIONS[Const.AALOAD] = AALOAD;
431 INSTRUCTIONS[Const.BALOAD] = BALOAD;
432 INSTRUCTIONS[Const.CALOAD] = CALOAD;
433 INSTRUCTIONS[Const.SALOAD] = SALOAD;
434 INSTRUCTIONS[Const.IASTORE] = IASTORE;
435 INSTRUCTIONS[Const.LASTORE] = LASTORE;
436 INSTRUCTIONS[Const.FASTORE] = FASTORE;
437 INSTRUCTIONS[Const.DASTORE] = DASTORE;
438 INSTRUCTIONS[Const.AASTORE] = AASTORE;
439 INSTRUCTIONS[Const.BASTORE] = BASTORE;
440 INSTRUCTIONS[Const.CASTORE] = CASTORE;
441 INSTRUCTIONS[Const.SASTORE] = SASTORE;
442 INSTRUCTIONS[Const.POP] = POP;
443 INSTRUCTIONS[Const.POP2] = POP2;
444 INSTRUCTIONS[Const.DUP] = DUP;
445 INSTRUCTIONS[Const.DUP_X1] = DUP_X1;
446 INSTRUCTIONS[Const.DUP_X2] = DUP_X2;
447 INSTRUCTIONS[Const.DUP2] = DUP2;
448 INSTRUCTIONS[Const.DUP2_X1] = DUP2_X1;
449 INSTRUCTIONS[Const.DUP2_X2] = DUP2_X2;
450 INSTRUCTIONS[Const.SWAP] = SWAP;
451 INSTRUCTIONS[Const.IADD] = IADD;
452 INSTRUCTIONS[Const.LADD] = LADD;
453 INSTRUCTIONS[Const.FADD] = FADD;
454 INSTRUCTIONS[Const.DADD] = DADD;
455 INSTRUCTIONS[Const.ISUB] = ISUB;
456 INSTRUCTIONS[Const.LSUB] = LSUB;
457 INSTRUCTIONS[Const.FSUB] = FSUB;
458 INSTRUCTIONS[Const.DSUB] = DSUB;
459 INSTRUCTIONS[Const.IMUL] = IMUL;
460 INSTRUCTIONS[Const.LMUL] = LMUL;
461 INSTRUCTIONS[Const.FMUL] = FMUL;
462 INSTRUCTIONS[Const.DMUL] = DMUL;
463 INSTRUCTIONS[Const.IDIV] = IDIV;
464 INSTRUCTIONS[Const.LDIV] = LDIV;
465 INSTRUCTIONS[Const.FDIV] = FDIV;
466 INSTRUCTIONS[Const.DDIV] = DDIV;
467 INSTRUCTIONS[Const.IREM] = IREM;
468 INSTRUCTIONS[Const.LREM] = LREM;
469 INSTRUCTIONS[Const.FREM] = FREM;
470 INSTRUCTIONS[Const.DREM] = DREM;
471 INSTRUCTIONS[Const.INEG] = INEG;
472 INSTRUCTIONS[Const.LNEG] = LNEG;
473 INSTRUCTIONS[Const.FNEG] = FNEG;
474 INSTRUCTIONS[Const.DNEG] = DNEG;
475 INSTRUCTIONS[Const.ISHL] = ISHL;
476 INSTRUCTIONS[Const.LSHL] = LSHL;
477 INSTRUCTIONS[Const.ISHR] = ISHR;
478 INSTRUCTIONS[Const.LSHR] = LSHR;
479 INSTRUCTIONS[Const.IUSHR] = IUSHR;
480 INSTRUCTIONS[Const.LUSHR] = LUSHR;
481 INSTRUCTIONS[Const.IAND] = IAND;
482 INSTRUCTIONS[Const.LAND] = LAND;
483 INSTRUCTIONS[Const.IOR] = IOR;
484 INSTRUCTIONS[Const.LOR] = LOR;
485 INSTRUCTIONS[Const.IXOR] = IXOR;
486 INSTRUCTIONS[Const.LXOR] = LXOR;
487 INSTRUCTIONS[Const.I2L] = I2L;
488 INSTRUCTIONS[Const.I2F] = I2F;
489 INSTRUCTIONS[Const.I2D] = I2D;
490 INSTRUCTIONS[Const.L2I] = L2I;
491 INSTRUCTIONS[Const.L2F] = L2F;
492 INSTRUCTIONS[Const.L2D] = L2D;
493 INSTRUCTIONS[Const.F2I] = F2I;
494 INSTRUCTIONS[Const.F2L] = F2L;
495 INSTRUCTIONS[Const.F2D] = F2D;
496 INSTRUCTIONS[Const.D2I] = D2I;
497 INSTRUCTIONS[Const.D2L] = D2L;
498 INSTRUCTIONS[Const.D2F] = D2F;
499 INSTRUCTIONS[Const.I2B] = I2B;
500 INSTRUCTIONS[Const.I2C] = I2C;
501 INSTRUCTIONS[Const.I2S] = I2S;
502 INSTRUCTIONS[Const.LCMP] = LCMP;
503 INSTRUCTIONS[Const.FCMPL] = FCMPL;
504 INSTRUCTIONS[Const.FCMPG] = FCMPG;
505 INSTRUCTIONS[Const.DCMPL] = DCMPL;
506 INSTRUCTIONS[Const.DCMPG] = DCMPG;
507 INSTRUCTIONS[Const.IRETURN] = IRETURN;
508 INSTRUCTIONS[Const.LRETURN] = LRETURN;
509 INSTRUCTIONS[Const.FRETURN] = FRETURN;
510 INSTRUCTIONS[Const.DRETURN] = DRETURN;
511 INSTRUCTIONS[Const.ARETURN] = ARETURN;
512 INSTRUCTIONS[Const.RETURN] = RETURN;
513 INSTRUCTIONS[Const.ARRAYLENGTH] = ARRAYLENGTH;
514 INSTRUCTIONS[Const.ATHROW] = ATHROW;
515 INSTRUCTIONS[Const.MONITORENTER] = MONITORENTER;
516 INSTRUCTIONS[Const.MONITOREXIT] = MONITOREXIT;
517 }
518
519
520
521
522
523
524
525 public static Instruction getInstruction(final int index) {
526 return INSTRUCTIONS[index];
527 }
528
529 private InstructionConst() {
530 }
531 }