KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > proguard > optimize > peephole > InstructionSequenceConstants


1 /*
2  * ProGuard -- shrinking, optimization, obfuscation, and preverification
3  * of Java bytecode.
4  *
5  * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu)
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21 package proguard.optimize.peephole;
22
23 import proguard.classfile.instruction.*;
24 import proguard.classfile.constant.*;
25 import proguard.classfile.util.InstructionSequenceMatcher;
26
27 /**
28  * This class contains a set of instruction sequences and their suggested
29  * replacements.
30  *
31  * @see InstructionSequencesReplacer
32  * @author Eric Lafortune
33  */

34 public class InstructionSequenceConstants
35 {
36     public static final int X = InstructionSequenceMatcher.X;
37     public static final int Y = InstructionSequenceMatcher.Y;
38     public static final int Z = InstructionSequenceMatcher.Z;
39
40     public static final int A = InstructionSequenceMatcher.A;
41     public static final int B = InstructionSequenceMatcher.B;
42     public static final int C = InstructionSequenceMatcher.C;
43     public static final int D = InstructionSequenceMatcher.D;
44
45
46     private static final int I_32768 = 0;
47     private static final int I_65536 = 1;
48     private static final int I_16777216 = 2;
49
50 // private static final int I_0x000000ff
51
private static final int I_0x0000ff00 = 3;
52     private static final int I_0x00ff0000 = 4;
53     private static final int I_0xff000000 = 5;
54     private static final int I_0x0000ffff = 6;
55     private static final int I_0xffff0000 = 7;
56
57     private static final int L_M1 = 8;
58     private static final int L_2 = 9;
59     private static final int L_4 = 10;
60     private static final int L_8 = 11;
61     private static final int L_16 = 12;
62     private static final int L_32 = 13;
63     private static final int L_64 = 14;
64     private static final int L_128 = 15;
65     private static final int L_256 = 16;
66     private static final int L_512 = 17;
67     private static final int L_1024 = 18;
68     private static final int L_2048 = 19;
69     private static final int L_4096 = 20;
70     private static final int L_8192 = 21;
71     private static final int L_16384 = 22;
72     private static final int L_32768 = 23;
73     private static final int L_65536 = 24;
74     private static final int L_16777216 = 25;
75     private static final int L_4294967296 = 26;
76
77     private static final int L_0x00000000ffffffff = 27;
78     private static final int L_0xffffffff00000000 = 28;
79
80     private static final int F_M1 = 29;
81
82     private static final int D_M1 = 30;
83
84     private static final int FIELD_I = 31;
85     private static final int FIELD_L = 32;
86     private static final int FIELD_F = 33;
87     private static final int FIELD_D = 34;
88
89     private static final int NAME_AND_TYPE_I = 35;
90     private static final int NAME_AND_TYPE_L = 36;
91     private static final int NAME_AND_TYPE_F = 37;
92     private static final int NAME_AND_TYPE_D = 38;
93
94     private static final int TYPE_I = 39;
95     private static final int TYPE_L = 40;
96     private static final int TYPE_F = 41;
97     private static final int TYPE_D = 42;
98
99
100     public static final Constant[] PATTERN_CONSTANTS = new Constant[]
101     {
102         new IntegerConstant(32768),
103         new IntegerConstant(65536),
104         new IntegerConstant(16777216),
105
106         new IntegerConstant(0x0000ff00),
107         new IntegerConstant(0x00ff0000),
108         new IntegerConstant(0xff000000),
109         new IntegerConstant(0x0000ffff),
110         new IntegerConstant(0xffff0000),
111
112         new LongConstant(-1L),
113         new LongConstant(2L),
114         new LongConstant(4L),
115         new LongConstant(8L),
116         new LongConstant(16L),
117         new LongConstant(32L),
118         new LongConstant(64L),
119         new LongConstant(128L),
120         new LongConstant(256L),
121         new LongConstant(512L),
122         new LongConstant(1024L),
123         new LongConstant(2048L),
124         new LongConstant(4096L),
125         new LongConstant(8192L),
126         new LongConstant(16384L),
127         new LongConstant(32768L),
128         new LongConstant(65536L),
129         new LongConstant(16777216L),
130         new LongConstant(4294967296L),
131
132         new LongConstant(0x00000000ffffffffL),
133         new LongConstant(0xffffffff00000000L),
134
135         new FloatConstant(-1f),
136
137         new DoubleConstant(-1d),
138
139         new FieldrefConstant(X, NAME_AND_TYPE_I, null, null),
140         new FieldrefConstant(X, NAME_AND_TYPE_L, null, null),
141         new FieldrefConstant(X, NAME_AND_TYPE_F, null, null),
142         new FieldrefConstant(X, NAME_AND_TYPE_D, null, null),
143
144         new NameAndTypeConstant(Y, TYPE_I),
145         new NameAndTypeConstant(Y, TYPE_L),
146         new NameAndTypeConstant(Y, TYPE_F),
147         new NameAndTypeConstant(Y, TYPE_D),
148
149         new Utf8Constant("I"),
150         new Utf8Constant("J"),
151         new Utf8Constant("F"),
152         new Utf8Constant("D"),
153     };
154
155
156     public static final Instruction[][][] INSTRUCTION_SEQUENCES =
157         new Instruction[][][]
158     {
159         { // nop = nothing
160
{
161                 new SimpleInstruction(InstructionConstants.OP_NOP),
162             },{
163                 // Nothing.
164
},
165         },
166         { // i = i = nothing
167
{
168                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
169                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
170             },{
171                 // Nothing.
172
},
173         },
174         { // l = l = nothing
175
{
176                 new VariableInstruction(InstructionConstants.OP_LLOAD, X),
177                 new VariableInstruction(InstructionConstants.OP_LSTORE, X),
178             },{
179                 // Nothing.
180
},
181         },
182         { // f = f = nothing
183
{
184                 new VariableInstruction(InstructionConstants.OP_FLOAD, X),
185                 new VariableInstruction(InstructionConstants.OP_FSTORE, X),
186             },{
187                 // Nothing.
188
},
189         },
190         { // d = d = nothing
191
{
192                 new VariableInstruction(InstructionConstants.OP_DLOAD, X),
193                 new VariableInstruction(InstructionConstants.OP_DSTORE, X),
194             },{
195                 // Nothing.
196
},
197         },
198         { // a = a = nothing
199
{
200                 new VariableInstruction(InstructionConstants.OP_ALOAD, X),
201                 new VariableInstruction(InstructionConstants.OP_ASTORE, X),
202             },{
203                 // Nothing.
204
},
205         },
206         { // istore/istore = pop/istore
207
{
208                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
209                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
210             },{
211                 new SimpleInstruction(InstructionConstants.OP_POP),
212                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
213             },
214         },
215         { // lstore/lstore = pop2/lstore
216
{
217                 new VariableInstruction(InstructionConstants.OP_LSTORE, X),
218                 new VariableInstruction(InstructionConstants.OP_LSTORE, X),
219             },{
220                 new SimpleInstruction(InstructionConstants.OP_POP2),
221                 new VariableInstruction(InstructionConstants.OP_LSTORE, X),
222             },
223         },
224         { // fstore/fstore = pop/fstore
225
{
226                 new VariableInstruction(InstructionConstants.OP_FSTORE, X),
227                 new VariableInstruction(InstructionConstants.OP_FSTORE, X),
228             },{
229                 new SimpleInstruction(InstructionConstants.OP_POP),
230                 new VariableInstruction(InstructionConstants.OP_FSTORE, X),
231             },
232         },
233         { // dstore/dstore = pop2/dstore
234
{
235                 new VariableInstruction(InstructionConstants.OP_DSTORE, X),
236                 new VariableInstruction(InstructionConstants.OP_DSTORE, X),
237             },{
238                 new SimpleInstruction(InstructionConstants.OP_POP2),
239                 new VariableInstruction(InstructionConstants.OP_DSTORE, X),
240             },
241         },
242         { // astore/astore = pop/astore
243
{
244                 new VariableInstruction(InstructionConstants.OP_ASTORE, X),
245                 new VariableInstruction(InstructionConstants.OP_ASTORE, X),
246             },{
247                 new SimpleInstruction(InstructionConstants.OP_POP),
248                 new VariableInstruction(InstructionConstants.OP_ASTORE, X),
249             },
250         },
251         { // istore/iload = dup/istore
252
{
253                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
254                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
255             },{
256                 new SimpleInstruction(InstructionConstants.OP_DUP),
257                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
258             },
259         },
260         { // lstore/lload = dup2/lstore
261
{
262                 new VariableInstruction(InstructionConstants.OP_LSTORE, X),
263                 new VariableInstruction(InstructionConstants.OP_LLOAD, X),
264             },{
265                 new SimpleInstruction(InstructionConstants.OP_DUP2),
266                 new VariableInstruction(InstructionConstants.OP_LSTORE, X),
267             },
268         },
269         { // fstore/fload = dup/fstore
270
{
271                 new VariableInstruction(InstructionConstants.OP_FSTORE, X),
272                 new VariableInstruction(InstructionConstants.OP_FLOAD, X),
273             },{
274                 new SimpleInstruction(InstructionConstants.OP_DUP),
275                 new VariableInstruction(InstructionConstants.OP_FSTORE, X),
276             },
277         },
278         { // dstore/dload = dup2/dstore
279
{
280                 new VariableInstruction(InstructionConstants.OP_DSTORE, X),
281                 new VariableInstruction(InstructionConstants.OP_DLOAD, X),
282             },{
283                 new SimpleInstruction(InstructionConstants.OP_DUP2),
284                 new VariableInstruction(InstructionConstants.OP_DSTORE, X),
285             },
286         },
287         { // astore/aload = dup/astore
288
{
289                 new VariableInstruction(InstructionConstants.OP_ASTORE, X),
290                 new VariableInstruction(InstructionConstants.OP_ALOAD, X),
291             },{
292                 new SimpleInstruction(InstructionConstants.OP_DUP),
293                 new VariableInstruction(InstructionConstants.OP_ASTORE, X),
294             },
295         },
296         { // i = i + c = i += c
297
{
298                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
299                 new SimpleInstruction(InstructionConstants.OP_ICONST_0, A),
300                 new SimpleInstruction(InstructionConstants.OP_IADD),
301                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
302             },{
303                 new VariableInstruction(InstructionConstants.OP_IINC, X, A),
304             },
305         },
306         { // i = i + b = i += b
307
{
308                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
309                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, A),
310                 new SimpleInstruction(InstructionConstants.OP_IADD),
311                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
312             },{
313                 new VariableInstruction(InstructionConstants.OP_IINC, X, A),
314             },
315         },
316         { // i = i + s = i += s
317
{
318                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
319                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, A),
320                 new SimpleInstruction(InstructionConstants.OP_IADD),
321                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
322             },{
323                 new VariableInstruction(InstructionConstants.OP_IINC, X, A),
324             },
325         },
326         { // i = i - -1 = i++
327
{
328                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
329                 new SimpleInstruction(InstructionConstants.OP_ICONST_M1),
330                 new SimpleInstruction(InstructionConstants.OP_ISUB),
331                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
332             },{
333                 new VariableInstruction(InstructionConstants.OP_IINC, X, 1),
334             },
335         },
336         { // i = i - 1 = i--
337
{
338                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
339                 new SimpleInstruction(InstructionConstants.OP_ICONST_1),
340                 new SimpleInstruction(InstructionConstants.OP_ISUB),
341                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
342             },{
343                 new VariableInstruction(InstructionConstants.OP_IINC, X, -1),
344             },
345         },
346         { // i = i - 2 = i -= 2
347
{
348                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
349                 new SimpleInstruction(InstructionConstants.OP_ICONST_2),
350                 new SimpleInstruction(InstructionConstants.OP_ISUB),
351                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
352             },{
353                 new VariableInstruction(InstructionConstants.OP_IINC, X, -2),
354             },
355         },
356         { // i = i - 3 = i -= 3
357
{
358                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
359                 new SimpleInstruction(InstructionConstants.OP_ICONST_3),
360                 new SimpleInstruction(InstructionConstants.OP_ISUB),
361                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
362             },{
363                 new VariableInstruction(InstructionConstants.OP_IINC, X, -3),
364             },
365         },
366         { // i = i - 4 = i -= 4
367
{
368                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
369                 new SimpleInstruction(InstructionConstants.OP_ICONST_4),
370                 new SimpleInstruction(InstructionConstants.OP_ISUB),
371                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
372             },{
373                 new VariableInstruction(InstructionConstants.OP_IINC, X, -4),
374             },
375         },
376         { // i = i - 5 = i -= 5
377
{
378                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
379                 new SimpleInstruction(InstructionConstants.OP_ICONST_5),
380                 new SimpleInstruction(InstructionConstants.OP_ISUB),
381                 new VariableInstruction(InstructionConstants.OP_ISTORE, X),
382             },{
383                 new VariableInstruction(InstructionConstants.OP_IINC, X, -5),
384             },
385         },
386         { // 0 * i = 0
387
{
388                 new SimpleInstruction(InstructionConstants.OP_ICONST_0),
389                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
390                 new SimpleInstruction(InstructionConstants.OP_IMUL),
391             },{
392                 new SimpleInstruction(InstructionConstants.OP_ICONST_0),
393             },
394         },
395         { // 1 * i = i
396
{
397                 new SimpleInstruction(InstructionConstants.OP_ICONST_1),
398                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
399                 new SimpleInstruction(InstructionConstants.OP_IMUL),
400             },{
401                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
402             },
403         },
404         { // 2 * i = i << 1
405
{
406                 new SimpleInstruction(InstructionConstants.OP_ICONST_2),
407                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
408                 new SimpleInstruction(InstructionConstants.OP_IMUL),
409             },{
410                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
411                 new SimpleInstruction(InstructionConstants.OP_ICONST_1),
412                 new SimpleInstruction(InstructionConstants.OP_ISHL),
413             },
414         },
415         { // 4 * i = i << 2
416
{
417                 new SimpleInstruction(InstructionConstants.OP_ICONST_4),
418                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
419                 new SimpleInstruction(InstructionConstants.OP_IMUL),
420             },{
421                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
422                 new SimpleInstruction(InstructionConstants.OP_ICONST_2),
423                 new SimpleInstruction(InstructionConstants.OP_ISHL),
424             },
425         },
426         { // 8 * i = i << 3
427
{
428                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
429                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
430                 new SimpleInstruction(InstructionConstants.OP_IMUL),
431             },{
432                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
433                 new SimpleInstruction(InstructionConstants.OP_ICONST_3),
434                 new SimpleInstruction(InstructionConstants.OP_ISHL),
435             },
436         },
437         { // 16 * i = i << 4
438
{
439                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
440                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
441                 new SimpleInstruction(InstructionConstants.OP_IMUL),
442             },{
443                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
444                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 4),
445                 new SimpleInstruction(InstructionConstants.OP_ISHL),
446             },
447         },
448         { // 32 * i = i << 5
449
{
450                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
451                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
452                 new SimpleInstruction(InstructionConstants.OP_IMUL),
453             },{
454                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
455                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 5),
456                 new SimpleInstruction(InstructionConstants.OP_ISHL),
457             },
458         },
459         { // 64 * i = i << 6
460
{
461                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 64),
462                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
463                 new SimpleInstruction(InstructionConstants.OP_IMUL),
464             },{
465                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
466                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 6),
467                 new SimpleInstruction(InstructionConstants.OP_ISHL),
468             },
469         },
470         { // 128 * i = i << 7
471
{
472                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 128),
473                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
474                 new SimpleInstruction(InstructionConstants.OP_IMUL),
475             },{
476                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
477                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 7),
478                 new SimpleInstruction(InstructionConstants.OP_ISHL),
479             },
480         },
481         { // 256 * i = i << 8
482
{
483                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 256),
484                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
485                 new SimpleInstruction(InstructionConstants.OP_IMUL),
486             },{
487                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
488                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
489                 new SimpleInstruction(InstructionConstants.OP_ISHL),
490             },
491         },
492         { // 512 * i = i << 9
493
{
494                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 512),
495                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
496                 new SimpleInstruction(InstructionConstants.OP_IMUL),
497             },{
498                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
499                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 9),
500                 new SimpleInstruction(InstructionConstants.OP_ISHL),
501             },
502         },
503         { // 1024 * i = i << 10
504
{
505                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 1024),
506                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
507                 new SimpleInstruction(InstructionConstants.OP_IMUL),
508             },{
509                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
510                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 10),
511                 new SimpleInstruction(InstructionConstants.OP_ISHL),
512             },
513         },
514         { // 2048 * i = i << 11
515
{
516                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 2048),
517                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
518                 new SimpleInstruction(InstructionConstants.OP_IMUL),
519             },{
520                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
521                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 11),
522                 new SimpleInstruction(InstructionConstants.OP_ISHL),
523             },
524         },
525         { // 4096 * i = i << 12
526
{
527                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 4096),
528                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
529                 new SimpleInstruction(InstructionConstants.OP_IMUL),
530             },{
531                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
532                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 12),
533                 new SimpleInstruction(InstructionConstants.OP_ISHL),
534             },
535         },
536         { // 8192 * i = i << 13
537
{
538                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 8192),
539                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
540                 new SimpleInstruction(InstructionConstants.OP_IMUL),
541             },{
542                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
543                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 13),
544                 new SimpleInstruction(InstructionConstants.OP_ISHL),
545             },
546         },
547         { // 16384 * i = i << 14
548
{
549                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 16384),
550                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
551                 new SimpleInstruction(InstructionConstants.OP_IMUL),
552             },{
553                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
554                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 14),
555                 new SimpleInstruction(InstructionConstants.OP_ISHL),
556             },
557         },
558         { // 32768 * i = i << 15
559
{
560                 new ConstantInstruction(InstructionConstants.OP_LDC, I_32768),
561                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
562                 new SimpleInstruction(InstructionConstants.OP_IMUL),
563             },{
564                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
565                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 15),
566                 new SimpleInstruction(InstructionConstants.OP_ISHL),
567             },
568         },
569         { // 65536 * i = i << 16
570
{
571                 new ConstantInstruction(InstructionConstants.OP_LDC, I_65536),
572                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
573                 new SimpleInstruction(InstructionConstants.OP_IMUL),
574             },{
575                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
576                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
577                 new SimpleInstruction(InstructionConstants.OP_ISHL),
578             },
579         },
580         { // 16777216 * i = i << 24
581
{
582                 new ConstantInstruction(InstructionConstants.OP_LDC, I_16777216),
583                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
584                 new SimpleInstruction(InstructionConstants.OP_IMUL),
585             },{
586                 new VariableInstruction(InstructionConstants.OP_ILOAD, X),
587                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
588                 new SimpleInstruction(InstructionConstants.OP_ISHL),
589             },
590         },
591         { // ... + 0 = ...
592
{
593                 new SimpleInstruction(InstructionConstants.OP_ICONST_0),
594                 new SimpleInstruction(InstructionConstants.OP_IADD),
595             },{
596                 // Nothing.
597
},
598         },
599         { // ... + 0L = ...
600
{
601                 new SimpleInstruction(InstructionConstants.OP_LCONST_0),
602                 new SimpleInstruction(InstructionConstants.OP_LADD),
603             },{
604                 // Nothing.
605
},
606         },
607         { // ... + 0f = ...
608
{
609                 new SimpleInstruction(InstructionConstants.OP_FCONST_0),
610                 new SimpleInstruction(InstructionConstants.OP_FADD),
611             },{
612                 // Nothing.
613
},
614         },
615         { // ... + 0d = ...
616
{
617                 new SimpleInstruction(InstructionConstants.OP_DCONST_0),
618                 new SimpleInstruction(InstructionConstants.OP_DADD),
619             },{
620                 // Nothing.
621
},
622         },
623         { // ... - 0 = ...
624
{
625                 new SimpleInstruction(InstructionConstants.OP_ICONST_0),
626                 new SimpleInstruction(InstructionConstants.OP_ISUB),
627             },{
628                 // Nothing.
629
},
630         },
631         { // ... - 0L = ...
632
{
633                 new SimpleInstruction(InstructionConstants.OP_LCONST_0),
634                 new SimpleInstruction(InstructionConstants.OP_LSUB),
635             },{
636                 // Nothing.
637
},
638         },
639         { // ... - 0f = ...
640
{
641                 new SimpleInstruction(InstructionConstants.OP_FCONST_0),
642                 new SimpleInstruction(InstructionConstants.OP_FSUB),
643             },{
644                 // Nothing.
645
},
646         },
647         { // ... - 0d = ...
648
{
649                 new SimpleInstruction(InstructionConstants.OP_DCONST_0),
650                 new SimpleInstruction(InstructionConstants.OP_DSUB),
651             },{
652                 // Nothing.
653
},
654         },
655         { // ... * -1 = -...
656
{
657                 new SimpleInstruction(InstructionConstants.OP_ICONST_M1),
658                 new SimpleInstruction(InstructionConstants.OP_IMUL),
659             },{
660                 new SimpleInstruction(InstructionConstants.OP_INEG),
661             },
662         },
663         { // ... * 0 = 0
664
{
665                 new SimpleInstruction(InstructionConstants.OP_ICONST_0),
666                 new SimpleInstruction(InstructionConstants.OP_IMUL),
667             },{
668                 new SimpleInstruction(InstructionConstants.OP_POP),
669                 new SimpleInstruction(InstructionConstants.OP_ICONST_0),
670             },
671         },
672         { // ... * 1 = ...
673
{
674                 new SimpleInstruction(InstructionConstants.OP_ICONST_1),
675                 new SimpleInstruction(InstructionConstants.OP_IMUL),
676             },{
677                 // Nothing.
678
},
679         },
680         { // ... * 2 = ... << 1
681
{
682                 new SimpleInstruction(InstructionConstants.OP_ICONST_2),
683                 new SimpleInstruction(InstructionConstants.OP_IMUL),
684             },{
685                 new SimpleInstruction(InstructionConstants.OP_ICONST_1),
686                 new SimpleInstruction(InstructionConstants.OP_ISHL),
687             },
688         },
689         { // ... * 4 = ... << 2
690
{
691                 new SimpleInstruction(InstructionConstants.OP_ICONST_4),
692                 new SimpleInstruction(InstructionConstants.OP_IMUL),
693             },{
694                 new SimpleInstruction(InstructionConstants.OP_ICONST_2),
695                 new SimpleInstruction(InstructionConstants.OP_ISHL),
696             },
697         },
698         { // ... * 8 = ... << 3
699
{
700                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
701                 new SimpleInstruction(InstructionConstants.OP_IMUL),
702             },{
703                 new SimpleInstruction(InstructionConstants.OP_ICONST_3),
704                 new SimpleInstruction(InstructionConstants.OP_ISHL),
705             },
706         },
707         { // ... * 16 = ... << 4
708
{
709                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
710                 new SimpleInstruction(InstructionConstants.OP_IMUL),
711             },{
712                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 4),
713                 new SimpleInstruction(InstructionConstants.OP_ISHL),
714             },
715         },
716         { // ... * 32 = ... << 5
717
{
718                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
719                 new SimpleInstruction(InstructionConstants.OP_IMUL),
720             },{
721                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 5),
722                 new SimpleInstruction(InstructionConstants.OP_ISHL),
723             },
724         },
725         { // ... * 64 = ... << 6
726
{
727                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 64),
728                 new SimpleInstruction(InstructionConstants.OP_IMUL),
729             },{
730                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 6),
731                 new SimpleInstruction(InstructionConstants.OP_ISHL),
732             },
733         },
734         { // ... * 128 = ... << 7
735
{
736                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 128),
737                 new SimpleInstruction(InstructionConstants.OP_IMUL),
738             },{
739                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 7),
740                 new SimpleInstruction(InstructionConstants.OP_ISHL),
741             },
742         },
743         { // ... * 256 = ... << 8
744
{
745                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 256),
746                 new SimpleInstruction(InstructionConstants.OP_IMUL),
747             },{
748                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
749                 new SimpleInstruction(InstructionConstants.OP_ISHL),
750             },
751         },
752         { // ... * 512 = ... << 9
753
{
754                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 512),
755                 new SimpleInstruction(InstructionConstants.OP_IMUL),
756             },{
757                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 9),
758                 new SimpleInstruction(InstructionConstants.OP_ISHL),
759             },
760         },
761         { // ... * 1024 = ... << 10
762
{
763                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 1024),
764                 new SimpleInstruction(InstructionConstants.OP_IMUL),
765             },{
766                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 10),
767                 new SimpleInstruction(InstructionConstants.OP_ISHL),
768             },
769         },
770         { // ... * 2048 = ... << 11
771
{
772                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 2048),
773                 new SimpleInstruction(InstructionConstants.OP_IMUL),
774             },{
775                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 11),
776                 new SimpleInstruction(InstructionConstants.OP_ISHL),
777             },
778         },
779         { // ... * 4096 = ... << 12
780
{
781                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 4096),
782                 new SimpleInstruction(InstructionConstants.OP_IMUL),
783             },{
784                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 12),
785                 new SimpleInstruction(InstructionConstants.OP_ISHL),
786             },
787         },
788         { // ... * 8192 = ... << 13
789
{
790                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 8192),
791                 new SimpleInstruction(InstructionConstants.OP_IMUL),
792             },{
793                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 13),
794                 new SimpleInstruction(InstructionConstants.OP_ISHL),
795             },
796         },
797         { // ... * 16384 = ... << 14
798
{
799                 new SimpleInstruction(InstructionConstants.OP_SIPUSH, 16384),
800                 new SimpleInstruction(InstructionConstants.OP_IMUL),
801             },{
802                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 14),
803                 new SimpleInstruction(InstructionConstants.OP_ISHL),
804             },
805         },
806         { // ... * 32768 = ... << 15
807
{
808                 new ConstantInstruction(InstructionConstants.OP_LDC, I_32768),
809                 new SimpleInstruction(InstructionConstants.OP_IMUL),
810             },{
811                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 15),
812                 new SimpleInstruction(InstructionConstants.OP_ISHL),
813             },
814         },
815         { // ... * 65536 = ... << 16
816
{
817                 new ConstantInstruction(InstructionConstants.OP_LDC, I_65536),
818                 new SimpleInstruction(InstructionConstants.OP_IMUL),
819             },{
820                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
821                 new SimpleInstruction(InstructionConstants.OP_ISHL),
822             },
823         },
824         { // ... * 16777216 = ... << 24
825
{
826                 new ConstantInstruction(InstructionConstants.OP_LDC, I_16777216),
827                 new SimpleInstruction(InstructionConstants.OP_IMUL),
828             },{
829                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
830                 new SimpleInstruction(InstructionConstants.OP_ISHL),
831             },
832         },
833         { // ... * -1L = -...
834
{
835                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_M1),
836                 new SimpleInstruction(InstructionConstants.OP_LMUL),
837             },{
838                 new SimpleInstruction(InstructionConstants.OP_LNEG),
839             },
840         },
841         { // ... * 0L = 0L
842
{
843                 new SimpleInstruction(InstructionConstants.OP_LCONST_0),
844                 new SimpleInstruction(InstructionConstants.OP_LMUL),
845             },{
846                 new SimpleInstruction(InstructionConstants.OP_POP2),
847                 new SimpleInstruction(InstructionConstants.OP_LCONST_0),
848             },
849         },
850         { // ... * 1L = ...
851
{
852                 new SimpleInstruction(InstructionConstants.OP_LCONST_1),
853                 new SimpleInstruction(InstructionConstants.OP_LMUL),
854             },{
855                 // Nothing.
856
},
857         },
858         { // ... * 2L = ... << 1
859
{
860                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_2),
861                 new SimpleInstruction(InstructionConstants.OP_LMUL),
862             },{
863                 new SimpleInstruction(InstructionConstants.OP_ICONST_1),
864                 new SimpleInstruction(InstructionConstants.OP_LSHL),
865             },
866         },
867         { // ... * 4L = ... << 2
868
{
869                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_4),
870                 new SimpleInstruction(InstructionConstants.OP_LMUL),
871             },{
872                 new SimpleInstruction(InstructionConstants.OP_ICONST_2),
873                 new SimpleInstruction(InstructionConstants.OP_LSHL),
874             },
875         },
876         { // ... * 8L = ... << 3
877
{
878                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_8),
879                 new SimpleInstruction(InstructionConstants.OP_LMUL),
880             },{
881                 new SimpleInstruction(InstructionConstants.OP_ICONST_3),
882                 new SimpleInstruction(InstructionConstants.OP_LSHL),
883             },
884         },
885         { // ... * 16L = ... << 4
886
{
887                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_16),
888                 new SimpleInstruction(InstructionConstants.OP_LMUL),
889             },{
890                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 4),
891                 new SimpleInstruction(InstructionConstants.OP_LSHL),
892             },
893         },
894         { // ... * 32L = ... << 5
895
{
896                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_32),
897                 new SimpleInstruction(InstructionConstants.OP_LMUL),
898             },{
899                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 5),
900                 new SimpleInstruction(InstructionConstants.OP_LSHL),
901             },
902         },
903         { // ... * 64L = ... << 6
904
{
905                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_64),
906                 new SimpleInstruction(InstructionConstants.OP_LMUL),
907             },{
908                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 6),
909                 new SimpleInstruction(InstructionConstants.OP_LSHL),
910             },
911         },
912         { // ... * 128L = ... << 7
913
{
914                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_128),
915                 new SimpleInstruction(InstructionConstants.OP_LMUL),
916             },{
917                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 7),
918                 new SimpleInstruction(InstructionConstants.OP_LSHL),
919             },
920         },
921         { // ... * 256L = ... << 8
922
{
923                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_256),
924                 new SimpleInstruction(InstructionConstants.OP_LMUL),
925             },{
926                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
927                 new SimpleInstruction(InstructionConstants.OP_LSHL),
928             },
929         },
930         { // ... * 512L = ... << 9
931
{
932                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_512),
933                 new SimpleInstruction(InstructionConstants.OP_LMUL),
934             },{
935                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 9),
936                 new SimpleInstruction(InstructionConstants.OP_LSHL),
937             },
938         },
939         { // ... * 1024L = ... << 10
940
{
941                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_1024),
942                 new SimpleInstruction(InstructionConstants.OP_LMUL),
943             },{
944                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 10),
945                 new SimpleInstruction(InstructionConstants.OP_LSHL),
946             },
947         },
948         { // ... * 2048L = ... << 11
949
{
950                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_2048),
951                 new SimpleInstruction(InstructionConstants.OP_LMUL),
952             },{
953                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 11),
954                 new SimpleInstruction(InstructionConstants.OP_LSHL),
955             },
956         },
957         { // ... * 4096L = ... << 12
958
{
959                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_4096),
960                 new SimpleInstruction(InstructionConstants.OP_LMUL),
961             },{
962                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 12),
963                 new SimpleInstruction(InstructionConstants.OP_LSHL),
964             },
965         },
966         { // ... * 8192L = ... << 13
967
{
968                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_8192),
969                 new SimpleInstruction(InstructionConstants.OP_LMUL),
970             },{
971                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 13),
972                 new SimpleInstruction(InstructionConstants.OP_LSHL),
973             },
974         },
975         { // ... * 16384L = ... << 14
976
{
977                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_16384),
978                 new SimpleInstruction(InstructionConstants.OP_LMUL),
979             },{
980                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 14),
981                 new SimpleInstruction(InstructionConstants.OP_LSHL),
982             },
983         },
984         { // ... * 32768L = ... << 15
985
{
986                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_32768),
987                 new SimpleInstruction(InstructionConstants.OP_LMUL),
988             },{
989                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 15),
990                 new SimpleInstruction(InstructionConstants.OP_LSHL),
991             },
992         },
993         { // ... * 65536LL = ... << 16
994
{
995                 new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_65536),
996                 new SimpleInstruction(InstructionConstants.OP_LMUL),
997             },{
998                 new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
999                 new SimpleInstruction(InstructionConstants.OP_LSHL),
1000            },
1001        },
1002        { // ... * 16777216L = ... << 24
1003
{
1004                new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_16777216),
1005                new SimpleInstruction(InstructionConstants.OP_LMUL),
1006            },{
1007                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1008                new SimpleInstruction(InstructionConstants.OP_LSHL),
1009            },
1010        },
1011        { // ... * 4294967296L = ... << 32
1012
{
1013                new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_4294967296),
1014                new SimpleInstruction(InstructionConstants.OP_LMUL),
1015            },{
1016                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
1017                new SimpleInstruction(InstructionConstants.OP_LSHL),
1018            },
1019        },
1020        { // ... * -1f = -...
1021
{
1022                new ConstantInstruction(InstructionConstants.OP_LDC, F_M1),
1023                new SimpleInstruction(InstructionConstants.OP_FMUL),
1024            },{
1025                new SimpleInstruction(InstructionConstants.OP_FNEG),
1026            },
1027        },
1028// { // ... * 0f = 0f (or NaN)
1029
// {
1030
// new SimpleInstruction(InstructionConstants.OP_FCONST_0),
1031
// new SimpleInstruction(InstructionConstants.OP_FMUL),
1032
// },{
1033
// new SimpleInstruction(InstructionConstants.OP_POP),
1034
// new SimpleInstruction(InstructionConstants.OP_FCONST_0),
1035
// },
1036
// },
1037
{ // ... * 1f = ...
1038
{
1039                new SimpleInstruction(InstructionConstants.OP_FCONST_1),
1040                new SimpleInstruction(InstructionConstants.OP_FMUL),
1041            },{
1042                // Nothing.
1043
},
1044        },
1045        { // ... * -1d = -...
1046
{
1047                new ConstantInstruction(InstructionConstants.OP_LDC2_W, D_M1),
1048                new SimpleInstruction(InstructionConstants.OP_DMUL),
1049            },{
1050                new SimpleInstruction(InstructionConstants.OP_DNEG),
1051            },
1052        },
1053// { // ... * 0d = 0d (or NaN)
1054
// {
1055
// new SimpleInstruction(InstructionConstants.OP_DCONST_0),
1056
// new SimpleInstruction(InstructionConstants.OP_DMUL),
1057
// },{
1058
// new SimpleInstruction(InstructionConstants.OP_POP2),
1059
// new SimpleInstruction(InstructionConstants.OP_DCONST_0),
1060
// },
1061
// },
1062
{ // ... * 1d = ...
1063
{
1064                new SimpleInstruction(InstructionConstants.OP_DCONST_1),
1065                new SimpleInstruction(InstructionConstants.OP_DMUL),
1066            },{
1067                // Nothing.
1068
},
1069        },
1070        { // ... / -1 = -...
1071
{
1072                new SimpleInstruction(InstructionConstants.OP_ICONST_M1),
1073                new SimpleInstruction(InstructionConstants.OP_IDIV),
1074            },{
1075                new SimpleInstruction(InstructionConstants.OP_INEG),
1076            },
1077        },
1078        { // ... / 1 = ...
1079
{
1080                new SimpleInstruction(InstructionConstants.OP_ICONST_1),
1081                new SimpleInstruction(InstructionConstants.OP_IDIV),
1082            },{
1083                // Nothing.
1084
},
1085        },
1086// { // ... / 2 = ... >> 1
1087
// {
1088
// new SimpleInstruction(InstructionConstants.OP_ICONST_2),
1089
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1090
// },{
1091
// new SimpleInstruction(InstructionConstants.OP_ICONST_1),
1092
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1093
// },
1094
// },
1095
// { // ... / 4 = ... >> 2
1096
// {
1097
// new SimpleInstruction(InstructionConstants.OP_ICONST_4),
1098
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1099
// },{
1100
// new SimpleInstruction(InstructionConstants.OP_ICONST_2),
1101
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1102
// },
1103
// },
1104
// { // ... / 8 = ... >> 3
1105
// {
1106
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
1107
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1108
// },{
1109
// new SimpleInstruction(InstructionConstants.OP_ICONST_3),
1110
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1111
// },
1112
// },
1113
// { // ... / 16 = ... >> 4
1114
// {
1115
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1116
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1117
// },{
1118
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 4),
1119
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1120
// },
1121
// },
1122
// { // ... / 32 = ... >> 5
1123
// {
1124
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
1125
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1126
// },{
1127
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 5),
1128
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1129
// },
1130
// },
1131
// { // ... / 64 = ... >> 6
1132
// {
1133
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 64),
1134
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1135
// },{
1136
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 6),
1137
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1138
// },
1139
// },
1140
// { // ... / 128 = ... >> 7
1141
// {
1142
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 128),
1143
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1144
// },{
1145
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 7),
1146
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1147
// },
1148
// },
1149
// { // ... / 256 = ... >> 8
1150
// {
1151
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 256),
1152
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1153
// },{
1154
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
1155
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1156
// },
1157
// },
1158
// { // ... / 512 = ... >> 9
1159
// {
1160
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 512),
1161
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1162
// },{
1163
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 9),
1164
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1165
// },
1166
// },
1167
// { // ... / 1024 = ... >> 10
1168
// {
1169
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 1024),
1170
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1171
// },{
1172
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 10),
1173
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1174
// },
1175
// },
1176
// { // ... / 2048 = ... >> 11
1177
// {
1178
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 2048),
1179
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1180
// },{
1181
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 11),
1182
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1183
// },
1184
// },
1185
// { // ... / 4096 = ... >> 12
1186
// {
1187
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 4096),
1188
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1189
// },{
1190
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 12),
1191
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1192
// },
1193
// },
1194
// { // ... / 8192 = ... >> 13
1195
// {
1196
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 8192),
1197
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1198
// },{
1199
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 13),
1200
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1201
// },
1202
// },
1203
// { // ... / 16384 = ... >> 14
1204
// {
1205
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 16384),
1206
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1207
// },{
1208
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 14),
1209
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1210
// },
1211
// },
1212
// { // ... / 32768 = ... >> 15
1213
// {
1214
// new ConstantInstruction(InstructionConstants.OP_LDC, I_32768),
1215
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1216
// },{
1217
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 15),
1218
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1219
// },
1220
// },
1221
// { // ... / 65536 = ... >> 16
1222
// {
1223
// new ConstantInstruction(InstructionConstants.OP_LDC, I_65536),
1224
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1225
// },{
1226
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1227
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1228
// },
1229
// },
1230
// { // ... / 16777216 = ... >> 24
1231
// {
1232
// new ConstantInstruction(InstructionConstants.OP_LDC, I_16777216),
1233
// new SimpleInstruction(InstructionConstants.OP_IDIV),
1234
// },{
1235
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1236
// new SimpleInstruction(InstructionConstants.OP_ISHR),
1237
// },
1238
// },
1239
{ // ... / -1L = -...
1240
{
1241                new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_M1),
1242                new SimpleInstruction(InstructionConstants.OP_LDIV),
1243            },{
1244                new SimpleInstruction(InstructionConstants.OP_LNEG),
1245            },
1246        },
1247        { // ... / 1L = ...
1248
{
1249                new SimpleInstruction(InstructionConstants.OP_LCONST_1),
1250                new SimpleInstruction(InstructionConstants.OP_LDIV),
1251            },{
1252                // Nothing.
1253
},
1254        },
1255// { // ... / 2L = ... >> 1
1256
// {
1257
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_2),
1258
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1259
// },{
1260
// new SimpleInstruction(InstructionConstants.OP_ICONST_1),
1261
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1262
// },
1263
// },
1264
// { // ... / 4L = ... >> 2
1265
// {
1266
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_4),
1267
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1268
// },{
1269
// new SimpleInstruction(InstructionConstants.OP_ICONST_2),
1270
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1271
// },
1272
// },
1273
// { // ... / 8L = ... >> 3
1274
// {
1275
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_8),
1276
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1277
// },{
1278
// new SimpleInstruction(InstructionConstants.OP_ICONST_3),
1279
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1280
// },
1281
// },
1282
// { // ... / 16L = ... >> 4
1283
// {
1284
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_16),
1285
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1286
// },{
1287
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 4),
1288
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1289
// },
1290
// },
1291
// { // ... / 32L = ... >> 5
1292
// {
1293
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_32),
1294
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1295
// },{
1296
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 5),
1297
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1298
// },
1299
// },
1300
// { // ... / 64L = ... >> 6
1301
// {
1302
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_64),
1303
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1304
// },{
1305
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 6),
1306
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1307
// },
1308
// },
1309
// { // ... / 128L = ... >> 7
1310
// {
1311
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_128),
1312
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1313
// },{
1314
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 7),
1315
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1316
// },
1317
// },
1318
// { // ... / 256L = ... >> 8
1319
// {
1320
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_256),
1321
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1322
// },{
1323
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
1324
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1325
// },
1326
// },
1327
// { // ... / 512L = ... >> 9
1328
// {
1329
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_512),
1330
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1331
// },{
1332
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 9),
1333
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1334
// },
1335
// },
1336
// { // ... / 1024L = ... >> 10
1337
// {
1338
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_1024),
1339
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1340
// },{
1341
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 10),
1342
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1343
// },
1344
// },
1345
// { // ... / 2048L = ... >> 11
1346
// {
1347
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_2048),
1348
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1349
// },{
1350
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 11),
1351
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1352
// },
1353
// },
1354
// { // ... / 4096L = ... >> 12
1355
// {
1356
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_4096),
1357
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1358
// },{
1359
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 12),
1360
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1361
// },
1362
// },
1363
// { // ... / 8192L = ... >> 13
1364
// {
1365
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_8192),
1366
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1367
// },{
1368
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 13),
1369
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1370
// },
1371
// },
1372
// { // ... / 16384L = ... >> 14
1373
// {
1374
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_16384),
1375
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1376
// },{
1377
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 14),
1378
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1379
// },
1380
// },
1381
// { // ... / 32768L = ... >> 15
1382
// {
1383
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_32768),
1384
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1385
// },{
1386
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 15),
1387
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1388
// },
1389
// },
1390
// { // ... / 65536LL = ... >> 16
1391
// {
1392
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_65536),
1393
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1394
// },{
1395
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1396
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1397
// },
1398
// },
1399
// { // ... / 16777216L = ... >> 24
1400
// {
1401
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_16777216),
1402
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1403
// },{
1404
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1405
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1406
// },
1407
// },
1408
// { // ... / 4294967296L = ... >> 32
1409
// {
1410
// new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_4294967296),
1411
// new SimpleInstruction(InstructionConstants.OP_LDIV),
1412
// },{
1413
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
1414
// new SimpleInstruction(InstructionConstants.OP_LSHR),
1415
// },
1416
// },
1417
{ // ... / -1f = -...
1418
{
1419                new ConstantInstruction(InstructionConstants.OP_LDC, F_M1),
1420                new SimpleInstruction(InstructionConstants.OP_FDIV),
1421            },{
1422                new SimpleInstruction(InstructionConstants.OP_FNEG),
1423            },
1424        },
1425        { // ... / 1f = ...
1426
{
1427                new SimpleInstruction(InstructionConstants.OP_FCONST_1),
1428                new SimpleInstruction(InstructionConstants.OP_FDIV),
1429            },{
1430                // Nothing.
1431
},
1432        },
1433        { // ... / -1d = -...
1434
{
1435                new ConstantInstruction(InstructionConstants.OP_LDC2_W, D_M1),
1436                new SimpleInstruction(InstructionConstants.OP_DDIV),
1437            },{
1438                new SimpleInstruction(InstructionConstants.OP_DNEG),
1439            },
1440        },
1441        { // ... / 1d = ...
1442
{
1443                new SimpleInstruction(InstructionConstants.OP_DCONST_1),
1444                new SimpleInstruction(InstructionConstants.OP_DDIV),
1445            },{
1446                // Nothing.
1447
},
1448        },
1449        { // ... % 1 = 0
1450
{
1451                new SimpleInstruction(InstructionConstants.OP_ICONST_1),
1452                new SimpleInstruction(InstructionConstants.OP_IREM),
1453            },{
1454                new SimpleInstruction(InstructionConstants.OP_POP),
1455                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1456            },
1457        },
1458// { // ... % 2 = ... & 0x1
1459
// {
1460
// new SimpleInstruction(InstructionConstants.OP_ICONST_2),
1461
// new SimpleInstruction(InstructionConstants.OP_IREM),
1462
// },{
1463
// new SimpleInstruction(InstructionConstants.OP_ICONST_1),
1464
// new SimpleInstruction(InstructionConstants.OP_IAND),
1465
// },
1466
// },
1467
// { // ... % 4 = ... & 0x3
1468
// {
1469
// new SimpleInstruction(InstructionConstants.OP_ICONST_4),
1470
// new SimpleInstruction(InstructionConstants.OP_IREM),
1471
// },{
1472
// new SimpleInstruction(InstructionConstants.OP_ICONST_3),
1473
// new SimpleInstruction(InstructionConstants.OP_IAND),
1474
// },
1475
// },
1476
// { // ... % 8 = ... & 0x07
1477
// {
1478
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
1479
// new SimpleInstruction(InstructionConstants.OP_IREM),
1480
// },{
1481
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 0x07),
1482
// new SimpleInstruction(InstructionConstants.OP_IAND),
1483
// },
1484
// },
1485
// { // ... % 16 = ... & 0x0f
1486
// {
1487
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1488
// new SimpleInstruction(InstructionConstants.OP_IREM),
1489
// },{
1490
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 0x0f),
1491
// new SimpleInstruction(InstructionConstants.OP_IAND),
1492
// },
1493
// },
1494
// { // ... % 32 = ... & 0x1f
1495
// {
1496
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
1497
// new SimpleInstruction(InstructionConstants.OP_IREM),
1498
// },{
1499
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 0x1f),
1500
// new SimpleInstruction(InstructionConstants.OP_IAND),
1501
// },
1502
// },
1503
// { // ... % 64 = ... & 0x3f
1504
// {
1505
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 64),
1506
// new SimpleInstruction(InstructionConstants.OP_IREM),
1507
// },{
1508
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 0x3f),
1509
// new SimpleInstruction(InstructionConstants.OP_IAND),
1510
// },
1511
// },
1512
// { // ... % 128 = ... & 0x7f
1513
// {
1514
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 128),
1515
// new SimpleInstruction(InstructionConstants.OP_IREM),
1516
// },{
1517
// new SimpleInstruction(InstructionConstants.OP_BIPUSH, 0x7f),
1518
// new SimpleInstruction(InstructionConstants.OP_IAND),
1519
// },
1520
// },
1521
// { // ... % 256 = ... & 0x00ff
1522
// {
1523
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 256),
1524
// new SimpleInstruction(InstructionConstants.OP_IREM),
1525
// },{
1526
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 0x00ff),
1527
// new SimpleInstruction(InstructionConstants.OP_IAND),
1528
// },
1529
// },
1530
// { // ... % 512 = ... & 0x01ff
1531
// {
1532
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 512),
1533
// new SimpleInstruction(InstructionConstants.OP_IREM),
1534
// },{
1535
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 0x01ff),
1536
// new SimpleInstruction(InstructionConstants.OP_IAND),
1537
// },
1538
// },
1539
// { // ... % 1024 = ... & 0x03ff
1540
// {
1541
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 1024),
1542
// new SimpleInstruction(InstructionConstants.OP_IREM),
1543
// },{
1544
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 0x03ff),
1545
// new SimpleInstruction(InstructionConstants.OP_IAND),
1546
// },
1547
// },
1548
// { // ... % 2048 = ... & 0x07ff
1549
// {
1550
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 2048),
1551
// new SimpleInstruction(InstructionConstants.OP_IREM),
1552
// },{
1553
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 0x07ff),
1554
// new SimpleInstruction(InstructionConstants.OP_IAND),
1555
// },
1556
// },
1557
// { // ... % 4096 = ... & 0x0fff
1558
// {
1559
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 4096),
1560
// new SimpleInstruction(InstructionConstants.OP_IREM),
1561
// },{
1562
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 0x0fff),
1563
// new SimpleInstruction(InstructionConstants.OP_IAND),
1564
// },
1565
// },
1566
// { // ... % 8192 = ... & 0x1fff
1567
// {
1568
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 8192),
1569
// new SimpleInstruction(InstructionConstants.OP_IREM),
1570
// },{
1571
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 0x1fff),
1572
// new SimpleInstruction(InstructionConstants.OP_IAND),
1573
// },
1574
// },
1575
// { // ... % 16384 = ... & 0x3fff
1576
// {
1577
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 16384),
1578
// new SimpleInstruction(InstructionConstants.OP_IREM),
1579
// },{
1580
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, 0x3fff),
1581
// new SimpleInstruction(InstructionConstants.OP_IAND),
1582
// },
1583
// },
1584
{ // ... % 1L = 0L
1585
{
1586                new SimpleInstruction(InstructionConstants.OP_LCONST_1),
1587                new SimpleInstruction(InstructionConstants.OP_LREM),
1588            },{
1589                new SimpleInstruction(InstructionConstants.OP_POP2),
1590                new SimpleInstruction(InstructionConstants.OP_LCONST_0),
1591            },
1592        },
1593        { // ... % 1f = 0f
1594
{
1595                new SimpleInstruction(InstructionConstants.OP_FCONST_1),
1596                new SimpleInstruction(InstructionConstants.OP_FREM),
1597            },{
1598                new SimpleInstruction(InstructionConstants.OP_POP),
1599                new SimpleInstruction(InstructionConstants.OP_FCONST_0),
1600            },
1601        },
1602        { // ... % 1d = 0d
1603
{
1604                new SimpleInstruction(InstructionConstants.OP_DCONST_1),
1605                new SimpleInstruction(InstructionConstants.OP_DREM),
1606            },{
1607                new SimpleInstruction(InstructionConstants.OP_POP2),
1608                new SimpleInstruction(InstructionConstants.OP_DCONST_0),
1609            },
1610        },
1611        { // -(-...) = ...
1612
{
1613                new SimpleInstruction(InstructionConstants.OP_INEG),
1614                new SimpleInstruction(InstructionConstants.OP_INEG),
1615            },{
1616                // Nothing.
1617
},
1618        },
1619        { // -(-...) = ...
1620
{
1621                new SimpleInstruction(InstructionConstants.OP_LNEG),
1622                new SimpleInstruction(InstructionConstants.OP_LNEG),
1623            },{
1624                // Nothing.
1625
},
1626        },
1627        { // -(-...) = ...
1628
{
1629                new SimpleInstruction(InstructionConstants.OP_FNEG),
1630                new SimpleInstruction(InstructionConstants.OP_FNEG),
1631            },{
1632                // Nothing.
1633
},
1634        },
1635        { // -(-...) = ...
1636
{
1637                new SimpleInstruction(InstructionConstants.OP_DNEG),
1638                new SimpleInstruction(InstructionConstants.OP_DNEG),
1639            },{
1640                // Nothing.
1641
},
1642        },
1643        { // +(-...) = -...
1644
{
1645                new SimpleInstruction(InstructionConstants.OP_INEG),
1646                new SimpleInstruction(InstructionConstants.OP_IADD),
1647            },{
1648                new SimpleInstruction(InstructionConstants.OP_ISUB),
1649            },
1650        },
1651        { // +(-...) = -...
1652
{
1653                new SimpleInstruction(InstructionConstants.OP_LNEG),
1654                new SimpleInstruction(InstructionConstants.OP_LADD),
1655            },{
1656                new SimpleInstruction(InstructionConstants.OP_LSUB),
1657            },
1658        },
1659        { // +(-...) = -...
1660
{
1661                new SimpleInstruction(InstructionConstants.OP_FNEG),
1662                new SimpleInstruction(InstructionConstants.OP_FADD),
1663            },{
1664                new SimpleInstruction(InstructionConstants.OP_FSUB),
1665            },
1666        },
1667        { // +(-...) = -...
1668
{
1669                new SimpleInstruction(InstructionConstants.OP_DNEG),
1670                new SimpleInstruction(InstructionConstants.OP_DADD),
1671            },{
1672                new SimpleInstruction(InstructionConstants.OP_DSUB),
1673            },
1674        },
1675        { // ... << 0 = ...
1676
{
1677                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1678                new SimpleInstruction(InstructionConstants.OP_ISHL),
1679            },{
1680                // Nothing.
1681
},
1682        },
1683        { // ... << 0 = ...
1684
{
1685                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1686                new SimpleInstruction(InstructionConstants.OP_LSHL),
1687            },{
1688                // Nothing.
1689
},
1690        },
1691        { // ... >> 0 = ...
1692
{
1693                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1694                new SimpleInstruction(InstructionConstants.OP_ISHR),
1695            },{
1696                // Nothing.
1697
},
1698        },
1699        { // ... >> 0 = ...
1700
{
1701                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1702                new SimpleInstruction(InstructionConstants.OP_LSHR),
1703            },{
1704                // Nothing.
1705
},
1706        },
1707        { // ... >>> 0 = ...
1708
{
1709                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1710                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1711            },{
1712                // Nothing.
1713
},
1714        },
1715        { // ... >>> 0 = ...
1716
{
1717                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1718                new SimpleInstruction(InstructionConstants.OP_LUSHR),
1719            },{
1720                // Nothing.
1721
},
1722        },
1723        { // ... & -1 = ...
1724
{
1725                new SimpleInstruction(InstructionConstants.OP_ICONST_M1),
1726                new SimpleInstruction(InstructionConstants.OP_IAND),
1727            },{
1728                // Nothing.
1729
},
1730        },
1731        { // ... & 0 = 0
1732
{
1733                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1734                new SimpleInstruction(InstructionConstants.OP_IAND),
1735            },{
1736                new SimpleInstruction(InstructionConstants.OP_POP),
1737                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1738            },
1739        },
1740        { // ... & -1L = ...
1741
{
1742                new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_M1),
1743                new SimpleInstruction(InstructionConstants.OP_LAND),
1744            },{
1745                // Nothing.
1746
},
1747        },
1748        { // ... & 0L = 0L
1749
{
1750                new SimpleInstruction(InstructionConstants.OP_LCONST_0),
1751                new SimpleInstruction(InstructionConstants.OP_LAND),
1752            },{
1753                new SimpleInstruction(InstructionConstants.OP_POP2),
1754                new SimpleInstruction(InstructionConstants.OP_LCONST_0),
1755            },
1756        },
1757        { // ... | -1 = -1
1758
{
1759                new SimpleInstruction(InstructionConstants.OP_ICONST_M1),
1760                new SimpleInstruction(InstructionConstants.OP_IOR),
1761            },{
1762                new SimpleInstruction(InstructionConstants.OP_POP),
1763                new SimpleInstruction(InstructionConstants.OP_ICONST_M1),
1764            },
1765        },
1766        { // ... | 0 = ...
1767
{
1768               new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1769               new SimpleInstruction(InstructionConstants.OP_IOR),
1770           },{
1771                // Nothing.
1772
},
1773        },
1774        { // ... | -1L = -1L
1775
{
1776                new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_M1),
1777                new SimpleInstruction(InstructionConstants.OP_LAND),
1778            },{
1779                new SimpleInstruction(InstructionConstants.OP_POP2),
1780                new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_M1),
1781            },
1782        },
1783        { // ... | 0L = ...
1784
{
1785                new SimpleInstruction(InstructionConstants.OP_LCONST_0),
1786                new SimpleInstruction(InstructionConstants.OP_LOR),
1787            },{
1788                // Nothing.
1789
},
1790        },
1791        { // ... ^ 0 = ...
1792
{
1793                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
1794                new SimpleInstruction(InstructionConstants.OP_IXOR),
1795            },{
1796                // Nothing.
1797
},
1798        },
1799        { // ... ^ 0L = ...
1800
{
1801                new SimpleInstruction(InstructionConstants.OP_LCONST_0),
1802                new SimpleInstruction(InstructionConstants.OP_LXOR),
1803            },{
1804                // Nothing.
1805
},
1806        },
1807        { // (byte)(... & 0x000000ff) = (byte)...
1808
{
1809                new SimpleInstruction(InstructionConstants.OP_SIPUSH, 0xff),
1810                new SimpleInstruction(InstructionConstants.OP_IAND),
1811                new SimpleInstruction(InstructionConstants.OP_I2B),
1812            },{
1813                new SimpleInstruction(InstructionConstants.OP_I2B),
1814            },
1815        },
1816        { // (byte)((... & 0x0000ff00) >> 8) = (byte)(... >> 8)
1817
{
1818                new ConstantInstruction(InstructionConstants.OP_LDC, I_0x0000ff00),
1819                new SimpleInstruction(InstructionConstants.OP_IAND),
1820                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
1821                new SimpleInstruction(InstructionConstants.OP_ISHR),
1822                new SimpleInstruction(InstructionConstants.OP_I2B),
1823            },{
1824                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
1825                new SimpleInstruction(InstructionConstants.OP_ISHR),
1826                new SimpleInstruction(InstructionConstants.OP_I2B),
1827            },
1828        },
1829        { // (byte)((... & 0x0000ff00) >>> 8) = (byte)(... >>> 8)
1830
{
1831                new ConstantInstruction(InstructionConstants.OP_LDC, I_0x0000ff00),
1832                new SimpleInstruction(InstructionConstants.OP_IAND),
1833                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
1834                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1835                new SimpleInstruction(InstructionConstants.OP_I2B),
1836            },{
1837                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 8),
1838                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1839                new SimpleInstruction(InstructionConstants.OP_I2B),
1840            },
1841        },
1842        { // (byte)((... & 0x00ff0000) >> 16) = (byte)(... >> 16)
1843
{
1844                new ConstantInstruction(InstructionConstants.OP_LDC, I_0x00ff0000),
1845                new SimpleInstruction(InstructionConstants.OP_IAND),
1846                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1847                new SimpleInstruction(InstructionConstants.OP_ISHR),
1848                new SimpleInstruction(InstructionConstants.OP_I2B),
1849            },{
1850                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1851                new SimpleInstruction(InstructionConstants.OP_ISHR),
1852                new SimpleInstruction(InstructionConstants.OP_I2B),
1853            },
1854        },
1855        { // (byte)((... & 0x00ff0000) >>> 16) = (byte)(... >>> 16)
1856
{
1857                new ConstantInstruction(InstructionConstants.OP_LDC, I_0x00ff0000),
1858                new SimpleInstruction(InstructionConstants.OP_IAND),
1859                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1860                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1861                new SimpleInstruction(InstructionConstants.OP_I2B),
1862            },{
1863                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1864                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1865                new SimpleInstruction(InstructionConstants.OP_I2B),
1866            },
1867        },
1868        { // (... & 0xff000000) >> 24 = ... >> 24
1869
{
1870                new ConstantInstruction(InstructionConstants.OP_LDC, I_0xff000000),
1871                new SimpleInstruction(InstructionConstants.OP_IAND),
1872                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1873                new SimpleInstruction(InstructionConstants.OP_ISHR),
1874            },{
1875                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1876                new SimpleInstruction(InstructionConstants.OP_ISHR),
1877            },
1878        },
1879        { // (... & 0xff000000) >>> 24 = ... >>> 24
1880
{
1881                new ConstantInstruction(InstructionConstants.OP_LDC, I_0xff000000),
1882                new SimpleInstruction(InstructionConstants.OP_IAND),
1883                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1884                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1885            },{
1886                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1887                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1888            },
1889        },
1890        { // (char)(... & 0x0000ffff) = (char)...
1891
{
1892                new ConstantInstruction(InstructionConstants.OP_LDC, I_0x0000ffff),
1893                new SimpleInstruction(InstructionConstants.OP_IAND),
1894                new SimpleInstruction(InstructionConstants.OP_I2C),
1895            },{
1896                new SimpleInstruction(InstructionConstants.OP_I2C),
1897            },
1898        },
1899        { // (short)(... & 0x0000ffff) = (short)...
1900
{
1901                new ConstantInstruction(InstructionConstants.OP_LDC, I_0x0000ffff),
1902                new SimpleInstruction(InstructionConstants.OP_IAND),
1903                new SimpleInstruction(InstructionConstants.OP_I2S),
1904            },{
1905                new SimpleInstruction(InstructionConstants.OP_I2S),
1906            },
1907        },
1908        { // (... & 0xffff0000) >> 16 = ... >> 16
1909
{
1910                new ConstantInstruction(InstructionConstants.OP_LDC, I_0xffff0000),
1911                new SimpleInstruction(InstructionConstants.OP_IAND),
1912                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1913                new SimpleInstruction(InstructionConstants.OP_ISHR),
1914            },{
1915                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1916                new SimpleInstruction(InstructionConstants.OP_ISHR),
1917            },
1918        },
1919        { // (... & 0xffff0000) >>> 16 = ... >>> 16
1920
{
1921                new ConstantInstruction(InstructionConstants.OP_LDC, I_0xffff0000),
1922                new SimpleInstruction(InstructionConstants.OP_IAND),
1923                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1924                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1925            },{
1926                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1927                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1928            },
1929        },
1930        { // (byte)(... >> 24) = ... >> 24
1931
{
1932                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1933                new SimpleInstruction(InstructionConstants.OP_ISHR),
1934                new SimpleInstruction(InstructionConstants.OP_I2B),
1935            },{
1936                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1937                new SimpleInstruction(InstructionConstants.OP_ISHR),
1938            },
1939        },
1940        { // (byte)(... >>> 24) = ... >> 24
1941
{
1942                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1943                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1944                new SimpleInstruction(InstructionConstants.OP_I2B),
1945            },{
1946                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1947                new SimpleInstruction(InstructionConstants.OP_ISHR),
1948            },
1949        },
1950        { // (char)(... >> 16) = ... >>> 16
1951
{
1952                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1953                new SimpleInstruction(InstructionConstants.OP_ISHR),
1954                new SimpleInstruction(InstructionConstants.OP_I2C),
1955            },{
1956                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1957                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1958            },
1959        },
1960        { // (char)(... >>> 16) = ... >>> 16
1961
{
1962                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1963                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1964                new SimpleInstruction(InstructionConstants.OP_I2C),
1965            },{
1966                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1967                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1968            },
1969        },
1970        { // (short)(... >> 16) = ... >> 16
1971
{
1972                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1973                new SimpleInstruction(InstructionConstants.OP_ISHR),
1974                new SimpleInstruction(InstructionConstants.OP_I2S),
1975            },{
1976                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1977                new SimpleInstruction(InstructionConstants.OP_ISHR),
1978            },
1979        },
1980        { // (short)(... >>> 16) = ... >> 16
1981
{
1982                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1983                new SimpleInstruction(InstructionConstants.OP_IUSHR),
1984                new SimpleInstruction(InstructionConstants.OP_I2S),
1985            },{
1986                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
1987                new SimpleInstruction(InstructionConstants.OP_ISHR),
1988            },
1989        },
1990        { // ... << 24 >> 24 = (byte)...
1991
{
1992                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1993                new SimpleInstruction(InstructionConstants.OP_ISHL),
1994                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 24),
1995                new SimpleInstruction(InstructionConstants.OP_ISHR),
1996            },{
1997                new SimpleInstruction(InstructionConstants.OP_I2B),
1998            },
1999        },
2000        { // ... << 16 >>> 16 = (char)...
2001
{
2002                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
2003                new SimpleInstruction(InstructionConstants.OP_ISHL),
2004                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
2005                new SimpleInstruction(InstructionConstants.OP_IUSHR),
2006            },{
2007                new SimpleInstruction(InstructionConstants.OP_I2C),
2008            },
2009        },
2010        { // ... << 16 >> 16 = (short)...
2011
{
2012                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
2013                new SimpleInstruction(InstructionConstants.OP_ISHL),
2014                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 16),
2015                new SimpleInstruction(InstructionConstants.OP_ISHR),
2016            },{
2017                new SimpleInstruction(InstructionConstants.OP_I2S),
2018            },
2019        },
2020        { // ... << 32 >> 32 = (long)(int)...
2021
{
2022                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
2023                new SimpleInstruction(InstructionConstants.OP_LSHL),
2024                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
2025                new SimpleInstruction(InstructionConstants.OP_LSHR),
2026            },{
2027                new SimpleInstruction(InstructionConstants.OP_L2I),
2028                new SimpleInstruction(InstructionConstants.OP_I2L),
2029            },
2030        },
2031        { // (int)(... & 0x00000000ffffffffL) = (int)...
2032
{
2033                new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_0x00000000ffffffff),
2034                new SimpleInstruction(InstructionConstants.OP_LAND),
2035                new SimpleInstruction(InstructionConstants.OP_L2I),
2036            },{
2037                new SimpleInstruction(InstructionConstants.OP_L2I),
2038            },
2039        },
2040        { // (... & 0xffffffff00000000L) >> 32 = ... >> 32
2041
{
2042                new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_0xffffffff00000000),
2043                new SimpleInstruction(InstructionConstants.OP_LAND),
2044                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
2045                new SimpleInstruction(InstructionConstants.OP_LSHR),
2046            },{
2047                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
2048                new SimpleInstruction(InstructionConstants.OP_LSHR),
2049            },
2050        },
2051        { // (... & 0xffffffff00000000L) >>> 32 = ... >>> 32
2052
{
2053                new ConstantInstruction(InstructionConstants.OP_LDC2_W, L_0xffffffff00000000),
2054                new SimpleInstruction(InstructionConstants.OP_LAND),
2055                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
2056                new SimpleInstruction(InstructionConstants.OP_LUSHR),
2057            },{
2058                new SimpleInstruction(InstructionConstants.OP_BIPUSH, 32),
2059                new SimpleInstruction(InstructionConstants.OP_LUSHR),
2060            },
2061        },
2062        { // ... += 0 = nothing
2063
{
2064                new VariableInstruction(InstructionConstants.OP_IINC, X, 0),
2065            },{
2066                // Nothing.
2067
},
2068        },
2069        { // getfield/putfield = nothing
2070
{
2071                new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2072                new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2073                new ConstantInstruction(InstructionConstants.OP_GETFIELD, Y),
2074                new ConstantInstruction(InstructionConstants.OP_PUTFIELD, Y),
2075            },{
2076                // Nothing.
2077
},
2078        },
2079// { // putfield_L/putfield_L = pop2_x1/putfield
2080
// {
2081
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2082
// // ...
2083
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_L),
2084
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2085
// // ...
2086
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_L),
2087
// },{
2088
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2089
// // ...
2090
// new SimpleInstruction(InstructionConstants.OP_POP2),
2091
// // ...
2092
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_L),
2093
// },
2094
// },
2095
// { // putfield_D/putfield_D = pop2_x1/putfield
2096
// {
2097
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2098
// // ...
2099
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_D),
2100
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2101
// // ...
2102
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_D),
2103
// },{
2104
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2105
// // ...
2106
// new SimpleInstruction(InstructionConstants.OP_POP2),
2107
// // ...
2108
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_D),
2109
// },
2110
// },
2111
// { // putfield/putfield = pop_x1/putfield
2112
// {
2113
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2114
// // ...
2115
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, Y),
2116
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2117
// // ...
2118
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, Y),
2119
// },{
2120
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2121
// // ...
2122
// new SimpleInstruction(InstructionConstants.OP_POP),
2123
// // ...
2124
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, Y),
2125
// },
2126
// },
2127
// { // putfield_L/getfield_L = dup2_x1/putfield
2128
// {
2129
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2130
// // ...
2131
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_L),
2132
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2133
// new ConstantInstruction(InstructionConstants.OP_GETFIELD, FIELD_L),
2134
// },{
2135
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2136
// // ...
2137
// new SimpleInstruction(InstructionConstants.OP_DUP2_X1),
2138
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_L),
2139
// },
2140
// },
2141
// { // putfield_D/getfield_D = dup2_x1/putfield
2142
// {
2143
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2144
// // ...
2145
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_D),
2146
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2147
// new ConstantInstruction(InstructionConstants.OP_GETFIELD, FIELD_D),
2148
// },{
2149
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2150
// // ...
2151
// new SimpleInstruction(InstructionConstants.OP_DUP2_X1),
2152
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, FIELD_D),
2153
// },
2154
// },
2155
// { // putfield/getfield = dup_x1/putfield
2156
// {
2157
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2158
// // ...
2159
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, Y),
2160
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2161
// new ConstantInstruction(InstructionConstants.OP_GETFIELD, Y),
2162
// },{
2163
// new VariableInstruction(InstructionConstants.OP_ALOAD, X),
2164
// // ...
2165
// new SimpleInstruction(InstructionConstants.OP_DUP_X1),
2166
// new ConstantInstruction(InstructionConstants.OP_PUTFIELD, Y),
2167
// },
2168
// },
2169
{ // getstatic/putstatic = nothing
2170
{
2171                new ConstantInstruction(InstructionConstants.OP_GETSTATIC, X),
2172                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, X),
2173            },{
2174                // Nothing.
2175
},
2176        },
2177        { // putstatic_L/putstatic_L = pop2/putstatic
2178
{
2179                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_L),
2180                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_L),
2181            },{
2182                new SimpleInstruction(InstructionConstants.OP_POP2),
2183                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_L),
2184            },
2185        },
2186        { // putstatic_D/putstatic_D = pop2/putstatic
2187
{
2188                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_D),
2189                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_D),
2190            },{
2191                new SimpleInstruction(InstructionConstants.OP_POP2),
2192                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_D),
2193            },
2194        },
2195        { // putstatic/putstatic = pop/putstatic
2196
{
2197                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, X),
2198                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, X),
2199            },{
2200                new SimpleInstruction(InstructionConstants.OP_POP),
2201                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, X),
2202            },
2203        },
2204        { // putstatic_L/getstatic_L = dup2/putstatic
2205
{
2206                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_L),
2207                new ConstantInstruction(InstructionConstants.OP_GETSTATIC, FIELD_L),
2208            },{
2209                new SimpleInstruction(InstructionConstants.OP_DUP2),
2210                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_L),
2211            },
2212        },
2213        { // putstatic_D/getstatic_D = dup2/putstatic
2214
{
2215                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_D),
2216                new ConstantInstruction(InstructionConstants.OP_GETSTATIC, FIELD_D),
2217            },{
2218                new SimpleInstruction(InstructionConstants.OP_DUP2),
2219                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, FIELD_D),
2220            },
2221        },
2222        { // putstatic/getstatic = dup/putstatic
2223
{
2224                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, X),
2225                new ConstantInstruction(InstructionConstants.OP_GETSTATIC, X),
2226            },{
2227                new SimpleInstruction(InstructionConstants.OP_DUP),
2228                new ConstantInstruction(InstructionConstants.OP_PUTSTATIC, X),
2229            },
2230        },
2231        { // (byte)(byte)... = (byte)...
2232
{
2233                new SimpleInstruction(InstructionConstants.OP_I2B),
2234                new SimpleInstruction(InstructionConstants.OP_I2B),
2235            },{
2236                new SimpleInstruction(InstructionConstants.OP_I2B),
2237            },
2238        },
2239        { // (byte)(char)... = (byte)...
2240
{
2241                new SimpleInstruction(InstructionConstants.OP_I2C),
2242                new SimpleInstruction(InstructionConstants.OP_I2B),
2243            },{
2244                new SimpleInstruction(InstructionConstants.OP_I2B),
2245            },
2246        },
2247        { // (byte)(short)... = (byte)...
2248
{
2249                new SimpleInstruction(InstructionConstants.OP_I2S),
2250                new SimpleInstruction(InstructionConstants.OP_I2B),
2251            },{
2252                new SimpleInstruction(InstructionConstants.OP_I2B),
2253            },
2254        },
2255        { // (char)(char)... = (char)...
2256
{
2257                new SimpleInstruction(InstructionConstants.OP_I2C),
2258                new SimpleInstruction(InstructionConstants.OP_I2C),
2259            },{
2260                new SimpleInstruction(InstructionConstants.OP_I2C),
2261            },
2262        },
2263        { // (char)(short)... = (char)...
2264
{
2265                new SimpleInstruction(InstructionConstants.OP_I2S),
2266                new SimpleInstruction(InstructionConstants.OP_I2C),
2267            },{
2268                new SimpleInstruction(InstructionConstants.OP_I2C),
2269            },
2270        },
2271        { // (short)(byte)... = (byte)...
2272
{
2273                new SimpleInstruction(InstructionConstants.OP_I2B),
2274                new SimpleInstruction(InstructionConstants.OP_I2S),
2275            },{
2276                new SimpleInstruction(InstructionConstants.OP_I2B),
2277            },
2278        },
2279        { // (short)(char)... = (short)...
2280
{
2281                new SimpleInstruction(InstructionConstants.OP_I2C),
2282                new SimpleInstruction(InstructionConstants.OP_I2S),
2283            },{
2284                new SimpleInstruction(InstructionConstants.OP_I2S),
2285            },
2286        },
2287        { // (short)(short)... = (short)...
2288
{
2289                new SimpleInstruction(InstructionConstants.OP_I2S),
2290                new SimpleInstruction(InstructionConstants.OP_I2S),
2291            },{
2292                new SimpleInstruction(InstructionConstants.OP_I2S),
2293            },
2294        },
2295        { // (int)(long)... = ...
2296
{
2297                new SimpleInstruction(InstructionConstants.OP_I2L),
2298                new SimpleInstruction(InstructionConstants.OP_L2I),
2299            },{
2300                // Nothing.
2301
},
2302        },
2303        // Not handled correctly in all cases by VMs prior to Java 6...
2304
// { // (byte)bytes[...] = bytes[...]
2305
// {
2306
// new SimpleInstruction(InstructionConstants.OP_BALOAD),
2307
// new SimpleInstruction(InstructionConstants.OP_I2B),
2308
// },{
2309
// new SimpleInstruction(InstructionConstants.OP_BALOAD),
2310
// },
2311
// },
2312
// { // (short)bytes[...] = bytes[...]
2313
// {
2314
// new SimpleInstruction(InstructionConstants.OP_BALOAD),
2315
// new SimpleInstruction(InstructionConstants.OP_I2S),
2316
// },{
2317
// new SimpleInstruction(InstructionConstants.OP_BALOAD),
2318
// },
2319
// },
2320
// { // (char)chars[...] = chars[...]
2321
// {
2322
// new SimpleInstruction(InstructionConstants.OP_CALOAD),
2323
// new SimpleInstruction(InstructionConstants.OP_I2C),
2324
// },{
2325
// new SimpleInstruction(InstructionConstants.OP_CALOAD),
2326
// },
2327
// },
2328
// { // (short)shorts[...] = shorts[...]
2329
// {
2330
// new SimpleInstruction(InstructionConstants.OP_SALOAD),
2331
// new SimpleInstruction(InstructionConstants.OP_I2S),
2332
// },{
2333
// new SimpleInstruction(InstructionConstants.OP_SALOAD),
2334
// },
2335
// },
2336
// { // bytes[...] = (byte)... = bytes[...] = ...
2337
// {
2338
// new SimpleInstruction(InstructionConstants.OP_I2B),
2339
// new SimpleInstruction(InstructionConstants.OP_BASTORE),
2340
// },{
2341
// new SimpleInstruction(InstructionConstants.OP_BASTORE),
2342
// },
2343
// },
2344
// { // chars[...] = (char)... = chars[...] = ...
2345
// {
2346
// new SimpleInstruction(InstructionConstants.OP_I2C),
2347
// new SimpleInstruction(InstructionConstants.OP_CASTORE),
2348
// },{
2349
// new SimpleInstruction(InstructionConstants.OP_CASTORE),
2350
// },
2351
// },
2352
// { // shorts[...] = (short)... = shorts[...] = ...
2353
// {
2354
// new SimpleInstruction(InstructionConstants.OP_I2S),
2355
// new SimpleInstruction(InstructionConstants.OP_SASTORE),
2356
// },{
2357
// new SimpleInstruction(InstructionConstants.OP_SASTORE),
2358
// },
2359
// },
2360
{ // goto +3 = nothing
2361
{
2362                new BranchInstruction(InstructionConstants.OP_GOTO, 3),
2363            },{
2364                // Nothing.
2365
},
2366        },
2367        { // ifeq +3 = pop
2368
{
2369                new BranchInstruction(InstructionConstants.OP_IFEQ, 3),
2370            },{
2371                new SimpleInstruction(InstructionConstants.OP_POP),
2372            },
2373        },
2374        { // ifne +3 = pop
2375
{
2376                new BranchInstruction(InstructionConstants.OP_IFNE, 3),
2377            },{
2378                new SimpleInstruction(InstructionConstants.OP_POP),
2379            },
2380        },
2381        { // iflt +3 = pop
2382
{
2383                new BranchInstruction(InstructionConstants.OP_IFLT, 3),
2384            },{
2385                new SimpleInstruction(InstructionConstants.OP_POP),
2386            },
2387        },
2388        { // ifge +3 = pop
2389
{
2390                new BranchInstruction(InstructionConstants.OP_IFGE, 3),
2391            },{
2392                new SimpleInstruction(InstructionConstants.OP_POP),
2393            },
2394        },
2395        { // ifgt +3 = pop
2396
{
2397                new BranchInstruction(InstructionConstants.OP_IFGT, 3),
2398            },{
2399                new SimpleInstruction(InstructionConstants.OP_POP),
2400            },
2401        },
2402        { // ifle +3 = pop
2403
{
2404                new BranchInstruction(InstructionConstants.OP_IFLE, 3),
2405            },{
2406                new SimpleInstruction(InstructionConstants.OP_POP),
2407            },
2408        },
2409        { // ificmpeq +3 = pop2
2410
{
2411                new BranchInstruction(InstructionConstants.OP_IFICMPEQ, 3),
2412            },{
2413                new SimpleInstruction(InstructionConstants.OP_POP2),
2414            },
2415        },
2416        { // ificmpne +3 = pop2
2417
{
2418                new BranchInstruction(InstructionConstants.OP_IFICMPNE, 3),
2419            },{
2420                new SimpleInstruction(InstructionConstants.OP_POP2),
2421            },
2422        },
2423        { // ificmplt +3 = pop2
2424
{
2425                new BranchInstruction(InstructionConstants.OP_IFICMPLT, 3),
2426            },{
2427                new SimpleInstruction(InstructionConstants.OP_POP2),
2428            },
2429        },
2430        { // ificmpge +3 = pop2
2431
{
2432                new BranchInstruction(InstructionConstants.OP_IFICMPGE, 3),
2433            },{
2434                new SimpleInstruction(InstructionConstants.OP_POP2),
2435            },
2436        },
2437        { // ificmpgt +3 = pop2
2438
{
2439                new BranchInstruction(InstructionConstants.OP_IFICMPGT, 3),
2440            },{
2441                new SimpleInstruction(InstructionConstants.OP_POP2),
2442            },
2443        },
2444        { // ificmple +3 = pop2
2445
{
2446                new BranchInstruction(InstructionConstants.OP_IFICMPLE, 3),
2447            },{
2448                new SimpleInstruction(InstructionConstants.OP_POP2),
2449            },
2450        },
2451        { // ifacmpeq +3 = pop2
2452
{
2453                new BranchInstruction(InstructionConstants.OP_IFACMPEQ, 3),
2454            },{
2455                new SimpleInstruction(InstructionConstants.OP_POP2),
2456            },
2457        },
2458        { // ifacmpne +3 = pop2
2459
{
2460                new BranchInstruction(InstructionConstants.OP_IFACMPNE, 3),
2461            },{
2462                new SimpleInstruction(InstructionConstants.OP_POP2),
2463            },
2464        },
2465        { // ifnull +3 = pop
2466
{
2467                new BranchInstruction(InstructionConstants.OP_IFNULL, 3),
2468            },{
2469                new SimpleInstruction(InstructionConstants.OP_POP),
2470            },
2471        },
2472        { // ifnonnull +3 = pop
2473
{
2474                new BranchInstruction(InstructionConstants.OP_IFNONNULL, 3),
2475            },{
2476                new SimpleInstruction(InstructionConstants.OP_POP),
2477            },
2478        },
2479        { // if (... == 0) = ifeq
2480
{
2481                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2482                new BranchInstruction(InstructionConstants.OP_IFICMPEQ, X),
2483            },{
2484                new BranchInstruction(InstructionConstants.OP_IFEQ, X),
2485            },
2486        },
2487        { // if (... != 0) = ifne
2488
{
2489                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2490                new BranchInstruction(InstructionConstants.OP_IFICMPNE, X),
2491            },{
2492                new BranchInstruction(InstructionConstants.OP_IFNE, X),
2493            },
2494        },
2495        { // if (... < 0) = iflt
2496
{
2497                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2498                new BranchInstruction(InstructionConstants.OP_IFICMPLT, X),
2499            },{
2500                new BranchInstruction(InstructionConstants.OP_IFLT, X),
2501            },
2502        },
2503        { // if (... >= 0) = ifge
2504
{
2505                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2506                new BranchInstruction(InstructionConstants.OP_IFICMPGE, X),
2507            },{
2508                new BranchInstruction(InstructionConstants.OP_IFGE, X),
2509            },
2510        },
2511        { // if (... > 0) = ifgt
2512
{
2513                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2514                new BranchInstruction(InstructionConstants.OP_IFICMPGT, X),
2515            },{
2516                new BranchInstruction(InstructionConstants.OP_IFGT, X),
2517            },
2518        },
2519        { // if (... <= 0) = ifle
2520
{
2521                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2522                new BranchInstruction(InstructionConstants.OP_IFICMPLE, X),
2523            },{
2524                new BranchInstruction(InstructionConstants.OP_IFLE, X),
2525            },
2526        },
2527        { // if (... == null) = ifnull
2528
{
2529                new SimpleInstruction(InstructionConstants.OP_ACONST_NULL),
2530                new BranchInstruction(InstructionConstants.OP_IFACMPEQ, X),
2531            },{
2532                new BranchInstruction(InstructionConstants.OP_IFNULL, X),
2533            },
2534        },
2535        { // if (... != null) = ifnonnull
2536
{
2537                new SimpleInstruction(InstructionConstants.OP_ACONST_NULL),
2538                new BranchInstruction(InstructionConstants.OP_IFACMPNE, X),
2539            },{
2540                new BranchInstruction(InstructionConstants.OP_IFNONNULL, X),
2541            },
2542        },
2543        { // iconst_0/ifeq = goto
2544
{
2545                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2546                new BranchInstruction(InstructionConstants.OP_IFEQ, X),
2547            },{
2548                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2549            },
2550        },
2551        { // iconst/ifeq = nothing
2552
{
2553                new SimpleInstruction(InstructionConstants.OP_ICONST_0, A),
2554                new BranchInstruction(InstructionConstants.OP_IFEQ, X),
2555            },{
2556                // Nothing.
2557
},
2558        },
2559        { // bipush/ifeq = nothing
2560
{
2561                new SimpleInstruction(InstructionConstants.OP_BIPUSH, A),
2562                new BranchInstruction(InstructionConstants.OP_IFEQ, X),
2563            },{
2564                // Nothing.
2565
},
2566        },
2567        { // sipush/ifeq = nothing
2568
{
2569                new SimpleInstruction(InstructionConstants.OP_SIPUSH, A),
2570                new BranchInstruction(InstructionConstants.OP_IFEQ, X),
2571            },{
2572                // Nothing.
2573
},
2574        },
2575        { // iconst_0/ifne = nothing
2576
{
2577                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2578                new BranchInstruction(InstructionConstants.OP_IFNE, X),
2579            },{
2580                // Nothing.
2581
},
2582        },
2583        { // iconst/ifne = goto
2584
{
2585                new SimpleInstruction(InstructionConstants.OP_ICONST_0, A),
2586                new BranchInstruction(InstructionConstants.OP_IFNE, X),
2587            },{
2588                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2589            },
2590        },
2591        { // bipush/ifne = goto
2592
{
2593                new SimpleInstruction(InstructionConstants.OP_BIPUSH, A),
2594                new BranchInstruction(InstructionConstants.OP_IFNE, X),
2595            },{
2596                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2597            },
2598        },
2599        { // sipush/ifne = goto
2600
{
2601                new SimpleInstruction(InstructionConstants.OP_SIPUSH, A),
2602                new BranchInstruction(InstructionConstants.OP_IFNE, X),
2603            },{
2604                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2605            },
2606        },
2607        { // iconst_0/iflt = nothing
2608
{
2609                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2610                new BranchInstruction(InstructionConstants.OP_IFLT, X),
2611            },{
2612                // Nothing.
2613
},
2614        },
2615        { // iconst_0/ifge = goto
2616
{
2617                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2618                new BranchInstruction(InstructionConstants.OP_IFGE, X),
2619            },{
2620                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2621            },
2622        },
2623        { // iconst_0/ifgt = nothing
2624
{
2625                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2626                new BranchInstruction(InstructionConstants.OP_IFGT, X),
2627            },{
2628                // Nothing.
2629
},
2630        },
2631        { // iconst_0/ifle = goto
2632
{
2633                new SimpleInstruction(InstructionConstants.OP_ICONST_0),
2634                new BranchInstruction(InstructionConstants.OP_IFLE, X),
2635            },{
2636                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2637            },
2638        },
2639        { // aconst_null/ifnull = goto
2640
{
2641                new SimpleInstruction(InstructionConstants.OP_ACONST_NULL),
2642                new BranchInstruction(InstructionConstants.OP_IFNULL, X),
2643            },{
2644                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2645            },
2646        },
2647        { // aconst_null/ifnonnul = nothing
2648
{
2649                new SimpleInstruction(InstructionConstants.OP_ACONST_NULL),
2650                new BranchInstruction(InstructionConstants.OP_IFNONNULL, X),
2651            },{
2652                // Nothing.
2653
},
2654        },
2655        { // ifeq/goto = ifne
2656
{
2657                new BranchInstruction(InstructionConstants.OP_IFEQ, 6),
2658                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2659            },{
2660                new BranchInstruction(InstructionConstants.OP_IFNE, X),
2661            },
2662        },
2663        { // ifne/goto = ifeq
2664
{
2665                new BranchInstruction(InstructionConstants.OP_IFNE, 6),
2666                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2667            },{
2668                new BranchInstruction(InstructionConstants.OP_IFEQ, X),
2669            },
2670        },
2671        { // iflt/goto = ifge
2672
{
2673                new BranchInstruction(InstructionConstants.OP_IFLT, 6),
2674                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2675            },{
2676                new BranchInstruction(InstructionConstants.OP_IFGE, X),
2677            },
2678        },
2679        { // ifge/goto = iflt
2680
{
2681                new BranchInstruction(InstructionConstants.OP_IFGE, 6),
2682                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2683            },{
2684                new BranchInstruction(InstructionConstants.OP_IFLT, X),
2685            },
2686        },
2687        { // ifgt/goto = ifle
2688
{
2689                new BranchInstruction(InstructionConstants.OP_IFGT, 6),
2690                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2691            },{
2692                new BranchInstruction(InstructionConstants.OP_IFLE, X),
2693            },
2694        },
2695        { // ifle/goto = ifgt
2696
{
2697                new BranchInstruction(InstructionConstants.OP_IFLE, 6),
2698                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2699            },{
2700                new BranchInstruction(InstructionConstants.OP_IFGT, X),
2701            },
2702        },
2703        { // ificmpeq/goto = ificmpne
2704
{
2705                new BranchInstruction(InstructionConstants.OP_IFICMPEQ, 6),
2706                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2707            },{
2708                new BranchInstruction(InstructionConstants.OP_IFICMPNE, X),
2709            },
2710        },
2711        { // ificmpne/goto = ificmpeq
2712
{
2713                new BranchInstruction(InstructionConstants.OP_IFICMPNE, 6),
2714                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2715            },{
2716                new BranchInstruction(InstructionConstants.OP_IFICMPEQ, X),
2717            },
2718        },
2719        { // ificmplt/goto = ificmpge
2720
{
2721                new BranchInstruction(InstructionConstants.OP_IFICMPLT, 6),
2722                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2723            },{
2724                new BranchInstruction(InstructionConstants.OP_IFICMPGE, X),
2725            },
2726        },
2727        { // ificmpge/goto = ificmplt
2728
{
2729                new BranchInstruction(InstructionConstants.OP_IFICMPGE, 6),
2730                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2731            },{
2732                new BranchInstruction(InstructionConstants.OP_IFICMPLT, X),
2733            },
2734        },
2735        { // ificmpgt/goto = ificmple
2736
{
2737                new BranchInstruction(InstructionConstants.OP_IFICMPGT, 6),
2738                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2739            },{
2740                new BranchInstruction(InstructionConstants.OP_IFICMPLE, X),
2741            },
2742        },
2743        { // ificmple/goto = ificmpgt
2744
{
2745                new BranchInstruction(InstructionConstants.OP_IFICMPLE, 6),
2746                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2747            },{
2748                new BranchInstruction(InstructionConstants.OP_IFICMPGT, X),
2749            },
2750        },
2751        { // ifacmpeq/goto = ifacmpne
2752
{
2753                new BranchInstruction(InstructionConstants.OP_IFACMPEQ, 6),
2754                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2755            },{
2756                new BranchInstruction(InstructionConstants.OP_IFACMPNE, X),
2757            },
2758        },
2759        { // ifacmpne/goto = ifacmpeq
2760
{
2761                new BranchInstruction(InstructionConstants.OP_IFACMPNE, 6),
2762                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2763            },{
2764                new BranchInstruction(InstructionConstants.OP_IFACMPEQ, X),
2765            },
2766        },
2767        { // ifnull/goto = ifnonnull
2768
{
2769                new BranchInstruction(InstructionConstants.OP_IFNULL, 6),
2770                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2771            },{
2772                new BranchInstruction(InstructionConstants.OP_IFNONNULL, X),
2773            },
2774        },
2775        { // ifnonnull/goto = ifnull
2776
{
2777                new BranchInstruction(InstructionConstants.OP_IFNONNULL, 6),
2778                new BranchInstruction(InstructionConstants.OP_GOTO, X),
2779            },{
2780                new BranchInstruction(InstructionConstants.OP_IFNULL, X),
2781            },
2782        },
2783
2784// { // switch (...) { default: ... } = goto ...
2785
// {
2786
// new TableSwitchInstruction(InstructionConstants.OP_TABLESWITCH, A, X, Y, 0, new int[0]),
2787
// },{
2788
// new BranchInstruction(InstructionConstants.OP_GOTO, A),
2789
// },
2790
// },
2791
// { // switch (...) { default: ... } = goto ...
2792
// {
2793
// new LookUpSwitchInstruction(InstructionConstants.OP_LOOKUPSWITCH, A, 0, new int[0], new int[0]),
2794
// },{
2795
// new BranchInstruction(InstructionConstants.OP_GOTO, A),
2796
// },
2797
// },
2798
// { // switch (...) { case ...: ... default: ... }
2799
// // = if (... == ...) ... else ...
2800
// {
2801
// new TableSwitchInstruction(InstructionConstants.OP_TABLESWITCH, A, X, Y, 1, new int[] { B }),
2802
// },{
2803
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, X),
2804
// new BranchInstruction(InstructionConstants.OP_IFICMPNE, A),
2805
// new BranchInstruction(InstructionConstants.OP_GOTO, B),
2806
// },
2807
// },
2808
// { // switch (...) { case ...: ... default: ... }
2809
// // = if (... == ...) ... else ...
2810
// {
2811
// new LookUpSwitchInstruction(InstructionConstants.OP_LOOKUPSWITCH, A, 1, new int[] { X }, new int[] { B }),
2812
// },{
2813
// new SimpleInstruction(InstructionConstants.OP_SIPUSH, X),
2814
// new BranchInstruction(InstructionConstants.OP_IFICMPNE, A),
2815
// new BranchInstruction(InstructionConstants.OP_GOTO, B),
2816
// },
2817
// }
2818
};
2819}
Popular Tags