View Javadoc
1   /*
2    * MIT License
3    * Copyright (c) 2006-2025 JMockit developers
4    * See LICENSE file for full license text.
5    */
6   package mockit.asm.jvmConstants;
7   
8   /**
9    * Defines the JVM opcodes. This interface does not define all the JVM opcodes because some opcodes are automatically
10   * handled. For example, the xLOAD and xSTORE opcodes are automatically replaced by xLOAD_n and xSTORE_n opcodes when
11   * possible. The xLOAD_n and xSTORE_n opcodes are therefore not defined in this interface. Likewise for LDC,
12   * automatically replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and JSR_W.
13   */
14  public interface Opcodes {
15      // visitInsn
16      int NOP = 0;
17      int ACONST_NULL = 1;
18      int ICONST_M1 = 2;
19      int ICONST_0 = 3;
20      int ICONST_1 = 4;
21      int ICONST_2 = 5;
22      int ICONST_3 = 6;
23      int ICONST_4 = 7;
24      int ICONST_5 = 8;
25      int LCONST_0 = 9;
26      int LCONST_1 = 10;
27      int FCONST_0 = 11;
28      int FCONST_1 = 12;
29      int FCONST_2 = 13;
30      int DCONST_0 = 14;
31      int DCONST_1 = 15;
32      int IALOAD = 46;
33      int LALOAD = 47;
34      int FALOAD = 48;
35      int DALOAD = 49;
36      int AALOAD = 50;
37      int BALOAD = 51;
38      int CALOAD = 52;
39      int SALOAD = 53;
40      int IASTORE = 79;
41      int LASTORE = 80;
42      int FASTORE = 81;
43      int DASTORE = 82;
44      int AASTORE = 83;
45      int BASTORE = 84;
46      int CASTORE = 85;
47      int SASTORE = 86;
48      int POP = 87;
49      int POP2 = 88;
50      int DUP = 89;
51      int DUP_X1 = 90;
52      int DUP_X2 = 91;
53      int DUP2 = 92;
54      int DUP2_X1 = 93;
55      int DUP2_X2 = 94;
56      int SWAP = 95;
57      int IADD = 96;
58      int LADD = 97;
59      int FADD = 98;
60      int DADD = 99;
61      int ISUB = 100;
62      int LSUB = 101;
63      int FSUB = 102;
64      int DSUB = 103;
65      int IMUL = 104;
66      int LMUL = 105;
67      int FMUL = 106;
68      int DMUL = 107;
69      int IDIV = 108;
70      int LDIV = 109;
71      int FDIV = 110;
72      int DDIV = 111;
73      int IREM = 112;
74      int LREM = 113;
75      int FREM = 114;
76      int DREM = 115;
77      int INEG = 116;
78      int LNEG = 117;
79      int FNEG = 118;
80      int DNEG = 119;
81      int ISHL = 120;
82      int LSHL = 121;
83      int ISHR = 122;
84      int LSHR = 123;
85      int IUSHR = 124;
86      int LUSHR = 125;
87      int IAND = 126;
88      int LAND = 127;
89      int IOR = 128;
90      int LOR = 129;
91      int IXOR = 130;
92      int LXOR = 131;
93      int I2L = 133;
94      int I2F = 134;
95      int I2D = 135;
96      int L2I = 136;
97      int L2F = 137;
98      int L2D = 138;
99      int F2I = 139;
100     int F2L = 140;
101     int F2D = 141;
102     int D2I = 142;
103     int D2L = 143;
104     int D2F = 144;
105     int I2B = 145;
106     int I2C = 146;
107     int I2S = 147;
108     int LCMP = 148;
109     int FCMPL = 149;
110     int FCMPG = 150;
111     int DCMPL = 151;
112     int DCMPG = 152;
113     int IRETURN = 172;
114     int LRETURN = 173;
115     int FRETURN = 174;
116     int DRETURN = 175;
117     int ARETURN = 176;
118     int RETURN = 177;
119     int ARRAYLENGTH = 190;
120     int ATHROW = 191;
121     int MONITORENTER = 194;
122     int MONITOREXIT = 195;
123 
124     // visitIntInsn
125     // int BIPUSH = 16;
126     int SIPUSH = 17;
127     int NEWARRAY = 188;
128 
129     // visitLdcInsn
130     int LDC = 18;
131     int LDC_W = 19;
132     int LDC2_W = 20;
133 
134     // visitVarInsn
135     int ILOAD = 21;
136     int LLOAD = 22;
137     int FLOAD = 23;
138     int DLOAD = 24;
139     int ALOAD = 25;
140     int ILOAD_0 = 26;
141     // int ILOAD_1 = 27;
142     // int ILOAD_2 = 28;
143     // int ILOAD_3 = 29;
144     // int LLOAD_0 = 30;
145     // int LLOAD_1 = 31;
146     // int LLOAD_2 = 32;
147     // int LLOAD_3 = 33;
148     // int FLOAD_0 = 34;
149     // int FLOAD_1 = 35;
150     // int FLOAD_2 = 36;
151     // int FLOAD_3 = 37;
152     // int DLOAD_0 = 38;
153     // int DLOAD_1 = 39;
154     // int DLOAD_2 = 40;
155     // int DLOAD_3 = 41;
156     // int ALOAD_0 = 42;
157     // int ALOAD_1 = 43;
158     // int ALOAD_2 = 44;
159     // int ALOAD_3 = 45;
160     int ISTORE = 54;
161     int LSTORE = 55;
162     int FSTORE = 56;
163     int DSTORE = 57;
164     int ASTORE = 58;
165     int ISTORE_0 = 59;
166     // int ISTORE_1 = 60;
167     // int ISTORE_2 = 61;
168     // int ISTORE_3 = 62;
169     // int LSTORE_0 = 63;
170     // int LSTORE_1 = 64;
171     // int LSTORE_2 = 65;
172     // int LSTORE_3 = 66;
173     // int FSTORE_0 = 67;
174     // int FSTORE_1 = 68;
175     // int FSTORE_2 = 69;
176     // int FSTORE_3 = 70;
177     // int DSTORE_0 = 71;
178     // int DSTORE_1 = 72;
179     // int DSTORE_2 = 73;
180     // int DSTORE_3 = 74;
181     // int ASTORE_0 = 75;
182     // int ASTORE_1 = 76;
183     // int ASTORE_2 = 77;
184     // int ASTORE_3 = 78;
185     // int RET = 169;
186     int WIDE = 196; // NOT VISITED
187 
188     // visitIincInsn
189     int IINC = 132;
190 
191     // visitJumpInsn
192     int IFEQ = 153;
193     int IFNE = 154;
194     int IFLT = 155;
195     int IFGE = 156;
196     int IFGT = 157;
197     int IFLE = 158;
198     int IF_ICMPEQ = 159;
199     int IF_ICMPNE = 160;
200     int IF_ICMPLT = 161;
201     int IF_ICMPGE = 162;
202     int IF_ICMPGT = 163;
203     int IF_ICMPLE = 164;
204     int IF_ACMPEQ = 165;
205     int IF_ACMPNE = 166;
206     int GOTO = 167;
207     // int JSR = 168;
208     int IFNULL = 198;
209     int IFNONNULL = 199;
210     int GOTO_W = 200;
211     // int JSR_W = 201;
212 
213     // visitTableSwitchInsn, visitLookupSwitch
214     int TABLESWITCH = 170;
215     int LOOKUPSWITCH = 171;
216 
217     // visitFieldInsn
218     int GETSTATIC = 178;
219     int PUTSTATIC = 179;
220     int GETFIELD = 180;
221     int PUTFIELD = 181;
222 
223     // visitMethodInsn, visitInvokeDynamicInsn
224     int INVOKEVIRTUAL = 182;
225     int INVOKESPECIAL = 183;
226     int INVOKESTATIC = 184;
227     int INVOKEINTERFACE = 185;
228     int INVOKEDYNAMIC = 186;
229 
230     // visitTypeInsn
231     int NEW = 187;
232     int ANEWARRAY = 189;
233     int CHECKCAST = 192;
234     int INSTANCEOF = 193;
235 
236     // visitMultiANewArrayInsn
237     int MULTIANEWARRAY = 197;
238 }