1
2
3
4 package joeq.Class;
5
6
7
8
9
10 public interface jq_ClassFileConstants {
11
12
13
14 char ACC_PUBLIC = 0x0001;
15 char ACC_PRIVATE = 0x0002;
16 char ACC_PROTECTED = 0x0004;
17 char ACC_STATIC = 0x0008;
18 char ACC_FINAL = 0x0010;
19 char ACC_SYNCHRONIZED = 0x0020;
20 char ACC_SUPER = 0x0020;
21 char ACC_VOLATILE = 0x0040;
22 char ACC_TRANSIENT = 0x0080;
23 char ACC_NATIVE = 0x0100;
24 char ACC_INTERFACE = 0x0200;
25 char ACC_ABSTRACT = 0x0400;
26 char ACC_STRICT = 0x0800;
27
28
29
30
31
32
33
34
35
36
37 byte CONSTANT_Class = 7;
38 byte CONSTANT_FieldRef = 9;
39 byte CONSTANT_MethodRef = 10;
40 byte CONSTANT_InterfaceMethodRef = 11;
41 byte CONSTANT_String = 8;
42 byte CONSTANT_Integer = 3;
43 byte CONSTANT_Float = 4;
44 byte CONSTANT_Long = 5;
45 byte CONSTANT_Double = 6;
46 byte CONSTANT_NameAndType = 12;
47 byte CONSTANT_Utf8 = 1;
48 byte CONSTANT_ResolvedClass = 13;
49 byte CONSTANT_ResolvedSFieldRef = 14;
50 byte CONSTANT_ResolvedIFieldRef = 15;
51 byte CONSTANT_ResolvedSMethodRef = 16;
52 byte CONSTANT_ResolvedIMethodRef = 17;
53
54
55
56
57
58
59 byte TC_BYTE = (byte)'B';
60 byte TC_CHAR = (byte)'C';
61 byte TC_DOUBLE = (byte)'D';
62 byte TC_FLOAT = (byte)'F';
63 byte TC_INT = (byte)'I';
64 byte TC_LONG = (byte)'J';
65 byte TC_CLASS = (byte)'L';
66 byte TC_CLASSEND = (byte)';';
67 byte TC_SHORT = (byte)'S';
68 byte TC_BOOLEAN = (byte)'Z';
69 byte TC_ARRAY = (byte)'[';
70 byte TC_PARAM = (byte)'(';
71 byte TC_PARAMEND = (byte)')';
72 byte TC_VOID = (byte)'V';
73
74 byte T_BOOLEAN = 4;
75 byte T_CHAR = 5;
76 byte T_FLOAT = 6;
77 byte T_DOUBLE = 7;
78 byte T_BYTE = 8;
79 byte T_SHORT = 9;
80 byte T_INT = 10;
81 byte T_LONG = 11;
82
83
84
85
86 byte STATE_UNLOADED = 0;
87
88
89 byte STATE_LOADING1 = 1;
90
91
92 byte STATE_LOADING2 = 2;
93
94
95 byte STATE_LOADING3 = 3;
96
97 byte STATE_LOADERROR = 4;
98
99 byte STATE_LOADED = 5;
100
101
102
103 byte STATE_VERIFYING = 6;
104
105 byte STATE_VERIFYERROR = 7;
106
107 byte STATE_VERIFIED = 8;
108
109
110
111 byte STATE_PREPARING = 9;
112
113 byte STATE_PREPAREERROR = 10;
114
115 byte STATE_PREPARED = 11;
116
117
118 byte STATE_SFINITIALIZING = 12;
119
120 byte STATE_SFINITERROR = 13;
121
122 byte STATE_SFINITIALIZED = 14;
123
124 byte STATE_COMPILING = 15;
125
126 byte STATE_COMPILED = 16;
127
128
129
130
131 byte STATE_CLSINITIALIZING = 17;
132 byte STATE_CLSINITRUNNING = 18;
133
134
135
136
137 byte STATE_CLSINITERROR = 19;
138
139 byte STATE_CLSINITIALIZED = 20;
140
141 /***
142 * Illegal codes
143 */
144 short UNDEFINED = -1;
145 short UNPREDICTABLE = -2;
146 short RESERVED = -3;
147 String ILLEGAL_OPCODE = "<illegal opcode>";
148 String ILLEGAL_TYPE = "<illegal type>";
149
150 /*** Java VM opcodes.
151 * (VM Spec Chapter 6)
152 */
153 short jbc_NOP = 0;
154 short jbc_ACONST_NULL = 1;
155 short jbc_ICONST_M1 = 2;
156 short jbc_ICONST_0 = 3;
157 short jbc_ICONST_1 = 4;
158 short jbc_ICONST_2 = 5;
159 short jbc_ICONST_3 = 6;
160 short jbc_ICONST_4 = 7;
161 short jbc_ICONST_5 = 8;
162 short jbc_LCONST_0 = 9;
163 short jbc_LCONST_1 = 10;
164 short jbc_FCONST_0 = 11;
165 short jbc_FCONST_1 = 12;
166 short jbc_FCONST_2 = 13;
167 short jbc_DCONST_0 = 14;
168 short jbc_DCONST_1 = 15;
169 short jbc_BIPUSH = 16;
170 short jbc_SIPUSH = 17;
171 short jbc_LDC = 18;
172 short jbc_LDC_W = 19;
173 short jbc_LDC2_W = 20;
174 short jbc_ILOAD = 21;
175 short jbc_LLOAD = 22;
176 short jbc_FLOAD = 23;
177 short jbc_DLOAD = 24;
178 short jbc_ALOAD = 25;
179 short jbc_ILOAD_0 = 26;
180 short jbc_ILOAD_1 = 27;
181 short jbc_ILOAD_2 = 28;
182 short jbc_ILOAD_3 = 29;
183 short jbc_LLOAD_0 = 30;
184 short jbc_LLOAD_1 = 31;
185 short jbc_LLOAD_2 = 32;
186 short jbc_LLOAD_3 = 33;
187 short jbc_FLOAD_0 = 34;
188 short jbc_FLOAD_1 = 35;
189 short jbc_FLOAD_2 = 36;
190 short jbc_FLOAD_3 = 37;
191 short jbc_DLOAD_0 = 38;
192 short jbc_DLOAD_1 = 39;
193 short jbc_DLOAD_2 = 40;
194 short jbc_DLOAD_3 = 41;
195 short jbc_ALOAD_0 = 42;
196 short jbc_ALOAD_1 = 43;
197 short jbc_ALOAD_2 = 44;
198 short jbc_ALOAD_3 = 45;
199 short jbc_IALOAD = 46;
200 short jbc_LALOAD = 47;
201 short jbc_FALOAD = 48;
202 short jbc_DALOAD = 49;
203 short jbc_AALOAD = 50;
204 short jbc_BALOAD = 51;
205 short jbc_CALOAD = 52;
206 short jbc_SALOAD = 53;
207 short jbc_ISTORE = 54;
208 short jbc_LSTORE = 55;
209 short jbc_FSTORE = 56;
210 short jbc_DSTORE = 57;
211 short jbc_ASTORE = 58;
212 short jbc_ISTORE_0 = 59;
213 short jbc_ISTORE_1 = 60;
214 short jbc_ISTORE_2 = 61;
215 short jbc_ISTORE_3 = 62;
216 short jbc_LSTORE_0 = 63;
217 short jbc_LSTORE_1 = 64;
218 short jbc_LSTORE_2 = 65;
219 short jbc_LSTORE_3 = 66;
220 short jbc_FSTORE_0 = 67;
221 short jbc_FSTORE_1 = 68;
222 short jbc_FSTORE_2 = 69;
223 short jbc_FSTORE_3 = 70;
224 short jbc_DSTORE_0 = 71;
225 short jbc_DSTORE_1 = 72;
226 short jbc_DSTORE_2 = 73;
227 short jbc_DSTORE_3 = 74;
228 short jbc_ASTORE_0 = 75;
229 short jbc_ASTORE_1 = 76;
230 short jbc_ASTORE_2 = 77;
231 short jbc_ASTORE_3 = 78;
232 short jbc_IASTORE = 79;
233 short jbc_LASTORE = 80;
234 short jbc_FASTORE = 81;
235 short jbc_DASTORE = 82;
236 short jbc_AASTORE = 83;
237 short jbc_BASTORE = 84;
238 short jbc_CASTORE = 85;
239 short jbc_SASTORE = 86;
240 short jbc_POP = 87;
241 short jbc_POP2 = 88;
242 short jbc_DUP = 89;
243 short jbc_DUP_X1 = 90;
244 short jbc_DUP_X2 = 91;
245 short jbc_DUP2 = 92;
246 short jbc_DUP2_X1 = 93;
247 short jbc_DUP2_X2 = 94;
248 short jbc_SWAP = 95;
249 short jbc_IADD = 96;
250 short jbc_LADD = 97;
251 short jbc_FADD = 98;
252 short jbc_DADD = 99;
253 short jbc_ISUB = 100;
254 short jbc_LSUB = 101;
255 short jbc_FSUB = 102;
256 short jbc_DSUB = 103;
257 short jbc_IMUL = 104;
258 short jbc_LMUL = 105;
259 short jbc_FMUL = 106;
260 short jbc_DMUL = 107;
261 short jbc_IDIV = 108;
262 short jbc_LDIV = 109;
263 short jbc_FDIV = 110;
264 short jbc_DDIV = 111;
265 short jbc_IREM = 112;
266 short jbc_LREM = 113;
267 short jbc_FREM = 114;
268 short jbc_DREM = 115;
269 short jbc_INEG = 116;
270 short jbc_LNEG = 117;
271 short jbc_FNEG = 118;
272 short jbc_DNEG = 119;
273 short jbc_ISHL = 120;
274 short jbc_LSHL = 121;
275 short jbc_ISHR = 122;
276 short jbc_LSHR = 123;
277 short jbc_IUSHR = 124;
278 short jbc_LUSHR = 125;
279 short jbc_IAND = 126;
280 short jbc_LAND = 127;
281 short jbc_IOR = 128;
282 short jbc_LOR = 129;
283 short jbc_IXOR = 130;
284 short jbc_LXOR = 131;
285 short jbc_IINC = 132;
286 short jbc_I2L = 133;
287 short jbc_I2F = 134;
288 short jbc_I2D = 135;
289 short jbc_L2I = 136;
290 short jbc_L2F = 137;
291 short jbc_L2D = 138;
292 short jbc_F2I = 139;
293 short jbc_F2L = 140;
294 short jbc_F2D = 141;
295 short jbc_D2I = 142;
296 short jbc_D2L = 143;
297 short jbc_D2F = 144;
298 short jbc_I2B = 145;
299 short jbc_INT2BYTE = 145;
300 short jbc_I2C = 146;
301 short jbc_INT2CHAR = 146;
302 short jbc_I2S = 147;
303 short jbc_INT2SHORT = 147;
304 short jbc_LCMP = 148;
305 short jbc_FCMPL = 149;
306 short jbc_FCMPG = 150;
307 short jbc_DCMPL = 151;
308 short jbc_DCMPG = 152;
309 short jbc_IFEQ = 153;
310 short jbc_IFNE = 154;
311 short jbc_IFLT = 155;
312 short jbc_IFGE = 156;
313 short jbc_IFGT = 157;
314 short jbc_IFLE = 158;
315 short jbc_IF_ICMPEQ = 159;
316 short jbc_IF_ICMPNE = 160;
317 short jbc_IF_ICMPLT = 161;
318 short jbc_IF_ICMPGE = 162;
319 short jbc_IF_ICMPGT = 163;
320 short jbc_IF_ICMPLE = 164;
321 short jbc_IF_ACMPEQ = 165;
322 short jbc_IF_ACMPNE = 166;
323 short jbc_GOTO = 167;
324 short jbc_JSR = 168;
325 short jbc_RET = 169;
326 short jbc_TABLESWITCH = 170;
327 short jbc_LOOKUPSWITCH = 171;
328 short jbc_IRETURN = 172;
329 short jbc_LRETURN = 173;
330 short jbc_FRETURN = 174;
331 short jbc_DRETURN = 175;
332 short jbc_ARETURN = 176;
333 short jbc_RETURN = 177;
334 short jbc_GETSTATIC = 178;
335 short jbc_PUTSTATIC = 179;
336 short jbc_GETFIELD = 180;
337 short jbc_PUTFIELD = 181;
338 short jbc_INVOKEVIRTUAL = 182;
339 short jbc_INVOKESPECIAL = 183;
340 short jbc_INVOKENONVIRTUAL = 183;
341 short jbc_INVOKESTATIC = 184;
342 short jbc_INVOKEINTERFACE = 185;
343 short jbc_NEW = 187;
344 short jbc_NEWARRAY = 188;
345 short jbc_ANEWARRAY = 189;
346 short jbc_ARRAYLENGTH = 190;
347 short jbc_ATHROW = 191;
348 short jbc_CHECKCAST = 192;
349 short jbc_INSTANCEOF = 193;
350 short jbc_MONITORENTER = 194;
351 short jbc_MONITOREXIT = 195;
352 short jbc_WIDE = 196;
353 short jbc_MULTIANEWARRAY = 197;
354 short jbc_IFNULL = 198;
355 short jbc_IFNONNULL = 199;
356 short jbc_GOTO_W = 200;
357 short jbc_JSR_W = 201;
358
359 /***
360 * Non-legal opcodes, may be used by JVM internally.
361 */
362 short jbc_BREAKPOINT = 202;
363
364 /***
365 * Number of byte code operands, i.e., number of bytes after the tag byte
366 * itself.
367 */
368 short[] NO_OF_OPERANDS = {
369 0
370 0
371 0
372 0
373 1
374 1
375 0
376 0
377 0
378 0
379 0
380 0
381 0
382 1
383 1
384 0
385 0
386 0
387 0
388 0
389 0
390 0
391 0
392 0
393 0
394 0
395 0
396 0
397 0
398 0
399 2
400 0
401 0
402 0
403 2
404 2
405 2
406 2
407 0
408 0
409 2
410 2
411 4
412 1
413 0
414 2
415 0
416 2
417 4
418 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
419 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
420 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
421 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
422 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
423 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
424 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
425 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
426 UNDEFINED, UNDEFINED, RESERVED
427 };
428
429 /***
430 * How the byte code operands are to be interpreted.
431 */
432 short[][] TYPE_OF_OPERANDS = {
433 {}
434 {}
435 {}
436 {}
437 {T_BYTE}
438 {T_SHORT}
439 {T_BYTE}
440 {T_BYTE}
441 {}
442 {}
443 {}
444 {}
445 {}
446 {}
447 {}
448 {T_BYTE}
449 {T_BYTE}
450 {}
451 {}
452 {}
453 {}
454 {}
455 {}
456 {}
457 {}
458 {}
459 {}
460 {}
461 {}
462 {}
463 {}
464 {}
465 {}
466 {}
467 {}
468 {}
469 {}
470 {T_SHORT}
471 {T_SHORT}
472 {T_SHORT}
473 {T_SHORT}
474 {T_SHORT}
475 {T_SHORT}
476 {T_BYTE}
477 {}
478 {}
479 {T_SHORT}
480 {T_SHORT}
481 {T_SHORT}
482 {T_SHORT, T_BYTE, T_BYTE}
483 {T_SHORT}
484 {T_SHORT}
485 {T_SHORT}
486 {}
487 {T_SHORT, T_BYTE}
488 {T_SHORT}
489 {}
490 {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
491 {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
492 {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {},
493 {}
494 };
495
496 /***
497 * Names of opcodes.
498 */
499 String[] OPCODE_NAMES = {
500 "nop", "aconst_null", "iconst_m1", "iconst_0", "iconst_1",
501 "iconst_2", "iconst_3", "iconst_4", "iconst_5", "lconst_0",
502 "lconst_1", "fconst_0", "fconst_1", "fconst_2", "dconst_0",
503 "dconst_1", "bipush", "sipush", "ldc", "ldc_w", "ldc2_w", "iload",
504 "lload", "fload", "dload", "aload", "iload_0", "iload_1", "iload_2",
505 "iload_3", "lload_0", "lload_1", "lload_2", "lload_3", "fload_0",
506 "fload_1", "fload_2", "fload_3", "dload_0", "dload_1", "dload_2",
507 "dload_3", "aload_0", "aload_1", "aload_2", "aload_3", "iaload",
508 "laload", "faload", "daload", "aaload", "baload", "caload", "saload",
509 "istore", "lstore", "fstore", "dstore", "astore", "istore_0",
510 "istore_1", "istore_2", "istore_3", "lstore_0", "lstore_1",
511 "lstore_2", "lstore_3", "fstore_0", "fstore_1", "fstore_2",
512 "fstore_3", "dstore_0", "dstore_1", "dstore_2", "dstore_3",
513 "astore_0", "astore_1", "astore_2", "astore_3", "iastore", "lastore",
514 "fastore", "dastore", "aastore", "bastore", "castore", "sastore",
515 "pop", "pop2", "dup", "dup_x1", "dup_x2", "dup2", "dup2_x1",
516 "dup2_x2", "swap", "iadd", "ladd", "fadd", "dadd", "isub", "lsub",
517 "fsub", "dsub", "imul", "lmul", "fmul", "dmul", "idiv", "ldiv",
518 "fdiv", "ddiv", "irem", "lrem", "frem", "drem", "ineg", "lneg",
519 "fneg", "dneg", "ishl", "lshl", "ishr", "lshr", "iushr", "lushr",
520 "iand", "land", "ior", "lor", "ixor", "lxor", "iinc", "i2l", "i2f",
521 "i2d", "l2i", "l2f", "l2d", "f2i", "f2l", "f2d", "d2i", "d2l", "d2f",
522 "i2b", "i2c", "i2s", "lcmp", "fcmpl", "fcmpg",
523 "dcmpl", "dcmpg", "ifeq", "ifne", "iflt", "ifge", "ifgt", "ifle",
524 "if_icmpeq", "if_icmpne", "if_icmplt", "if_icmpge", "if_icmpgt",
525 "if_icmple", "if_acmpeq", "if_acmpne", "goto", "jsr", "ret",
526 "tableswitch", "lookupswitch", "ireturn", "lreturn", "freturn",
527 "dreturn", "areturn", "return", "getstatic", "putstatic", "getfield",
528 "putfield", "invokevirtual", "invokespecial", "invokestatic",
529 "invokeinterface", ILLEGAL_OPCODE, "new", "newarray", "anewarray",
530 "arraylength", "athrow", "checkcast", "instanceof", "monitorenter",
531 "monitorexit", "wide", "multianewarray", "ifnull", "ifnonnull",
532 "goto_w", "jsr_w", "breakpoint", ILLEGAL_OPCODE, ILLEGAL_OPCODE,
533 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
534 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
535 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
536 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
537 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
538 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
539 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
540 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
541 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
542 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
543 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
544 ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE, ILLEGAL_OPCODE,
545 ILLEGAL_OPCODE, "impdep1", "impdep2"
546 };
547
548 /***
549 * Number of words consumed on operand stack by instructions.
550 */
551 int[] CONSUME_STACK = {
552 0
553 0
554 0
555 0
556 0
557 0
558 0
559 0
560 2
561 1
562 1
563 2
564 1
565 1
566 3
567 1
568 4
569 2
570 2
571 1
572 2
573 1
574 1
575 4
576 1
577 2
578 0
579 2
580 UNPREDICTABLE
581 UNPREDICTABLE
582 UNPREDICTABLE
583 UNPREDICTABLE
584 1
585 1
586 0
587 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
588 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
589 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
590 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
591 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
592 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
593 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
594 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
595 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
596 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
597 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
598 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
599 UNDEFINED, UNPREDICTABLE
600 };
601
602 /***
603 * Number of words produced onto operand stack by instructions.
604 */
605 int[] PRODUCE_STACK = {
606 0
607 1
608 2
609 2
610 2
611 1
612 1
613 2
614 2
615 0
616 0
617 0
618 0
619 0
620 0
621 0
622 6
623 1
624 1
625 1
626 1
627 0
628 2
629 1
630 1
631 0
632 0
633 0
634 0
635 UNPREDICTABLE
636 UNPREDICTABLE
637 UNPREDICTABLE
638 1
639 0
640 0
641 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
642 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
643 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
644 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
645 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
646 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
647 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
648 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
649 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
650 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
651 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
652 UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED,
653 UNDEFINED, UNPREDICTABLE
654 };
655
656 }