blob: f0d31348ca8017c646db56b10a1c23636fdc8e8e [file] [log] [blame]
Stuart McCulloch26e7a5a2011-10-17 10:31:43 +00001package aQute.lib.osgi;
2
3public class OpCodes {
4 final static short nop = 0x00; // [No change] performs
5 // no
6 // operation
7 final static short aconst_null = 0x01; // ? null pushes a null
8 // reference onto the stack
9 final static short iconst_m1 = 0x02; // ? -1 loads the int
10 // value -1
11 // onto the stack
12 final static short iconst_0 = 0x03; // ? 0 loads the int
13 // value 0
14 // onto the stack
15 final static short iconst_1 = 0x04; // ? 1 loads the int
16 // value 1
17 // onto the stack
18 final static short iconst_2 = 0x05; // ? 2 loads the int
19 // value 2
20 // onto the stack
21 final static short iconst_3 = 0x06; // ? 3 loads the int
22 // value 3
23 // onto the stack
24 final static short iconst_4 = 0x07; // ? 4 loads the int
25 // value 4
26 // onto the stack
27 final static short iconst_5 = 0x08; // ? 5 loads the int
28 // value 5
29 // onto the stack
30 final static short lconst_0 = 0x09; // ? 0L pushes the long
31 // 0 onto
32 // the stack
33 final static short bipush = 0x10; // byte ? value pushes a
34 // byte
35 // onto the stack as an integer
36 // value
37 final static short sipush = 0x11; // byte1, byte2 ? value
38 // pushes a
39 // signed integer (byte1 << 8 +
40 // byte2) onto the stack
41 final static short ldc = 0x12; // index ? value pushes
42 // a
43 // constant #index from a
44 // constant pool (String, int,
45 // float or class type) onto the
46 // stack
47 final static short ldc_w = 0x13; // indexbyte1,
48 // indexbyte2 ?
49 // value pushes a constant
50 // #index from a constant pool
51 // (String, int, float or class
52 // type) onto the stack (wide
53 // index is constructed as
54 // indexbyte1 << 8 + indexbyte2)
55 final static short ldc2_w = 0x14; // indexbyte1,
56 // indexbyte2 ?
57 // value pushes a constant
58 // #index from a constant pool
59 // (double or long) onto the
60 // stack (wide index is
61 // constructed as indexbyte1 <<
62 // 8 + indexbyte2)
63 final static short iload = 0x15; // index ? value loads
64 // an int
65 // value from a variable #index
66 final static short lload = 0x16; // index ? value load a
67 // long
68 // value from a local variable
69 // #index
70 final static short fload = 0x17; // index ? value loads a
71 // float
72 // value from a local variable
73 // #index
74 final static short dload = 0x18; // index ? value loads a
75 // double
76 // value from a local variable
77 // #index
78 final static short aload = 0x19; // index ? objectref
79 // loads a
80 // reference onto the stack from
81 // a local variable #index
82 final static short lload_2 = 0x20; // ? value load a long
83 // value
84 // from a local variable 2
85 final static short lload_3 = 0x21; // ? value load a long
86 // value
87 // from a local variable 3
88 final static short fload_0 = 0x22; // ? value loads a float
89 // value
90 // from local variable 0
91 final static short fload_1 = 0x23; // ? value loads a float
92 // value
93 // from local variable 1
94 final static short fload_2 = 0x24; // ? value loads a float
95 // value
96 // from local variable 2
97 final static short fload_3 = 0x25; // ? value loads a float
98 // value
99 // from local variable 3
100 final static short dload_0 = 0x26; // ? value loads a
101 // double from
102 // local variable 0
103 final static short dload_1 = 0x27; // ? value loads a
104 // double from
105 // local variable 1
106 final static short dload_2 = 0x28; // ? value loads a
107 // double from
108 // local variable 2
109 final static short dload_3 = 0x29; // ? value loads a
110 // double from
111 // local variable 3
112 final static short faload = 0x30; // arrayref, index ?
113 // value loads
114 // a float from an array
115 final static short daload = 0x31; // arrayref, index ?
116 // value loads
117 // a double from an array
118 final static short aaload = 0x32; // arrayref, index ?
119 // value loads
120 // onto the stack a reference
121 // from an array
122 final static short baload = 0x33; // arrayref, index ?
123 // value loads
124 // a byte or Boolean value from
125 // an array
126 final static short caload = 0x34; // arrayref, index ?
127 // value loads
128 // a char from an array
129 final static short saload = 0x35; // arrayref, index ?
130 // value load
131 // short from array
132 final static short istore = 0x36; // index value ? store
133 // int value
134 // into variable #index
135 final static short lstore = 0x37; // index value ? store a
136 // long
137 // value in a local variable
138 // #index
139 final static short fstore = 0x38; // index value ? stores
140 // a float
141 // value into a local variable
142 // #index
143 final static short dstore = 0x39; // index value ? stores
144 // a double
145 // value into a local variable
146 // #index
147 final static short lstore_1 = 0x40; // value ? store a long
148 // value in
149 // a local variable 1
150 final static short lstore_2 = 0x41; // value ? store a long
151 // value in
152 // a local variable 2
153 final static short lstore_3 = 0x42; // value ? store a long
154 // value in
155 // a local variable 3
156 final static short fstore_0 = 0x43; // value ? stores a
157 // float value
158 // into local variable 0
159 final static short fstore_1 = 0x44; // value ? stores a
160 // float value
161 // into local variable 1
162 final static short fstore_2 = 0x45; // value ? stores a
163 // float value
164 // into local variable 2
165 final static short fstore_3 = 0x46; // value ? stores a
166 // float value
167 // into local variable 3
168 final static short dstore_0 = 0x47; // value ? stores a
169 // double into
170 // local variable 0
171 final static short dstore_1 = 0x48; // value ? stores a
172 // double into
173 // local variable 1
174 final static short dstore_2 = 0x49; // value ? stores a
175 // double into
176 // local variable 2
177 final static short lastore = 0x50; // arrayref, index,
178 // value ?
179 // store a long to an array
180 final static short fastore = 0x51; // arreyref, index,
181 // value ?
182 // stores a float in an array
183 final static short dastore = 0x52; // arrayref, index,
184 // value ?
185 // stores a double into an array
186 final static short aastore = 0x53; // arrayref, index,
187 // value ?
188 // stores into a reference to an
189 // array
190 final static short bastore = 0x54; // arrayref, index,
191 // value ?
192 // stores a byte or Boolean
193 // value into an array
194 final static short castore = 0x55; // arrayref, index,
195 // value ?
196 // stores a char into an array
197 final static short sastore = 0x56; // arrayref, index,
198 // value ?
199 // store short to array
200 final static short pop = 0x57; // value ? discards the
201 // top
202 // value on the stack
203 final static short pop2 = 0x58; // {value2, value1} ?
204 // discards
205 // the top two values on the
206 // stack (or one value, if it is
207 // a double or long)
208 final static short dup = 0x59; // value ? value, value
209 // duplicates the value on top
210 // of the stack
211 final static short iadd = 0x60; // value1, value2 ?
212 // result adds
213 // two ints together
214 final static short ladd = 0x61; // value1, value2 ?
215 // result add
216 // two longs
217 final static short fadd = 0x62; // value1, value2 ?
218 // result adds
219 // two floats
220 final static short dadd = 0x63; // value1, value2 ?
221 // result adds
222 // two doubles
223 final static short isub = 0x64; // value1, value2 ?
224 // result int
225 // subtract
226 final static short lsub = 0x65; // value1, value2 ?
227 // result
228 // subtract two longs
229 final static short fsub = 0x66; // value1, value2 ?
230 // result
231 // subtracts two floats
232 final static short dsub = 0x67; // value1, value2 ?
233 // result
234 // subtracts a double from
235 // another
236 final static short imul = 0x68; // value1, value2 ?
237 // result
238 // multiply two integers
239 final static short lmul = 0x69; // value1, value2 ?
240 // result
241 // multiplies two longs
242 final static short irem = 0x70; // value1, value2 ?
243 // result
244 // logical int remainder
245 final static short lrem = 0x71; // value1, value2 ?
246 // result
247 // remainder of division of two
248 // longs
249 final static short frem = 0x72; // value1, value2 ?
250 // result gets
251 // the remainder from a division
252 // between two floats
253 final static short drem = 0x73; // value1, value2 ?
254 // result gets
255 // the remainder from a division
256 // between two doubles
257 final static short ineg = 0x74; // value ? result negate
258 // int
259 final static short lneg = 0x75; // value ? result
260 // negates a long
261 final static short fneg = 0x76; // value ? result
262 // negates a
263 // float
264 final static short dneg = 0x77; // value ? result
265 // negates a
266 // double
267 final static short ishl = 0x78; // value1, value2 ?
268 // result int
269 // shift left
270 final static short lshl = 0x79; // value1, value2 ?
271 // result
272 // bitwise shift left of a long
273 // value1 by value2 positions
274 final static short ior = 0x80; // value1, value2 ?
275 // result
276 // logical int or
277 final static short lor = 0x81; // value1, value2 ?
278 // result
279 // bitwise or of two longs
280 final static short ixor = 0x82; // value1, value2 ?
281 // result int
282 // xor
283 final static short lxor = 0x83; // value1, value2 ?
284 // result
285 // bitwise exclusive or of two
286 // longs
287 final static short iinc = 0x84; // index, const [No
288 // change]
289 // increment local variable
290 // #index by signed byte const
291 final static short i2l = 0x85; // value ? result
292 // converts an
293 // int into a long
294 final static short i2f = 0x86; // value ? result
295 // converts an
296 // int into a float
297 final static short i2d = 0x87; // value ? result
298 // converts an
299 // int into a double
300 final static short l2i = 0x88; // value ? result
301 // converts a
302 // long to an int
303 final static short l2f = 0x89; // value ? result
304 // converts a
305 // long to a float
306 final static short d2f = 0x90; // value ? result
307 // converts a
308 // double to a float
309 final static short i2b = 0x91; // value ? result
310 // converts an
311 // int into a byte
312 final static short i2c = 0x92; // value ? result
313 // converts an
314 // int into a character
315 final static short i2s = 0x93; // value ? result
316 // converts an
317 // int into a short
318 final static short lcmp = 0x94; // value1, value2 ?
319 // result
320 // compares two longs values
321 final static short fcmpl = 0x95; // value1, value2 ?
322 // result
323 // compares two floats
324 final static short fcmpg = 0x96; // value1, value2 ?
325 // result
326 // compares two floats
327 final static short dcmpl = 0x97; // value1, value2 ?
328 // result
329 // compares two doubles
330 final static short dcmpg = 0x98; // value1, value2 ?
331 // result
332 // compares two doubles
333 final static short ifeq = 0x99; // branchbyte1,
334 // branchbyte2
335 // value ? if value is 0, branch
336 // to instruction at
337 // branchoffset (signed short
338 // constructed from unsigned
339 // bytes branchbyte1 << 8 +
340 // branchbyte2)
341 final static short lconst_1 = 0x0a; // ? 1L pushes the long
342 // 1 onto
343 // the stack
344 final static short fconst_0 = 0x0b; // ? 0.0f pushes 0.0f on
345 // the
346 // stack
347 final static short fconst_1 = 0x0c; // ? 1.0f pushes 1.0f on
348 // the
349 // stack
350 final static short fconst_2 = 0x0d; // ? 2.0f pushes 2.0f on
351 // the
352 // stack
353 final static short dconst_0 = 0x0e; // ? 0.0 pushes the
354 // constant 0.0
355 // onto the stack
356 final static short dconst_1 = 0x0f; // ? 1.0 pushes the
357 // constant 1.0
358 // onto the stack
359 final static short iload_0 = 0x1a; // ? value loads an int
360 // value
361 // from variable 0
362 final static short iload_1 = 0x1b; // ? value loads an int
363 // value
364 // from variable 1
365 final static short iload_2 = 0x1c; // ? value loads an int
366 // value
367 // from variable 2
368 final static short iload_3 = 0x1d; // ? value loads an int
369 // value
370 // from variable 3
371 final static short lload_0 = 0x1e; // ? value load a long
372 // value
373 // from a local variable 0
374 final static short lload_1 = 0x1f; // ? value load a long
375 // value
376 // from a local variable 1
377 final static short aload_0 = 0x2a; // ? objectref loads a
378 // reference
379 // onto the stack from local
380 // variable 0
381 final static short aload_1 = 0x2b; // ? objectref loads a
382 // reference
383 // onto the stack from local
384 // variable 1
385 final static short aload_2 = 0x2c; // ? objectref loads a
386 // reference
387 // onto the stack from local
388 // variable 2
389 final static short aload_3 = 0x2d; // ? objectref loads a
390 // reference
391 // onto the stack from local
392 // variable 3
393 final static short iaload = 0x2e; // arrayref, index ?
394 // value loads
395 // an int from an array
396 final static short laload = 0x2f; // arrayref, index ?
397 // value load
398 // a long from an array
399 final static short astore = 0x3a; // index objectref ?
400 // stores a
401 // reference into a local
402 // variable #index
403 final static short istore_0 = 0x3b; // value ? store int
404 // value into
405 // variable 0
406 final static short istore_1 = 0x3c; // value ? store int
407 // value into
408 // variable 1
409 final static short istore_2 = 0x3d; // value ? store int
410 // value into
411 // variable 2
412 final static short istore_3 = 0x3e; // value ? store int
413 // value into
414 // variable 3
415 final static short lstore_0 = 0x3f; // value ? store a long
416 // value in
417 // a local variable 0
418 final static short dstore_3 = 0x4a; // value ? stores a
419 // double into
420 // local variable 3
421 final static short astore_0 = 0x4b; // objectref ? stores a
422 // reference into local variable
423 // 0
424 final static short astore_1 = 0x4c; // objectref ? stores a
425 // reference into local variable
426 // 1
427 final static short astore_2 = 0x4d; // objectref ? stores a
428 // reference into local variable
429 // 2
430 final static short astore_3 = 0x4e; // objectref ? stores a
431 // reference into local variable
432 // 3
433 final static short iastore = 0x4f; // arrayref, index,
434 // value ?
435 // stores an int into an array
436 final static short dup_x1 = 0x5a; // value2, value1 ?
437 // value1,
438 // value2, value1 inserts a copy
439 // of the top value into the
440 // stack two values from the top
441 final static short dup_x2 = 0x5b; // value3, value2,
442 // value1 ?
443 // value1, value3, value2,
444 // value1 inserts a copy of the
445 // top value into the stack two
446 // (if value2 is double or long
447 // it takes up the entry of
448 // value3, too) or three values
449 // (if value2 is neither double
450 // nor long) from the top
451 final static short dup2 = 0x5c; // {value2, value1} ?
452 // {value2,
453 // value1}, {value2, value1}
454 // duplicate top two stack words
455 // (two values, if value1 is not
456 // double nor long; a single
457 // value, if value1 is double or
458 // long)
459 final static short dup2_x1 = 0x5d; // value3, {value2,
460 // value1} ?
461 // {value2, value1}, value3,
462 // {value2, value1} duplicate
463 // two words and insert beneath
464 // third word (see explanation
465 // above)
466 final static short dup2_x2 = 0x5e; // {value4, value3},
467 // {value2,
468 // value1} ? {value2, value1},
469 // {value4, value3}, {value2,
470 // value1} duplicate two words
471 // and insert beneath fourth
472 // word
473 final static short swap = 0x5f; // value2, value1 ?
474 // value1,
475 // value2 swaps two top words on
476 // the stack (note that value1
477 // and value2 must not be double
478 // or long)
479 final static short fmul = 0x6a; // value1, value2 ?
480 // result
481 // multiplies two floats
482 final static short dmul = 0x6b; // value1, value2 ?
483 // result
484 // multiplies two doubles
485 final static short idiv = 0x6c; // value1, value2 ?
486 // result
487 // divides two integers
488 final static short ldiv = 0x6d; // value1, value2 ?
489 // result
490 // divide two longs
491 final static short fdiv = 0x6e; // value1, value2 ?
492 // result
493 // divides two floats
494 final static short ddiv = 0x6f; // value1, value2 ?
495 // result
496 // divides two doubles
497 final static short ishr = 0x7a; // value1, value2 ?
498 // result int
499 // shift right
500 final static short lshr = 0x7b; // value1, value2 ?
501 // result
502 // bitwise shift right of a long
503 // value1 by value2 positions
504 final static short iushr = 0x7c; // value1, value2 ?
505 // result int
506 // shift right
507 final static short lushr = 0x7d; // value1, value2 ?
508 // result
509 // bitwise shift right of a long
510 // value1 by value2 positions,
511 // unsigned
512 final static short iand = 0x7e; // value1, value2 ?
513 // result
514 // performs a logical and on two
515 // integers
516 final static short land = 0x7f; // value1, value2 ?
517 // result
518 // bitwise and of two longs
519 final static short l2d = 0x8a; // value ? result
520 // converts a
521 // long to a double
522 final static short f2i = 0x8b; // value ? result
523 // converts a
524 // float to an int
525 final static short f2l = 0x8c; // value ? result
526 // converts a
527 // float to a long
528 final static short f2d = 0x8d; // value ? result
529 // converts a
530 // float to a double
531 final static short d2i = 0x8e; // value ? result
532 // converts a
533 // double to an int
534 final static short d2l = 0x8f; // value ? result
535 // converts a
536 // double to a long
537 final static short ifne = 0x9a; // branchbyte1,
538 // branchbyte2
539 // value ? if value is not 0,
540 // branch to instruction at
541 // branchoffset (signed short
542 // constructed from unsigned
543 // bytes branchbyte1 << 8 +
544 // branchbyte2)
545 final static short iflt = 0x9b; // branchbyte1,
546 // branchbyte2
547 // value ? if value is less than
548 // 0, branch to instruction at
549 // branchoffset (signed short
550 // constructed from unsigned
551 // bytes branchbyte1 << 8 +
552 // branchbyte2)
553 final static short ifge = 0x9c; // branchbyte1,
554 // branchbyte2
555 // value ? if value is greater
556 // than or equal to 0, branch to
557 // instruction at branchoffset
558 // (signed short constructed
559 // from unsigned bytes
560 // branchbyte1 << 8 +
561 // branchbyte2)
562 final static short ifgt = 0x9d; // branchbyte1,
563 // branchbyte2
564 // value ? if value is greater
565 // than 0, branch to instruction
566 // at branchoffset (signed short
567 // constructed from unsigned
568 // bytes branchbyte1 << 8 +
569 // branchbyte2)
570 final static short ifle = 0x9e; // branchbyte1,
571 // branchbyte2
572 // value ? if value is less than
573 // or equal to 0, branch to
574 // instruction at branchoffset
575 // (signed short constructed
576 // from unsigned bytes
577 // branchbyte1 << 8 +
578 // branchbyte2)
579 final static short if_icmpeq = 0x9f; // branchbyte1,
580 // branchbyte2
581 // value1, value2 ? if ints are
582 // equal, branch to instruction
583 // at branchoffset (signed short
584 // constructed from unsigned
585 // bytes branchbyte1 << 8 +
586 // branchbyte2)
587 final static short if_icmpne = 0xa0; // branchbyte1,
588 // branchbyte2
589 // value1, value2 ? if ints are
590 // not equal, branch to
591 // instruction at branchoffset
592 // (signed short constructed
593 // from unsigned bytes
594 // branchbyte1 << 8 +
595 // branchbyte2)
596 final static short if_icmplt = 0xa1; // branchbyte1,
597 // branchbyte2
598 // value1, value2 ? if value1 is
599 // less than value2, branch to
600 // instruction at branchoffset
601 // (signed short constructed
602 // from unsigned bytes
603 // branchbyte1 << 8 +
604 // branchbyte2)
605 final static short if_icmpge = 0xa2; // branchbyte1,
606 // branchbyte2
607 // value1, value2 ? if value1 is
608 // greater than or equal to
609 // value2, branch to instruction
610 // at branchoffset (signed short
611 // constructed from unsigned
612 // bytes branchbyte1 << 8 +
613 // branchbyte2)
614 final static short if_icmpgt = 0xa3; // branchbyte1,
615 // branchbyte2
616 // value1, value2 ? if value1 is
617 // greater than value2, branch
618 // to instruction at
619 // branchoffset (signed short
620 // constructed from unsigned
621 // bytes branchbyte1 << 8 +
622 // branchbyte2)
623 final static short if_icmple = 0xa4; // branchbyte1,
624 // branchbyte2
625 // value1, value2 ? if value1 is
626 // less than or equal to value2,
627 // branch to instruction at
628 // branchoffset (signed short
629 // constructed from unsigned
630 // bytes branchbyte1 << 8 +
631 // branchbyte2)
632 final static short if_acmpeq = 0xa5; // branchbyte1,
633 // branchbyte2
634 // value1, value2 ? if
635 // references are equal, branch
636 // to instruction at
637 // branchoffset (signed short
638 // constructed from unsigned
639 // bytes branchbyte1 << 8 +
640 // branchbyte2)
641 final static short if_acmpne = 0xa6; // branchbyte1,
642 // branchbyte2
643 // value1, value2 ? if
644 // references are not equal,
645 // branch to instruction at
646 // branchoffset (signed short
647 // constructed from unsigned
648 // bytes branchbyte1 << 8 +
649 // branchbyte2)
650 final static short goto_ = 0xa7; // branchbyte1,
651 // branchbyte2 [no
652 // change] goes to another
653 // instruction at branchoffset
654 // (signed short constructed
655 // from unsigned bytes
656 // branchbyte1 << 8 +
657 // branchbyte2)
658 final static short jsr = 0xa8; // branchbyte1,
659 // branchbyte2 ?
660 // address jump to subroutine at
661 // branchoffset (signed short
662 // constructed from unsigned
663 // bytes branchbyte1 << 8 +
664 // branchbyte2) and place the
665 // return address on the stack
666 final static short ret = 0xa9; // index [No change]
667 // continue
668 // execution from address taken
669 // from a local variable #index
670 // (the asymmetry with jsr is
671 // intentional)
672 final static short tableswitch = 0xaa; // [0-3 bytes padding],
673 // defaultbyte1, defaultbyte2,
674 // defaultbyte3, defaultbyte4,
675 // lowbyte1, lowbyte2, lowbyte3,
676 // lowbyte4, highbyte1,
677 // highbyte2, highbyte3,
678 // highbyte4, jump offsets...
679 // index ? continue execution
680 // from an address in the table
681 // at offset index
682 final static short lookupswitch = 0xab; // <0-3 bytes padding>,
683 // defaultbyte1, defaultbyte2,
684 // defaultbyte3, defaultbyte4,
685 // npairs1, npairs2, npairs3,
686 // npairs4, match-offset
687 // pairs... key ? a target
688 // address is looked up from a
689 // table using a key and
690 // execution continues from the
691 // instruction at that address
692 final static short ireturn = 0xac; // value ? [empty]
693 // returns an
694 // integer from a method
695 final static short lreturn = 0xad; // value ? [empty]
696 // returns a
697 // long value
698 final static short freturn = 0xae; // value ? [empty]
699 // returns a
700 // float
701 final static short dreturn = 0xaf; // value ? [empty]
702 // returns a
703 // double from a method
704 final static short areturn = 0xb0; // objectref ? [empty]
705 // returns a
706 // reference from a method
707 final static short return_ = 0xb1; // ? [empty] return void
708 // from
709 // method
710 final static short getstatic = 0xb2; // index1, index2 ?
711 // value gets a
712 // static field value of a
713 // class, where the field is
714 // identified by field reference
715 // in the constant pool index
716 // (index1 << 8 + index2)
717 final static short putstatic = 0xb3; // indexbyte1,
718 // indexbyte2 value
719 // ? set static field to value
720 // in a class, where the field
721 // is identified by a field
722 // reference index in constant
723 // pool (indexbyte1 << 8 +
724 // indexbyte2)
725 final static short getfield = 0xb4; // index1, index2
726 // objectref ?
727 // value gets a field value of
728 // an object objectref, where
729 // the field is identified by
730 // field reference in the
731 // constant pool index (index1
732 // << 8 + index2)
733 final static short putfield = 0xb5; // indexbyte1,
734 // indexbyte2
735 // objectref, value ? set field
736 // to value in an object
737 // objectref, where the field is
738 // identified by a field
739 // reference index in constant
740 // pool (indexbyte1 << 8 +
741 // indexbyte2)
742 final static short invokevirtual = 0xb6; // indexbyte1,
743 // indexbyte2
744 // objectref, [arg1, arg2, ...]
745 // ? invoke virtual method on
746 // object objectref, where the
747 // method is identified by
748 // method reference index in
749 // constant pool (indexbyte1 <<
750 // 8 + indexbyte2)
751 final static short invokespecial = 0xb7; // indexbyte1,
752 // indexbyte2
753 // objectref, [arg1, arg2, ...]
754 // ? invoke instance method on
755 // object objectref, where the
756 // method is identified by
757 // method reference index in
758 // constant pool (indexbyte1 <<
759 // 8 + indexbyte2)
760 final static short invokestatic = 0xb8; // indexbyte1,
761 // indexbyte2 [arg1,
762 // arg2, ...] ? invoke a static
763 // method, where the method is
764 // identified by method
765 // reference index in constant
766 // pool (indexbyte1 << 8 +
767 // indexbyte2)
768 final static short invokeinterface = 0xb9; // indexbyte1,
769 // indexbyte2,
770 // count, 0 objectref, [arg1,
771 // arg2, ...] ? invokes an
772 // interface method on object
773 // objectref, where the
774 // interface method is
775 // identified by method
776 // reference index in constant
777 // pool (indexbyte1 << 8 +
778 // indexbyte2)
779 final static short xxxunusedxxx = 0xba; // this opcode is
780 // reserved "for
781 // historical reasons"
782 final static short new_ = 0xbb; // indexbyte1,
783 // indexbyte2 ?
784 // objectref creates new object
785 // of type identified by class
786 // reference in constant pool
787 // index (indexbyte1 << 8 +
788 // indexbyte2)
789 final static short newarray = 0xbc; // atype count ?
790 // arrayref
791 // creates new array with count
792 // elements of primitive type
793 // identified by atype
794 final static short anewarray = 0xbd; // indexbyte1,
795 // indexbyte2 count
796 // ? arrayref creates a new
797 // array of references of length
798 // count and component type
799 // identified by the class
800 // reference index (indexbyte1
801 // << 8 + indexbyte2) in the
802 // constant pool
803 final static short arraylength = 0xbe; // arrayref ? length
804 // gets the
805 // length of an array
806 final static short athrow = 0xbf; // objectref ? [empty],
807 // objectref throws an error or
808 // exception (notice that the
809 // rest of the stack is cleared,
810 // leaving only a reference to
811 // the Throwable)
812 final static short checkcast = 0xc0; // indexbyte1,
813 // indexbyte2
814 // objectref ? objectref checks
815 // whether an objectref is of a
816 // certain type, the class
817 // reference of which is in the
818 // constant pool at index
819 // (indexbyte1 << 8 +
820 // indexbyte2)
821 final static short instanceof_ = 0xc1; // indexbyte1,
822 // indexbyte2
823 // objectref ? result determines
824 // if an object objectref is of
825 // a given type, identified by
826 // class reference index in
827 // constant pool (indexbyte1 <<
828 // 8 + indexbyte2)
829 final static short monitorenter = 0xc2; // objectref ? enter
830 // monitor for
831 // object ("grab the lock" -
832 // start of synchronized()
833 // section)
834 final static short monitorexit = 0xc3; // objectref ? exit
835 // monitor for
836 // object ("release the lock" -
837 // end of synchronized()
838 // section)
839 final static short wide = 0xc4; // opcode, indexbyte1,
840 // indexbyte2
841 final static short multianewarray = 0xc5; // indexbyte1,
842 // indexbyte2,
843 // dimensions count1,
844 // [count2,...] ? arrayref
845 // create a new array of
846 // dimensions dimensions with
847 // elements of type identified
848 // by class reference in
849 // constant pool index
850 // (indexbyte1 << 8 +
851 // indexbyte2); the sizes of
852 // each dimension is identified
853 // by count1, [count2, etc]
854 final static short ifnull = 0xc6; // branchbyte1,
855 // branchbyte2
856 // value ? if value is null,
857 // branch to instruction at
858 // branchoffset (signed short
859 // constructed from unsigned
860 // bytes branchbyte1 << 8 +
861 // branchbyte2)
862 final static short ifnonnull = 0xc7; // branchbyte1,
863 // branchbyte2
864 // value ? if value is not null,
865 // branch to instruction at
866 // branchoffset (signed short
867 // constructed from unsigned
868 // bytes branchbyte1 << 8 +
869 // branchbyte2)
870 final static short goto_w = 0xc8; // branchbyte1,
871 // branchbyte2,
872 // branchbyte3, branchbyte4 [no
873 // change] goes to another
874 // instruction at branchoffset
875 // (signed int constructed from
876 // unsigned bytes branchbyte1 <<
877 // 24 + branchbyte2 << 16 +
878 // branchbyte3 << 8 +
879 // branchbyte4)
880 final static short jsr_w = 0xc9; // branchbyte1,
881 // branchbyte2,
882 // branchbyte3, branchbyte4 ?
883 // address jump to subroutine at
884 // branchoffset (signed int
885 // constructed from unsigned
886 // bytes branchbyte1 << 24 +
887 // branchbyte2 << 16 +
888 // branchbyte3 << 8 +
889 // branchbyte4) and place the
890 // return address on the stack
891 final static short breakpoint = 0xca; // reserved for
892 // breakpoints in
893 // Java debuggers; should not
894 // appear in any class file
895 final static short impdep1 = 0xfe; // reserved for
896 // implementation-dependent
897 // operations within debuggers;
898 // should not appear in any
899 // class file
900 final static short impdep2 = 0xff; // reserved for
901 // implementation-dependent
902 // operations within debuggers;
903 // should not appear in any
904 // class file
905
906 final static byte OFFSETS[] = new byte[256];
907
908 static {
909 OFFSETS[bipush] = 1; // byte ? value pushes a byte onto the
910 // stack as an integer value
911 OFFSETS[sipush] = 2; // byte1, byte2 ? value pushes a signed
912 // integer (byte1 << 8 + byte2) onto the
913 // stack
914 OFFSETS[ldc] = 1; // index ? value pushes a constant
915 // #index from a constant pool (String,
916 // int, float or class type) onto the
917 // stack
918 OFFSETS[ldc_w] = 2; // indexbyte1, indexbyte2 ? value pushes
919 // a constant #index from a constant
920 // pool (String, int, float or class
921 // type) onto the stack (wide index is
922 // constructed as indexbyte1 << 8 +
923 // indexbyte2)
924 OFFSETS[ldc2_w] = 2; // indexbyte1, indexbyte2 ? value pushes
925 // a constant #index from a constant
926 // pool (double or long) onto the stack
927 // (wide index is constructed as
928 // indexbyte1 << 8 + indexbyte2)
929 OFFSETS[iload] = 1; // index ? value loads an int value from
930 // a variable #index
931 OFFSETS[lload] = 1; // index ? value load a long value from
932 // a local variable #index
933 OFFSETS[fload] = 1; // index ? value loads a float value
934 // from a local variable #index
935 OFFSETS[dload] = 1; // index ? value loads a double value
936 // from a local variable #index
937 OFFSETS[aload] = 1; // index ? objectref loads a reference
938 // onto the stack from a local variable
939 // #index
940 OFFSETS[istore] = 1; // index value ? store int value into
941 // variable #index
942 OFFSETS[lstore] = 1; // index value ? store a long value in a
943 // local variable #index
944 OFFSETS[fstore] = 1; // index value ? stores a float value
945 // into a local variable #index
946 OFFSETS[dstore] = 1; // index value ? stores a double value
947 // into a local variable #index
948 OFFSETS[iinc] = 2; // index, const [No change] increment
949 // local variable #index by signed byte
950 // const
951 OFFSETS[ifeq] = 2; // branchbyte1, branchbyte2 value ? if
952 // value is 0, branch to instruction at
953 // branchoffset (signed short
954 // constructed from unsigned bytes
955 // branchbyte1 << 8 + branchbyte2)
956 OFFSETS[astore] = 1; // index objectref ? stores a reference
957 // into a local variable #index
958 OFFSETS[ifne] = 2; // branchbyte1, branchbyte2 value ? if
959 // value is not 0, branch to instruction
960 // at branchoffset (signed short
961 // constructed from unsigned bytes
962 // branchbyte1 << 8 + branchbyte2)
963 OFFSETS[iflt] = 2; // branchbyte1, branchbyte2 value ? if
964 // value is less than 0, branch to
965 // instruction at branchoffset (signed
966 // short constructed from unsigned bytes
967 // branchbyte1 << 8 + branchbyte2)
968 OFFSETS[ifge] = 2; // branchbyte1, branchbyte2 value ? if
969 // value is greater than or equal to 0,
970 // branch to instruction at branchoffset
971 // (signed short constructed from
972 // unsigned bytes branchbyte1 << 8 +
973 // branchbyte2)
974 OFFSETS[ifgt] = 2; // branchbyte1, branchbyte2 value ? if
975 // value is greater than 0, branch to
976 // instruction at branchoffset (signed
977 // short constructed from unsigned bytes
978 // branchbyte1 << 8 + branchbyte2)
979 OFFSETS[ifle] = 2; // branchbyte1, branchbyte2 value ? if
980 // value is less than or equal to 0,
981 // branch to instruction at branchoffset
982 // (signed short constructed from
983 // unsigned bytes branchbyte1 << 8 +
984 // branchbyte2)
985 OFFSETS[if_icmpeq] = 2; // branchbyte1, branchbyte2 value1,
986 // value2 ? if ints are equal,
987 // branch to instruction at
988 // branchoffset (signed short
989 // constructed from unsigned bytes
990 // branchbyte1 << 8 + branchbyte2)
991 OFFSETS[if_icmpne] = 2; // branchbyte1, branchbyte2 value1,
992 // value2 ? if ints are not equal,
993 // branch to instruction at
994 // branchoffset (signed short
995 // constructed from unsigned bytes
996 // branchbyte1 << 8 + branchbyte2)
997 OFFSETS[if_icmplt] = 2; // branchbyte1, branchbyte2 value1,
998 // value2 ? if value1 is less than
999 // value2, branch to instruction at
1000 // branchoffset (signed short
1001 // constructed from unsigned bytes
1002 // branchbyte1 << 8 + branchbyte2)
1003 OFFSETS[if_icmpge] = 2; // branchbyte1, branchbyte2 value1,
1004 // value2 ? if value1 is greater
1005 // than or equal to value2, branch
1006 // to instruction at branchoffset
1007 // (signed short constructed from
1008 // unsigned bytes branchbyte1 << 8 +
1009 // branchbyte2)
1010 OFFSETS[if_icmpgt] = 2; // branchbyte1, branchbyte2 value1,
1011 // value2 ? if value1 is greater
1012 // than value2, branch to
1013 // instruction at branchoffset
1014 // (signed short constructed from
1015 // unsigned bytes branchbyte1 << 8 +
1016 // branchbyte2)
1017 OFFSETS[if_icmple] = 2; // branchbyte1, branchbyte2 value1,
1018 // value2 ? if value1 is less than
1019 // or equal to value2, branch to
1020 // instruction at branchoffset
1021 // (signed short constructed from
1022 // unsigned bytes branchbyte1 << 8 +
1023 // branchbyte2)
1024 OFFSETS[if_acmpeq] = 2; // branchbyte1, branchbyte2 value1,
1025 // value2 ? if references are equal,
1026 // branch to instruction at
1027 // branchoffset (signed short
1028 // constructed from unsigned bytes
1029 // branchbyte1 << 8 + branchbyte2)
1030 OFFSETS[if_acmpne] = 2; // branchbyte1, branchbyte2 value1,
1031 // value2 ? if references are not
1032 // equal, branch to instruction at
1033 // branchoffset (signed short
1034 // constructed from unsigned bytes
1035 // branchbyte1 << 8 + branchbyte2)
1036 OFFSETS[goto_] = 2; // branchbyte1, branchbyte2 [no change]
1037 // goes to another instruction at
1038 // branchoffset (signed short
1039 // constructed from unsigned bytes
1040 // branchbyte1 << 8 + branchbyte2)
1041 OFFSETS[jsr] = 2; // branchbyte1, branchbyte2 ? address
1042 // jump to subroutine at branchoffset
1043 // (signed short constructed from
1044 // unsigned bytes branchbyte1 << 8 +
1045 // branchbyte2) and place the return
1046 // address on the stack
1047 OFFSETS[ret] = 1; // index [No change] continue execution
1048 // from address taken from a local
1049 // variable #index (the asymmetry with
1050 // jsr is intentional)
1051 OFFSETS[tableswitch] = -1; // [0-3 bytes padding],
1052 // defaultbyte1, defaultbyte2,
1053 // defaultbyte3, defaultbyte4,
1054 // lowbyte1, lowbyte2, lowbyte3,
1055 // lowbyte4, highbyte1,
1056 // highbyte2, highbyte3,
1057 // highbyte4, jump offsets...
1058 // index ? continue execution
1059 // from an address in the table
1060 // at offset index
1061 OFFSETS[lookupswitch] = -1; // <0-3 bytes padding>,
1062 // defaultbyte1, defaultbyte2,
1063 // defaultbyte3, defaultbyte4,
1064 // npairs1, npairs2, npairs3,
1065 // npairs4, match-offset
1066 // pairs... key ? a target
1067 // address is looked up from a
1068 // table using a key and
1069 // execution continues from the
1070 // instruction at that address
1071 OFFSETS[getstatic] = 2; // index1, index2 ? value gets a
1072 // static field value of a class,
1073 // where the field is identified by
1074 // field reference in the constant
1075 // pool index (index1 << 8 + index2)
1076 OFFSETS[putstatic] = 2; // indexbyte1, indexbyte2 value ?
1077 // set static field to value in a
1078 // class, where the field is
1079 // identified by a field reference
1080 // index in constant pool
1081 // (indexbyte1 << 8 + indexbyte2)
1082 OFFSETS[getfield] = 2; // index1, index2 objectref ? value
1083 // gets a field value of an object
1084 // objectref, where the field is
1085 // identified by field reference in
1086 // the constant pool index (index1
1087 // << 8 + index2)
1088 OFFSETS[putfield] = 2; // indexbyte1, indexbyte2 objectref,
1089 // value ? set field to value in an
1090 // object objectref, where the field
1091 // is identified by a field
1092 // reference index in constant pool
1093 // (indexbyte1 << 8 + indexbyte2)
1094 OFFSETS[invokevirtual] = 2; // indexbyte1, indexbyte2
1095 // objectref, [arg1, arg2, ...]
1096 // ? invoke virtual method on
1097 // object objectref, where the
1098 // method is identified by
1099 // method reference index in
1100 // constant pool (indexbyte1 <<
1101 // 8 + indexbyte2)
1102 OFFSETS[invokespecial] = 2; // indexbyte1, indexbyte2
1103 // objectref, [arg1, arg2, ...]
1104 // ? invoke instance method on
1105 // object objectref, where the
1106 // method is identified by
1107 // method reference index in
1108 // constant pool (indexbyte1 <<
1109 // 8 + indexbyte2)
1110 OFFSETS[invokestatic] = 2; // indexbyte1, indexbyte2 [arg1,
1111 // arg2, ...] ? invoke a static
1112 // method, where the method is
1113 // identified by method
1114 // reference index in constant
1115 // pool (indexbyte1 << 8 +
1116 // indexbyte2)
1117 OFFSETS[invokeinterface] = 2; // indexbyte1, indexbyte2,
1118 // count, 0 objectref,
1119 // [arg1, arg2, ...] ?
1120 // invokes an interface
1121 // method on object
1122 // objectref, where the
1123 // interface method is
1124 // identified by method
1125 // reference index in
1126 // constant pool (indexbyte1
1127 // << 8 + indexbyte2)
1128 OFFSETS[new_] = 2; // indexbyte1, indexbyte2 ? objectref
1129 // creates new object of type identified
1130 // by class reference in constant pool
1131 // index (indexbyte1 << 8 + indexbyte2)
1132 OFFSETS[newarray] = 1; // atype count ? arrayref creates
1133 // new array with count elements of
1134 // primitive type identified by
1135 // atype
1136 OFFSETS[anewarray] = 2; // indexbyte1, indexbyte2 count ?
1137 // arrayref creates a new array of
1138 // references of length count and
1139 // component type identified by the
1140 // class reference index (indexbyte1
1141 // << 8 + indexbyte2) in the
1142 // constant pool
1143 OFFSETS[checkcast] = 2; // indexbyte1, indexbyte2 objectref
1144 // ? objectref checks whether an
1145 // objectref is of a certain type,
1146 // the class reference of which is
1147 // in the constant pool at index
1148 // (indexbyte1 << 8 + indexbyte2)
1149 OFFSETS[instanceof_] = 2; // indexbyte1, indexbyte2 objectref
1150 // ? result determines if an object
1151 // objectref is of a given type,
1152 // identified by class reference
1153 // index in constant pool
1154 // (indexbyte1 << 8 + indexbyte2)
1155 OFFSETS[wide] = 3; // opcode, indexbyte1, indexbyte2
1156 OFFSETS[multianewarray] = 3; // indexbyte1, indexbyte2,
1157 // dimensions count1,
1158 // [count2,...] ? arrayref
1159 // create a new array of
1160 // dimensions dimensions with
1161 // elements of type identified
1162 // by class reference in
1163 // constant pool index
1164 // (indexbyte1 << 8 +
1165 // indexbyte2); the sizes of
1166 // each dimension is identified
1167 // by count1, [count2, etc]
1168 OFFSETS[ifnull] = 2; // branchbyte1, branchbyte2 value ? if
1169 // value is null, branch to instruction
1170 // at branchoffset (signed short
1171 // constructed from unsigned bytes
1172 // branchbyte1 << 8 + branchbyte2)
1173 OFFSETS[ifnonnull] = 2; // branchbyte1, branchbyte2 value ?
1174 // if value is not null, branch to
1175 // instruction at branchoffset
1176 // (signed short constructed from
1177 // unsigned bytes branchbyte1 << 8 +
1178 // branchbyte2)
1179 OFFSETS[goto_w] = 4; // branchbyte1, branchbyte2,
1180 // branchbyte3, branchbyte4 [no change]
1181 // goes to another instruction at
1182 // branchoffset (signed int constructed
1183 // from unsigned bytes branchbyte1 << 24
1184 // + branchbyte2 << 16 + branchbyte3 <<
1185 // 8 + branchbyte4)
1186 OFFSETS[jsr_w] = 4; // branchbyte1, branchbyte2,
1187 // branchbyte3, branchbyte4 ? address
1188 // jump to subroutine at branchoffset
1189 // (signed int constructed from unsigned
1190 // bytes branchbyte1 << 24 + branchbyte2
1191 // << 16 + branchbyte3 << 8 +
1192 // branchbyte4) and place the return
1193 // address on the stack
1194 }
1195
1196}