1 package org.ibex.classgen;
3 public interface CGConst {
6 public static final int ACC_INTERFACE = (byte) 0x0200;
7 public static final int ACC_SUPER = (byte) 0x0020;
10 public static final int ACC_PUBLIC = (byte) 0x0001;
11 public static final int ACC_PRIVATE = (byte) 0x0002;
12 public static final int ACC_PROTECTED = (byte) 0x0004;
13 public static final int ACC_STATIC = (byte) 0x0008;
14 public static final int ACC_FINAL = (byte) 0x0010;
17 public static final int ACC_ABSTRACT = (byte) 0x0400;
20 public static final int ACC_SYNCHRONIZED = (byte) 0x0020;
21 public static final int ACC_NATIVE = (byte) 0x0100;
22 public static final int ACC_STRICT = (byte) 0x0800;
25 public static final int ACC_VOLATILE = (byte) 0x0040;
26 public static final int ACC_TRANSIENT = (byte) 0x0080;
30 // NOTE: DO NOT modify or remove the number in the comments
32 public static final byte NOP = (byte) 0x0; // 0
33 public static final byte ACONST_NULL = (byte) 0x01; // 0
34 public static final byte ICONST_M1 = (byte) 0x02; // 0
35 public static final byte ICONST_0 = (byte) 0x03; // 0
36 public static final byte ICONST_1 = (byte) 0x04; // 0
37 public static final byte ICONST_2 = (byte) 0x05; // 0
38 public static final byte ICONST_3 = (byte) 0x06; // 0
39 public static final byte ICONST_4 = (byte) 0x07; // 0
40 public static final byte ICONST_5 = (byte) 0x08; // 0
41 public static final byte LCONST_0 = (byte) 0x09; // 0
42 public static final byte LCONST_1 = (byte) 0x0A; // 0
43 public static final byte FCONST_0 = (byte) 0x0B; // 0
44 public static final byte FCONST_1 = (byte) 0x0C; // 0
45 public static final byte FCONST_2 = (byte) 0x0D; // 0
46 public static final byte DCONST_0 = (byte) 0x0E; // 0
47 public static final byte DCONST_1 = (byte) 0x0F; // 0
48 public static final byte BIPUSH = (byte) 0x10; // 1
49 public static final byte SIPUSH = (byte) 0x11; // 2
50 public static final byte LDC = (byte) 0x12; // 1C
51 public static final byte LDC_W = (byte) 0x13; // 2C
52 public static final byte LDC2_W = (byte) 0x14; // 2C
53 public static final byte ILOAD = (byte) 0x15; // 1
54 public static final byte LLOAD = (byte) 0x16; // 1
55 public static final byte FLOAD = (byte) 0x17; // 1
56 public static final byte DLOAD = (byte) 0x18; // 1
57 public static final byte ALOAD = (byte) 0x19; // 1
58 public static final byte ILOAD_0 = (byte) 0x1A; // 0
59 public static final byte ILOAD_1 = (byte) 0x1B; // 0
60 public static final byte ILOAD_2 = (byte) 0x1C; // 0
61 public static final byte ILOAD_3 = (byte) 0x1D; // 0
62 public static final byte LLOAD_0 = (byte) 0x1E; // 0
63 public static final byte LLOAD_1 = (byte) 0x1F; // 0
64 public static final byte LLOAD_2 = (byte) 0x20; // 0
65 public static final byte LLOAD_3 = (byte) 0x21; // 0
66 public static final byte FLOAD_0 = (byte) 0x22; // 0
67 public static final byte FLOAD_1 = (byte) 0x23; // 0
68 public static final byte FLOAD_2 = (byte) 0x24; // 0
69 public static final byte FLOAD_3 = (byte) 0x25; // 0
70 public static final byte DLOAD_0 = (byte) 0x26; // 0
71 public static final byte DLOAD_1 = (byte) 0x27; // 0
72 public static final byte DLOAD_2 = (byte) 0x28; // 0
73 public static final byte DLOAD_3 = (byte) 0x29; // 0
74 public static final byte ALOAD_0 = (byte) 0x2A; // 0
75 public static final byte ALOAD_1 = (byte) 0x2B; // 0
76 public static final byte ALOAD_2 = (byte) 0x2C; // 0
77 public static final byte ALOAD_3 = (byte) 0x2D; // 0
78 public static final byte IALOAD = (byte) 0x2E; // 0
79 public static final byte LALOAD = (byte) 0x2F; // 0
80 public static final byte FALOAD = (byte) 0x30; // 0
81 public static final byte DALOAD = (byte) 0x31; // 0
82 public static final byte AALOAD = (byte) 0x32; // 0
83 public static final byte BALOAD = (byte) 0x33; // 0
84 public static final byte CALOAD = (byte) 0x34; // 0
85 public static final byte SALOAD = (byte) 0x35; // 0
86 public static final byte ISTORE = (byte) 0x36; // 1
87 public static final byte LSTORE = (byte) 0x37; // 1
88 public static final byte FSTORE = (byte) 0x38; // 1
89 public static final byte DSTORE = (byte) 0x39; // 1
90 public static final byte ASTORE = (byte) 0x3A; // 1
91 public static final byte ISTORE_0 = (byte) 0x3B; // 0
92 public static final byte ISTORE_1 = (byte) 0x3C; // 0
93 public static final byte ISTORE_2 = (byte) 0x3D; // 0
94 public static final byte ISTORE_3 = (byte) 0x3E; // 0
95 public static final byte LSTORE_0 = (byte) 0x3F; // 0
96 public static final byte LSTORE_1 = (byte) 0x40; // 0
97 public static final byte LSTORE_2 = (byte) 0x41; // 0
98 public static final byte LSTORE_3 = (byte) 0x42; // 0
99 public static final byte FSTORE_0 = (byte) 0x43; // 0
100 public static final byte FSTORE_1 = (byte) 0x44; // 0
101 public static final byte FSTORE_2 = (byte) 0x45; // 0
102 public static final byte FSTORE_3 = (byte) 0x46; // 0
103 public static final byte DSTORE_0 = (byte) 0x47; // 0
104 public static final byte DSTORE_1 = (byte) 0x48; // 0
105 public static final byte DSTORE_2 = (byte) 0x49; // 0
106 public static final byte DSTORE_3 = (byte) 0x4A; // 0
107 public static final byte ASTORE_0 = (byte) 0x4B; // 0
108 public static final byte ASTORE_1 = (byte) 0x4C; // 0
109 public static final byte ASTORE_2 = (byte) 0x4D; // 0
110 public static final byte ASTORE_3 = (byte) 0x4E; // 0
111 public static final byte IASTORE = (byte) 0x4F; // 0
112 public static final byte LASTORE = (byte) 0x50; // 0
113 public static final byte FASTORE = (byte) 0x51; // 0
114 public static final byte DASTORE = (byte) 0x52; // 0
115 public static final byte AASTORE = (byte) 0x53; // 0
116 public static final byte BASTORE = (byte) 0x54; // 0
117 public static final byte CASTORE = (byte) 0x55; // 0
118 public static final byte SASTORE = (byte) 0x56; // 0
119 public static final byte POP = (byte) 0x57; // 0
120 public static final byte POP2 = (byte) 0x58; // 0
121 public static final byte DUP = (byte) 0x59; // 0
122 public static final byte DUP_X1 = (byte) 0x5A; // 0
123 public static final byte DUP_X2 = (byte) 0x5B; // 0
124 public static final byte DUP2 = (byte) 0x5C; // 0
125 public static final byte DUP2_X1 = (byte) 0x5D; // 0
126 public static final byte DUP2_X2 = (byte) 0x5E; // 0
127 public static final byte SWAP = (byte) 0x5F; // 0
128 public static final byte IADD = (byte) 0x60; // 0
129 public static final byte LADD = (byte) 0x61; // 0
130 public static final byte FADD = (byte) 0x62; // 0
131 public static final byte DADD = (byte) 0x63; // 0
132 public static final byte ISUB = (byte) 0x64; // 0
133 public static final byte LSUB = (byte) 0x65; // 0
134 public static final byte FSUB = (byte) 0x66; // 0
135 public static final byte DSUB = (byte) 0x67; // 0
136 public static final byte IMUL = (byte) 0x68; // 0
137 public static final byte LMUL = (byte) 0x69; // 0
138 public static final byte FMUL = (byte) 0x6A; // 0
139 public static final byte DMUL = (byte) 0x6B; // 0
140 public static final byte IDIV = (byte) 0x6C; // 0
141 public static final byte LDIV = (byte) 0x6D; // 0
142 public static final byte FDIV = (byte) 0x6E; // 0
143 public static final byte DDIV = (byte) 0x6F; // 0
144 public static final byte IREM = (byte) 0x70; // 0
145 public static final byte LREM = (byte) 0x71; // 0
146 public static final byte FREM = (byte) 0x72; // 0
147 public static final byte DREM = (byte) 0x73; // 0
148 public static final byte INEG = (byte) 0x74; // 0
149 public static final byte LNEG = (byte) 0x75; // 0
150 public static final byte FNEG = (byte) 0x76; // 0
151 public static final byte DNEG = (byte) 0x77; // 0
152 public static final byte ISHL = (byte) 0x78; // 0
153 public static final byte LSHL = (byte) 0x79; // 0
154 public static final byte ISHR = (byte) 0x7A; // 0
155 public static final byte LSHR = (byte) 0x7B; // 0
156 public static final byte IUSHR = (byte) 0x7C; // 0
157 public static final byte LUSHR = (byte) 0x7D; // 0
158 public static final byte IAND = (byte) 0x7E; // 0
159 public static final byte LAND = (byte) 0x7F; // 0
160 public static final byte IOR = (byte) 0x80; // 0
161 public static final byte LOR = (byte) 0x81; // 0
162 public static final byte IXOR = (byte) 0x82; // 0
163 public static final byte LXOR = (byte) 0x83; // 0
164 public static final byte IINC = (byte) 0x84; // 2
165 public static final byte I2L = (byte) 0x85; // 0
166 public static final byte I2F = (byte) 0x86; // 0
167 public static final byte I2D = (byte) 0x87; // 0
168 public static final byte L2I = (byte) 0x88; // 0
169 public static final byte L2F = (byte) 0x89; // 0
170 public static final byte L2D = (byte) 0x8A; // 0
171 public static final byte F2I = (byte) 0x8B; // 0
172 public static final byte F2L = (byte) 0x8C; // 0
173 public static final byte F2D = (byte) 0x8D; // 0
174 public static final byte D2I = (byte) 0x8E; // 0
175 public static final byte D2L = (byte) 0x8F; // 0
176 public static final byte D2F = (byte) 0x90; // 0
177 public static final byte I2B = (byte) 0x91; // 0
178 public static final byte I2C = (byte) 0x92; // 0
179 public static final byte I2S = (byte) 0x93; // 0
180 public static final byte LCMP = (byte) 0x94; // 0
181 public static final byte FCMPL = (byte) 0x95; // 0
182 public static final byte FCMPG = (byte) 0x96; // 0
183 public static final byte DCMPL = (byte) 0x97; // 0
184 public static final byte DCMPG = (byte) 0x98; // 0
185 public static final byte IFEQ = (byte) 0x99; // 2B
186 public static final byte IFNE = (byte) 0x9A; // 2B
187 public static final byte IFLT = (byte) 0x9B; // 2B
188 public static final byte IFGE = (byte) 0x9C; // 2B
189 public static final byte IFGT = (byte) 0x9D; // 2B
190 public static final byte IFLE = (byte) 0x9E; // 2B
191 public static final byte IF_ICMPEQ = (byte) 0x9F; // 2B
192 public static final byte IF_ICMPNE = (byte) 0xA0; // 2B
193 public static final byte IF_ICMPLT = (byte) 0xA1; // 2B
194 public static final byte IF_ICMPGE = (byte) 0xA2; // 2B
195 public static final byte IF_ICMPGT = (byte) 0xA3; // 2B
196 public static final byte IF_ICMPLE = (byte) 0xA4; // 2B
197 public static final byte IF_ACMPEQ = (byte) 0xA5; // 2B
198 public static final byte IF_ACMPNE = (byte) 0xA6; // 2B
199 public static final byte GOTO = (byte) 0xA7; // 2B
200 public static final byte JSR = (byte) 0xA8; // 2B
201 public static final byte RET = (byte) 0xA9; // 1
202 public static final byte TABLESWITCH = (byte) 0xAA; // V
203 public static final byte LOOKUPSWITCH = (byte) 0xAB; // V
204 public static final byte IRETURN = (byte) 0xAC; // 0
205 public static final byte LRETURN = (byte) 0xAD; // 0
206 public static final byte FRETURN = (byte) 0xAE; // 0
207 public static final byte DRETURN = (byte) 0xAF; // 0
208 public static final byte ARETURN = (byte) 0xB0; // 0
209 public static final byte RETURN = (byte) 0xB1; // 0
210 public static final byte GETSTATIC = (byte) 0xB2; // 2C
211 public static final byte PUTSTATIC = (byte) 0xB3; // 2C
212 public static final byte GETFIELD = (byte) 0xB4; // 2C
213 public static final byte PUTFIELD = (byte) 0xB5; // 2C
214 public static final byte INVOKEVIRTUAL = (byte) 0xB6; // 2C
215 public static final byte INVOKESPECIAL = (byte) 0xB7; // 2C
216 public static final byte INVOKESTATIC = (byte) 0xB8; // 2C
217 public static final byte INVOKEINTERFACE = (byte) 0xB9; // 2C
218 public static final byte NEW = (byte) 0xBB; // 2C
219 public static final byte NEWARRAY = (byte) 0xBC; // 1
220 public static final byte ANEWARRAY = (byte) 0xBD; // 2C
221 public static final byte ARRAYLENGTH = (byte) 0xBE; // 0
222 public static final byte ATHROW = (byte) 0xBF; // 0
223 public static final byte CHECKCAST = (byte) 0xC0; // 2C
224 public static final byte INSTANCEOF = (byte) 0xC1; // 2C
225 public static final byte MONITORENTER = (byte) 0xC2; // 0
226 public static final byte MONITOREXIT = (byte) 0xC3; // 0
227 public static final byte WIDE = (byte) 0xC4; // V
228 public static final byte MULTIANEWARRAY = (byte) 0xC5; // 3
229 public static final byte IFNULL = (byte) 0xC6; // 2B
230 public static final byte IFNONNULL = (byte) 0xC7; // 2B
231 public static final byte GOTO_W = (byte) 0xC8; // 4B
232 public static final byte JSR_W = (byte) 0xC9; // 4B
235 // DO NOT REMOVE THIS
239 @ARGV || push @ARGV, $0;
243 next unless(m|byte ([A-Z0-9_]+) = .*?([0-9xA-F]+);\s+//\s*(.*)$|i);
244 my ($name, $num) = ($1, hex($2));
247 $n |= s/^(\d+)// ? $1 : (s/^V//||die, 7);
248 $n |= (1<<4) if(s/^C//);
249 $n |= (1<<3) if(s/^B//);
253 print "private static final byte[] OP_DATA = {\n\t";
254 for(my $i=0;$i<256;$i++) {
255 printf "0x%02x%s", $a[$i]||1, $i==255?"\n};\n":($i%16)==15?", \n\t":", ";