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