1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.bcel.generic;
20
21 import org.apache.bcel.Const;
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 public final class InstructionConst {
37
38
39
40
41
42
43 public static final Instruction NOP = new NOP();
44 public static final Instruction ACONST_NULL = new ACONST_NULL();
45 public static final Instruction ICONST_M1 = new ICONST(-1);
46 public static final Instruction ICONST_0 = new ICONST(0);
47 public static final Instruction ICONST_1 = new ICONST(1);
48 public static final Instruction ICONST_2 = new ICONST(2);
49 public static final Instruction ICONST_3 = new ICONST(3);
50 public static final Instruction ICONST_4 = new ICONST(4);
51 public static final Instruction ICONST_5 = new ICONST(5);
52 public static final Instruction LCONST_0 = new LCONST(0);
53 public static final Instruction LCONST_1 = new LCONST(1);
54 public static final Instruction FCONST_0 = new FCONST(0);
55 public static final Instruction FCONST_1 = new FCONST(1);
56 public static final Instruction FCONST_2 = new FCONST(2);
57 public static final Instruction DCONST_0 = new DCONST(0);
58 public static final Instruction DCONST_1 = new DCONST(1);
59 public static final ArrayInstruction IALOAD = new IALOAD();
60 public static final ArrayInstruction LALOAD = new LALOAD();
61 public static final ArrayInstruction FALOAD = new FALOAD();
62 public static final ArrayInstruction DALOAD = new DALOAD();
63 public static final ArrayInstruction AALOAD = new AALOAD();
64 public static final ArrayInstruction BALOAD = new BALOAD();
65 public static final ArrayInstruction CALOAD = new CALOAD();
66 public static final ArrayInstruction SALOAD = new SALOAD();
67 public static final ArrayInstruction IASTORE = new IASTORE();
68 public static final ArrayInstruction LASTORE = new LASTORE();
69 public static final ArrayInstruction FASTORE = new FASTORE();
70 public static final ArrayInstruction DASTORE = new DASTORE();
71 public static final ArrayInstruction AASTORE = new AASTORE();
72 public static final ArrayInstruction BASTORE = new BASTORE();
73 public static final ArrayInstruction CASTORE = new CASTORE();
74 public static final ArrayInstruction SASTORE = new SASTORE();
75 public static final StackInstruction POP = new POP();
76 public static final StackInstruction POP2 = new POP2();
77 public static final StackInstruction DUP = new DUP();
78 public static final StackInstruction DUP_X1 = new DUP_X1();
79 public static final StackInstruction DUP_X2 = new DUP_X2();
80 public static final StackInstruction DUP2 = new DUP2();
81 public static final StackInstruction DUP2_X1 = new DUP2_X1();
82 public static final StackInstruction DUP2_X2 = new DUP2_X2();
83 public static final StackInstruction SWAP = new SWAP();
84 public static final ArithmeticInstruction IADD = new IADD();
85 public static final ArithmeticInstruction LADD = new LADD();
86 public static final ArithmeticInstruction FADD = new FADD();
87 public static final ArithmeticInstruction DADD = new DADD();
88 public static final ArithmeticInstruction ISUB = new ISUB();
89 public static final ArithmeticInstruction LSUB = new LSUB();
90 public static final ArithmeticInstruction FSUB = new FSUB();
91 public static final ArithmeticInstruction DSUB = new DSUB();
92 public static final ArithmeticInstruction IMUL = new IMUL();
93 public static final ArithmeticInstruction LMUL = new LMUL();
94 public static final ArithmeticInstruction FMUL = new FMUL();
95 public static final ArithmeticInstruction DMUL = new DMUL();
96 public static final ArithmeticInstruction IDIV = new IDIV();
97 public static final ArithmeticInstruction LDIV = new LDIV();
98 public static final ArithmeticInstruction FDIV = new FDIV();
99 public static final ArithmeticInstruction DDIV = new DDIV();
100 public static final ArithmeticInstruction IREM = new IREM();
101 public static final ArithmeticInstruction LREM = new LREM();
102 public static final ArithmeticInstruction FREM = new FREM();
103 public static final ArithmeticInstruction DREM = new DREM();
104 public static final ArithmeticInstruction INEG = new INEG();
105 public static final ArithmeticInstruction LNEG = new LNEG();
106 public static final ArithmeticInstruction FNEG = new FNEG();
107 public static final ArithmeticInstruction DNEG = new DNEG();
108 public static final ArithmeticInstruction ISHL = new ISHL();
109 public static final ArithmeticInstruction LSHL = new LSHL();
110 public static final ArithmeticInstruction ISHR = new ISHR();
111 public static final ArithmeticInstruction LSHR = new LSHR();
112 public static final ArithmeticInstruction IUSHR = new IUSHR();
113 public static final ArithmeticInstruction LUSHR = new LUSHR();
114 public static final ArithmeticInstruction IAND = new IAND();
115 public static final ArithmeticInstruction LAND = new LAND();
116 public static final ArithmeticInstruction IOR = new IOR();
117 public static final ArithmeticInstruction LOR = new LOR();
118 public static final ArithmeticInstruction IXOR = new IXOR();
119 public static final ArithmeticInstruction LXOR = new LXOR();
120 public static final ConversionInstruction I2L = new I2L();
121 public static final ConversionInstruction I2F = new I2F();
122 public static final ConversionInstruction I2D = new I2D();
123 public static final ConversionInstruction L2I = new L2I();
124 public static final ConversionInstruction L2F = new L2F();
125 public static final ConversionInstruction L2D = new L2D();
126 public static final ConversionInstruction F2I = new F2I();
127 public static final ConversionInstruction F2L = new F2L();
128 public static final ConversionInstruction F2D = new F2D();
129 public static final ConversionInstruction D2I = new D2I();
130 public static final ConversionInstruction D2L = new D2L();
131 public static final ConversionInstruction D2F = new D2F();
132 public static final ConversionInstruction I2B = new I2B();
133 public static final ConversionInstruction I2C = new I2C();
134 public static final ConversionInstruction I2S = new I2S();
135 public static final Instruction LCMP = new LCMP();
136 public static final Instruction FCMPL = new FCMPL();
137 public static final Instruction FCMPG = new FCMPG();
138 public static final Instruction DCMPL = new DCMPL();
139 public static final Instruction DCMPG = new DCMPG();
140 public static final ReturnInstruction IRETURN = new IRETURN();
141 public static final ReturnInstruction LRETURN = new LRETURN();
142 public static final ReturnInstruction FRETURN = new FRETURN();
143 public static final ReturnInstruction DRETURN = new DRETURN();
144 public static final ReturnInstruction ARETURN = new ARETURN();
145 public static final ReturnInstruction RETURN = new RETURN();
146 public static final Instruction ARRAYLENGTH = new ARRAYLENGTH();
147 public static final Instruction ATHROW = new ATHROW();
148 public static final Instruction MONITORENTER = new MONITORENTER();
149 public static final Instruction MONITOREXIT = new MONITOREXIT();
150
151
152
153
154
155 public static final LocalVariableInstruction THIS = new ALOAD(0);
156 public static final LocalVariableInstruction ALOAD_0 = THIS;
157 public static final LocalVariableInstruction ALOAD_1 = new ALOAD(1);
158 public static final LocalVariableInstruction ALOAD_2 = new ALOAD(2);
159 public static final LocalVariableInstruction ILOAD_0 = new ILOAD(0);
160 public static final LocalVariableInstruction ILOAD_1 = new ILOAD(1);
161 public static final LocalVariableInstruction ILOAD_2 = new ILOAD(2);
162 public static final LocalVariableInstruction ASTORE_0 = new ASTORE(0);
163 public static final LocalVariableInstruction ASTORE_1 = new ASTORE(1);
164 public static final LocalVariableInstruction ASTORE_2 = new ASTORE(2);
165 public static final LocalVariableInstruction ISTORE_0 = new ISTORE(0);
166 public static final LocalVariableInstruction ISTORE_1 = new ISTORE(1);
167 public static final LocalVariableInstruction ISTORE_2 = new ISTORE(2);
168
169
170
171
172 static final Instruction[] INSTRUCTIONS = new Instruction[256];
173
174 static {
175 INSTRUCTIONS[Const.NOP] = NOP;
176 INSTRUCTIONS[Const.ACONST_NULL] = ACONST_NULL;
177 INSTRUCTIONS[Const.ICONST_M1] = ICONST_M1;
178 INSTRUCTIONS[Const.ICONST_0] = ICONST_0;
179 INSTRUCTIONS[Const.ICONST_1] = ICONST_1;
180 INSTRUCTIONS[Const.ICONST_2] = ICONST_2;
181 INSTRUCTIONS[Const.ICONST_3] = ICONST_3;
182 INSTRUCTIONS[Const.ICONST_4] = ICONST_4;
183 INSTRUCTIONS[Const.ICONST_5] = ICONST_5;
184 INSTRUCTIONS[Const.LCONST_0] = LCONST_0;
185 INSTRUCTIONS[Const.LCONST_1] = LCONST_1;
186 INSTRUCTIONS[Const.FCONST_0] = FCONST_0;
187 INSTRUCTIONS[Const.FCONST_1] = FCONST_1;
188 INSTRUCTIONS[Const.FCONST_2] = FCONST_2;
189 INSTRUCTIONS[Const.DCONST_0] = DCONST_0;
190 INSTRUCTIONS[Const.DCONST_1] = DCONST_1;
191 INSTRUCTIONS[Const.IALOAD] = IALOAD;
192 INSTRUCTIONS[Const.LALOAD] = LALOAD;
193 INSTRUCTIONS[Const.FALOAD] = FALOAD;
194 INSTRUCTIONS[Const.DALOAD] = DALOAD;
195 INSTRUCTIONS[Const.AALOAD] = AALOAD;
196 INSTRUCTIONS[Const.BALOAD] = BALOAD;
197 INSTRUCTIONS[Const.CALOAD] = CALOAD;
198 INSTRUCTIONS[Const.SALOAD] = SALOAD;
199 INSTRUCTIONS[Const.IASTORE] = IASTORE;
200 INSTRUCTIONS[Const.LASTORE] = LASTORE;
201 INSTRUCTIONS[Const.FASTORE] = FASTORE;
202 INSTRUCTIONS[Const.DASTORE] = DASTORE;
203 INSTRUCTIONS[Const.AASTORE] = AASTORE;
204 INSTRUCTIONS[Const.BASTORE] = BASTORE;
205 INSTRUCTIONS[Const.CASTORE] = CASTORE;
206 INSTRUCTIONS[Const.SASTORE] = SASTORE;
207 INSTRUCTIONS[Const.POP] = POP;
208 INSTRUCTIONS[Const.POP2] = POP2;
209 INSTRUCTIONS[Const.DUP] = DUP;
210 INSTRUCTIONS[Const.DUP_X1] = DUP_X1;
211 INSTRUCTIONS[Const.DUP_X2] = DUP_X2;
212 INSTRUCTIONS[Const.DUP2] = DUP2;
213 INSTRUCTIONS[Const.DUP2_X1] = DUP2_X1;
214 INSTRUCTIONS[Const.DUP2_X2] = DUP2_X2;
215 INSTRUCTIONS[Const.SWAP] = SWAP;
216 INSTRUCTIONS[Const.IADD] = IADD;
217 INSTRUCTIONS[Const.LADD] = LADD;
218 INSTRUCTIONS[Const.FADD] = FADD;
219 INSTRUCTIONS[Const.DADD] = DADD;
220 INSTRUCTIONS[Const.ISUB] = ISUB;
221 INSTRUCTIONS[Const.LSUB] = LSUB;
222 INSTRUCTIONS[Const.FSUB] = FSUB;
223 INSTRUCTIONS[Const.DSUB] = DSUB;
224 INSTRUCTIONS[Const.IMUL] = IMUL;
225 INSTRUCTIONS[Const.LMUL] = LMUL;
226 INSTRUCTIONS[Const.FMUL] = FMUL;
227 INSTRUCTIONS[Const.DMUL] = DMUL;
228 INSTRUCTIONS[Const.IDIV] = IDIV;
229 INSTRUCTIONS[Const.LDIV] = LDIV;
230 INSTRUCTIONS[Const.FDIV] = FDIV;
231 INSTRUCTIONS[Const.DDIV] = DDIV;
232 INSTRUCTIONS[Const.IREM] = IREM;
233 INSTRUCTIONS[Const.LREM] = LREM;
234 INSTRUCTIONS[Const.FREM] = FREM;
235 INSTRUCTIONS[Const.DREM] = DREM;
236 INSTRUCTIONS[Const.INEG] = INEG;
237 INSTRUCTIONS[Const.LNEG] = LNEG;
238 INSTRUCTIONS[Const.FNEG] = FNEG;
239 INSTRUCTIONS[Const.DNEG] = DNEG;
240 INSTRUCTIONS[Const.ISHL] = ISHL;
241 INSTRUCTIONS[Const.LSHL] = LSHL;
242 INSTRUCTIONS[Const.ISHR] = ISHR;
243 INSTRUCTIONS[Const.LSHR] = LSHR;
244 INSTRUCTIONS[Const.IUSHR] = IUSHR;
245 INSTRUCTIONS[Const.LUSHR] = LUSHR;
246 INSTRUCTIONS[Const.IAND] = IAND;
247 INSTRUCTIONS[Const.LAND] = LAND;
248 INSTRUCTIONS[Const.IOR] = IOR;
249 INSTRUCTIONS[Const.LOR] = LOR;
250 INSTRUCTIONS[Const.IXOR] = IXOR;
251 INSTRUCTIONS[Const.LXOR] = LXOR;
252 INSTRUCTIONS[Const.I2L] = I2L;
253 INSTRUCTIONS[Const.I2F] = I2F;
254 INSTRUCTIONS[Const.I2D] = I2D;
255 INSTRUCTIONS[Const.L2I] = L2I;
256 INSTRUCTIONS[Const.L2F] = L2F;
257 INSTRUCTIONS[Const.L2D] = L2D;
258 INSTRUCTIONS[Const.F2I] = F2I;
259 INSTRUCTIONS[Const.F2L] = F2L;
260 INSTRUCTIONS[Const.F2D] = F2D;
261 INSTRUCTIONS[Const.D2I] = D2I;
262 INSTRUCTIONS[Const.D2L] = D2L;
263 INSTRUCTIONS[Const.D2F] = D2F;
264 INSTRUCTIONS[Const.I2B] = I2B;
265 INSTRUCTIONS[Const.I2C] = I2C;
266 INSTRUCTIONS[Const.I2S] = I2S;
267 INSTRUCTIONS[Const.LCMP] = LCMP;
268 INSTRUCTIONS[Const.FCMPL] = FCMPL;
269 INSTRUCTIONS[Const.FCMPG] = FCMPG;
270 INSTRUCTIONS[Const.DCMPL] = DCMPL;
271 INSTRUCTIONS[Const.DCMPG] = DCMPG;
272 INSTRUCTIONS[Const.IRETURN] = IRETURN;
273 INSTRUCTIONS[Const.LRETURN] = LRETURN;
274 INSTRUCTIONS[Const.FRETURN] = FRETURN;
275 INSTRUCTIONS[Const.DRETURN] = DRETURN;
276 INSTRUCTIONS[Const.ARETURN] = ARETURN;
277 INSTRUCTIONS[Const.RETURN] = RETURN;
278 INSTRUCTIONS[Const.ARRAYLENGTH] = ARRAYLENGTH;
279 INSTRUCTIONS[Const.ATHROW] = ATHROW;
280 INSTRUCTIONS[Const.MONITORENTER] = MONITORENTER;
281 INSTRUCTIONS[Const.MONITOREXIT] = MONITOREXIT;
282 }
283
284
285
286
287
288
289
290 public static Instruction getInstruction(final int index) {
291 return INSTRUCTIONS[index];
292 }
293
294 private InstructionConst() {
295 }
296 }