* src/vm/jit/intrp/peephole.c: Updated to current codebase.
[cacao.git] / src / vm / jit / intrp / java.vmg
1 \
2 \ JVM instruction specs
3 \
4 \ This file contains primitive specifications in the following format:
5
6 \ name ( stack effect ) [ number ]
7 \ [""glossary entry""]
8 \ C code
9 \ [:
10 \ Forth code]
11
12 \ Note: Fields in brackets are optional.  Word specifications have to
13 \ be separated by at least one empty line
14 \
15 \ Both name and stack items (in the stack effect) must
16 \ conform to the C identifier syntax or the C compiler will complain.
17 \ The branch field can be one of "branch", "cond", "indirect", or empty.
18
19 \ These specifications are automatically translated into C-code for the
20 \ interpreter and into some other files. I hope that your C compiler has
21 \ decent optimization, otherwise the automatically generated code will
22 \ be somewhat slow. The Forth version of the code is included for manual
23 \ compilers, so they will need to compile only the important words.
24
25 \ Note that stack pointer adjustment is performed according to stack
26 \ effect by automatically generated code and NEXT is automatically
27 \ appended to the C code. Also, you can use the names in the stack
28 \ effect in the C code. Stack access is automatic. One exception: if
29 \ your code does not fall through, the results are not stored into the
30 \ stack. Use different names on both sides of the '--', if you change a
31 \ value (some stores to the stack are optimized away).
32
33
34 \E stack data-stack sp Cell
35 \E
36 \E s" u4"                  single data-stack type-prefix ui
37 \E s" Cell"                single data-stack type-prefix v
38 \E s" s4"                  single data-stack type-prefix b \ byte
39 \E s" s4"                  single data-stack type-prefix s \ short
40 \E s" s4"                  single data-stack type-prefix i
41 \E s" s8"                  double data-stack type-prefix l
42 \E s" float"               single data-stack type-prefix f
43 \E s" double"              double data-stack type-prefix d
44
45 \ we use a lot of types for the former "a" (address) type; this gives
46 \ better typechecking in the C code, and allows better output from the
47 \ disassembler and the tracer.
48
49 \E s" java_objectheader *" single data-stack type-prefix aRef
50 \E s" java_arrayheader *"  single data-stack type-prefix aArray
51 \E s" Inst **"             single data-stack type-prefix aaTarget
52 \E s" classinfo *"         single data-stack type-prefix aClass
53 \E s" constant_classref *" single data-stack type-prefix acr
54 \E s" u1 *"                single data-stack type-prefix addr
55 \E s" functionptr"         single data-stack type-prefix af
56 \E s" methodinfo *"        single data-stack type-prefix am
57 \E s" fieldinfo *"         single data-stack type-prefix afi
58 \E s" Cell *"              single data-stack type-prefix acell
59 \E s" Inst *"              single data-stack type-prefix ainst
60 \E s" unresolved_field *"  single data-stack type-prefix auf
61 \E s" unresolved_method *" single data-stack type-prefix aum
62 \E s" vftbl_t *"           single data-stack type-prefix avftbl
63 \E inst-stream  stack-prefix #
64
65 \ The stack variables have the following types:
66
67 \ name matches  type
68 \ i.*           jint
69 \ l.*           jlong
70 \ s.*           Jshort
71 \ b.*           Jbyte
72 \ c.*           Jchar
73 \ f.*           jfloat
74 \ d.*           jdouble
75 \ a.*           jref
76 \ r.*           Jretaddr
77 \
78
79 \ Starting a name with # indicates an inline argument instead of a stack
80 \ argument; the rest of the name matches as usual.
81
82 \
83 \ Questions:
84 \      How does prims2x know the length of each instruction,
85 \      where the instruction has immediate operands. We need
86 \      some way to communicate this or compute it.
87 \
88 \      Some instructions don't care about the type of the
89 \      values that they work with. For example, POP doesn't
90 \      care what type the value on the top of the stack is.
91 \      We need to communicate this.
92 \      I'll add a type v (for void, or variable, whichever you
93 \      prefer) which just means there's one element of the normal
94 \      size on the stack, and we don't care what its type is.
95 \
96 \
97 \ /*
98 \ Define the following macros before including this file.
99 \
100 \ # define instr(name,opcode,label,len,syntax,body) 
101 \ # define undef(name,opcode,label,len,syntax,body) 
102 \ # define custm(name,opcode,label,len,syntax,body) 
103 \
104 \
105 \ To avoid race conditions, rewriting proceeds as follows: 
106 \  1) the needed operands are fetched from the orignal byte code 
107 \  2) the new operands are written
108 \  3) the new operator is written
109 \  4) the quick-version of the instruction is executed.
110 \
111 \ Note: the byte code remains unchanged.
112
113 \ */
114
115 \ stack cache setup
116
117 \E register IPTOS Cell
118 \E register spTOS Cell
119
120 \E create IPregs IPTOS ,
121 \E create regs spTOS ,
122
123 \E IPregs 1 0 stack-state IPss1
124 \E regs 1 0 stack-state ss0
125
126 \ the first of these is the default state
127 \E state S0
128
129 \E ss0 data-stack S0 set-ss
130
131 \E IPss1 inst-stream S0 set-ss
132
133 \E data-stack to cache-stack
134 \E here 1 cache-states 2! s0 ,
135
136 \ !! the following should be automatic
137 \E S0 to state-default
138 \E state-default to state-in
139 \E state-default to state-out
140
141 \E s" codegendata *" threaded-code-pointer-type 2!
142
143 \ This is stub code for methods that we have not yet translated.
144 \ Initially, the code for each method is set to this stub. The
145 \ first time the method is called, the code in the stub runs, which
146 \ translates the bytecode, and replaces the stub with the threaded code.
147
148 \ instr(NOP, 0, nop, 1, op, {})
149
150 ICONST ( #vConst -- vConst ) opt
151
152 LCONST ( #l -- l ) opt
153
154 ACONST ( #aRef -- aRef ) opt
155
156 ACONST1 ( #aRef #acrUnused -- aRef ) opt
157
158 PATCHER_ACONST ( #aRef #acr ... -- )
159 stackframeinfo sfi;
160 bool result;
161 global_sp = sp;
162 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
163 result = intrp_patcher_aconst((u1 *) (IP - 3));
164 stacktrace_remove_stackframeinfo(&sfi);
165 CLEAR_global_sp;
166 if (!result)
167   THROW0;
168 STORE_ORDER_BARRIER();
169 IP[-3] = INST_ADDR(ACONST1);
170 SET_IP(IP - 3);
171 patchersuper_rewrite(IP);
172
173 ILOAD ( #vLocal -- vResult ) 0x15
174 {
175   vResult = access_local_int(vLocal);
176 }
177
178 LLOAD ( #vLocal -- lResult ) 0x16
179 {
180   vm_twoCell2l(access_local_cell(vLocal), access_local_cell(vLocal-SIZEOF_VOID_P), lResult);
181 }
182
183 ALOAD ( #vLocal -- aRef ) 0x19
184 {
185   aRef = (java_objectheader *)access_local_cell(vLocal);
186 }
187
188 IALOAD ( aArray iIndex -- vResult ) 0x2e
189 {
190   CHECK_NULL_PTR(aArray);
191   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
192   ;
193   vResult = access_array_int(aArray, iIndex);
194 }
195
196 FALOAD ( aArray iIndex -- fResult ) 0x2e
197 {
198   CHECK_NULL_PTR(aArray);
199   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
200   ;
201   fResult = access_array_float(aArray, iIndex);
202 }
203
204 LALOAD ( aArray iIndex -- lResult ) 0x2f
205 {
206   CHECK_NULL_PTR(aArray);
207   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
208   ;
209   lResult = access_array_long(aArray, iIndex);
210 }
211
212 AALOAD ( aArray iIndex -- aRef ) 0x32
213 {
214   CHECK_NULL_PTR(aArray);
215   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
216   ;
217   aRef = access_array_addr(aArray, iIndex);
218 }
219
220 BALOAD ( aArray iIndex -- vResult ) 0x33
221 {
222   CHECK_NULL_PTR(aArray);
223   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
224   ;
225   vResult = access_array_byte(aArray, iIndex);
226 }
227
228 CALOAD ( aArray iIndex -- vResult ) 0x34
229 {
230   CHECK_NULL_PTR(aArray);
231   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
232   ;
233   vResult = access_array_char(aArray, iIndex);
234 }
235
236 SALOAD ( aArray iIndex -- vResult ) 0x35
237 {
238   CHECK_NULL_PTR(aArray);
239   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
240   ;
241   vResult = access_array_short(aArray, iIndex);
242 }
243
244 ISTORE ( #vLocal vValue -- ) 0x36
245 {
246   access_local_int(vLocal) = vValue;
247 }
248
249 LSTORE ( #vLocal lValue -- ) 0x37
250 {
251   vm_l2twoCell(lValue, access_local_cell(vLocal), access_local_cell(vLocal-SIZEOF_VOID_P));
252 }
253
254 ASTORE ( #vLocal aRef -- ) 0x3a
255 {
256   access_local_cell(vLocal) = (Cell)aRef;
257 }
258
259 IASTORE ( aArray iIndex iValue -- ) 0x4f
260 {
261   CHECK_NULL_PTR(aArray);
262   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
263   ;
264   access_array_int(aArray, iIndex) = iValue;
265 }
266
267 FASTORE ( aArray iIndex fValue -- ) 0x4f
268 {
269   CHECK_NULL_PTR(aArray);
270   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
271   ;
272   access_array_float(aArray, iIndex) = fValue;
273 }
274
275 LASTORE ( aArray iIndex lValue -- ) 0x50
276 {
277   CHECK_NULL_PTR(aArray);
278   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
279   ;
280   access_array_long(aArray, iIndex) = lValue;
281 }
282
283 AASTORE ( aArray iIndex aRef -- ) 0x53
284 {
285   CHECK_NULL_PTR(aArray);
286   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
287   if (!builtin_canstore((java_objectarray *)aArray, aRef))
288       THROW(arraystoreexception);
289   access_array_addr(aArray, iIndex) = aRef;
290 }
291
292 BASTORE ( aArray iIndex iValue -- ) 0x54
293 {
294   CHECK_NULL_PTR(aArray);
295   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
296   ;
297   access_array_byte(aArray, iIndex) = iValue;
298 }
299
300 CASTORE ( aArray iIndex iValue -- ) 0x55
301 {
302   CHECK_NULL_PTR(aArray);
303   CHECK_OUT_OF_BOUNDS(aArray, iIndex);
304   ;
305   access_array_char(aArray, iIndex) = iValue;
306 }
307
308 POP ( vValue -- ) 0x57
309
310 POP2 ( vValue vValue -- ) 0x58
311
312 DUP ( vValue -- vValue vValue ) 0x59
313
314 DUP_X1 ( vValue2 vValue1 -- vValue1 vValue2 vValue1 ) 0x5a
315
316 DUP_X2 ( vValue3 vValue2 vValue1 -- vValue1 vValue3 vValue2 vValue1 ) 0x5b
317
318 DUP2 ( vValue2 vValue1 -- vValue2 vValue1 vValue2 vValue1 ) 0x5c
319
320 DUP2_X1 (vValue3 vValue2 vValue1 -- vValue2 vValue1 vValue3 vValue2 vValue1 ) 0x5d
321
322 DUP2_X2 ( vValue4 vValue3 vValue2 vValue1 -- vValue2 vValue1 vValue4 vValue3 vValue2 vValue1 ) 0x5e
323
324 SWAP ( vValue2 vValue1 -- vValue1 vValue2 ) 0x5f
325
326 IADD ( vValue1 vValue2 -- vResult ) 0x60
327 {
328   vResult = vValue2 + vValue1;
329 }
330
331 LADD ( lValue1 lValue2 -- lResult ) 0x61
332 {
333   lResult = lValue2 + lValue1;
334 }
335
336 FADD ( fValue1 fValue2 -- fResult ) 0x62
337 {
338   fResult = fValue1 + fValue2;
339 }
340
341 DADD ( dValue1 dValue2 -- dResult ) 0x63
342 {
343   dResult = dValue1 + dValue2;
344 }
345
346 ISUB ( vValue1 vValue2 -- vResult ) 0x64
347 {
348   vResult = vValue1 - vValue2;
349 }
350
351 LSUB ( lValue1 lValue2 -- lResult ) 0x65
352 {
353   lResult = lValue1 - lValue2;
354 }
355
356 FSUB ( fValue1 fValue2 -- fResult ) 0x66
357 {
358   fResult = fValue1 - fValue2;
359 }
360
361 DSUB ( dValue1 dValue2 -- dResult ) 0x67
362 {
363   dResult = dValue1 - dValue2;
364 }
365
366 IMUL ( vValue1 vValue2 -- vResult ) 0x68
367 {
368   vResult = vValue1 * vValue2;
369 }
370
371 LMUL ( lValue1 lValue2 -- lResult ) 0x69
372 {
373   lResult = lValue1 * lValue2;
374 }
375
376 FMUL ( fValue1 fValue2 -- fResult ) 0x6a
377 {
378   fResult = fValue1 * fValue2;
379 }
380
381 DMUL ( dValue1 dValue2 -- dResult ) 0x6b
382 {
383   dResult = dValue1 * dValue2;
384 }
385
386 IDIV ( iValue1 iValue2 -- iResult ) 0x6c
387 {
388   CHECK_ZERO_DIVISOR(iValue2);
389   ;
390   if (iValue1 == 0x80000000 && iValue2 == -1)
391     iResult=iValue1;
392   else
393     iResult = iValue1 / iValue2;
394 }
395
396 IDIVPOW2 ( i1 #ishift -- i2 ) opt
397 {
398   u4 sign = i1>>31;
399   s4 offset = sign >> (32-ishift);
400   i2=(i1+offset)>>ishift;
401 }
402
403 LDIV ( lValue1 lValue2 -- lResult ) 0x6d
404 {
405   CHECK_ZERO_DIVISOR(lValue2);
406   if (lValue1 == 0x8000000000000000LL && lValue2 == -1)
407     lResult=lValue1;
408   else
409     lResult = lValue1 / lValue2;
410 }
411
412 LDIVPOW2 ( l1 #ishift -- l2 )
413 {
414   u8 sign = l1>>63;
415   s8 offset = sign >> (64-ishift);
416   l2=(l1+offset)>>ishift;
417 }
418
419 FDIV ( fValue1 fValue2 -- fResult ) 0x6e
420 {
421   fResult = fValue1 / fValue2;
422 }
423
424 DDIV ( dValue1 dValue2 -- dResult ) 0x6f
425 {
426   dResult = dValue1 / dValue2;
427 }
428
429
430 IREM ( iValue1 iValue2 -- iResult ) 0x70
431 {
432   CHECK_ZERO_DIVISOR(iValue2);
433   if (iValue1 == 0x80000000 && iValue2 == -1)
434     iResult=0;
435   else
436     iResult = iValue1 % iValue2;
437 }
438
439 IREMPOW2 ( i1 #imask -- i2 )
440 s4 x = i1;
441 if (i1<0)
442   x += imask;
443 x &= ~imask;
444 i2 = i1-x;
445
446 LREM ( lValue1 lValue2 -- lResult ) 0x71
447 {
448   CHECK_ZERO_DIVISOR(lValue2);
449   if (lValue1 == 0x8000000000000000LL && lValue2 == -1)
450     lResult=0;
451   else
452     lResult = lValue1 % lValue2;
453 }
454
455 LREMPOW2 ( l1 #lmask -- l2 )
456 s8 x = l1;
457 if (l1<0)
458   x += lmask;
459 x &= ~lmask;
460 l2 = l1-x;
461
462 FREM ( fValue1 fValue2 -- fResult ) 0x72
463 {
464   fResult = builtin_frem(fValue1, fValue2);
465 }
466
467 DREM ( dValue1 dValue2 -- dResult ) 0x73
468 {
469   dResult = builtin_drem(dValue1, dValue2);
470 }
471
472 INEG ( vValue -- vResult ) 0x74
473 {
474   vResult = -vValue;
475 }
476
477 LNEG ( lValue -- lResult ) 0x75
478 {
479   lResult = -lValue;
480 }
481
482 FNEG ( fValue -- fResult ) 0x76
483 {
484   fResult = -fValue;
485 }
486
487 DNEG ( dValue -- dResult ) 0x77
488 {
489   dResult = -dValue;
490 }
491
492 ISHL ( vValue1 vValue2 -- vResult ) 0x78
493 {
494   vResult = vValue1 << (vValue2 & 31);
495 }
496
497 LSHL ( lValue1 vValue2 -- lResult ) 0x79
498 {
499   lResult = lValue1 << (vValue2 & 63);
500 }
501
502 ISHR ( iValue1 iValue2 -- iResult ) 0x7a
503 {
504   iResult = iValue1 >> (iValue2 & 31);
505 }
506
507 LSHR ( lValue1 iValue2 -- lResult ) 0x7b
508 {
509   lResult = lValue1 >> (iValue2 & 63);
510 }
511
512 IUSHR ( iValue1 vValue2 -- iResult ) 0x7c
513 {
514   iResult = ((unsigned) iValue1) >> (vValue2 & 31);
515 }
516
517 LUSHR ( lValue1 vValue2 -- lResult ) 0x7d
518 {
519   lResult = (unsigned long long) lValue1 >> (vValue2 & 63);
520 }
521
522 IAND ( vValue1 vValue2 -- vResult ) 0x7e
523 {
524   vResult = vValue1 & vValue2;
525 }
526
527 LAND ( lValue1 lValue2 -- lResult ) 0x7f
528 {
529   lResult = lValue1 & lValue2;
530 }
531
532 IOR ( vValue1 vValue2 -- vResult ) 0x80
533 {
534   vResult = vValue1 | vValue2;
535 }
536
537 LOR ( lValue1 lValue2 -- lResult ) 0x81
538 {
539   lResult = lValue1 | lValue2;
540 }
541
542 IXOR ( vValue1 vValue2 -- vResult ) 0x82
543 {
544   vResult = vValue1 ^ vValue2;
545 }
546
547 LXOR ( lValue1 lValue2 -- lResult ) 0x83
548 {
549   lResult = lValue1 ^ lValue2;
550 }
551
552 IINC ( #vOffset #iConst  -- ) 0x84
553 {
554   access_local_int(vOffset) += iConst;
555 }
556
557 I2L ( iValue -- lValue ) 0x85
558 {
559   lValue = iValue;
560 }
561
562 I2F ( iValue -- fValue ) 0x86
563 {
564   fValue = (float) iValue;
565 }
566
567 I2D ( iValue -- dValue ) 0x87
568 {
569   dValue = (double) iValue;
570 }
571
572 L2I ( lValue -- iValue ) 0x88
573 {
574   iValue = lValue;
575 }
576
577 L2F ( lValue -- fValue ) 0x89
578 {
579   fValue = (float) lValue;
580 }
581
582 L2D ( lValue -- dValue ) 0x8a
583 {
584   dValue = (double) lValue;
585 }
586
587 F2I ( fValue -- iValue ) 0x8b
588 {
589     iValue = builtin_f2i(fValue);
590 }
591
592 F2L ( fValue -- lValue ) 0x8c
593 {
594     lValue = builtin_f2l(fValue);
595 }
596
597 F2D ( fValue -- dValue ) 0x8d
598 {
599   dValue = fValue;
600 }
601
602 D2I ( dValue -- iValue ) 0x8e
603 {
604   iValue = builtin_d2i(dValue);
605 }
606
607 D2L ( dValue -- lValue ) 0x8f
608 {
609   lValue = builtin_d2l(dValue);
610 }
611
612 D2F ( dValue -- fValue ) 0x90
613 {
614   fValue = dValue;
615 }
616
617 INT2BYTE ( iValue -- iResult ) 0x91
618 {
619   iResult = (iValue << 24) >> 24; /* XXX: try "(s1)iValue" */
620 }
621
622
623 INT2CHAR ( iValue -- iResult ) 0x92
624 {
625   iResult = iValue & 0xFFFF;
626 }
627
628 INT2SHORT ( iValue -- iResult ) 0x93
629 {
630   iResult = (iValue << 16) >> 16; /* XXX: try "(s2)iValue" */
631 }
632
633 LCMP ( lValue1 lValue2 -- vResult ) 0x94
634 {
635   vResult = lValue1 < lValue2 ? -1 : lValue1 > lValue2 ? 1 : 0;
636 }
637
638 FCMPL ( fValue1 fValue2 -- vResult ) 0x95
639 {
640   vResult = builtin_fcmpl(fValue1, fValue2);
641 }
642
643 FCMPG ( fValue1 fValue2 -- vResult ) 0x96
644 {
645   vResult = builtin_fcmpg(fValue1, fValue2);
646 }
647
648 DCMPL ( dValue1 dValue2 -- iResult ) 0x97
649 {
650   iResult = builtin_dcmpl(dValue1, dValue2);
651 }
652
653 DCMPG ( dValue1 dValue2 -- iResult ) 0x98
654 {
655   iResult = builtin_dcmpg(dValue1, dValue2);
656 }
657
658 IFEQ ( #ainstTarget iValue -- ) 0x99
659 {
660   if ( iValue == 0 ) {
661     SET_IP(ainstTarget);
662   }
663 }
664
665 IFNE ( #ainstTarget iValue -- ) 0x9a
666 {
667   if ( iValue != 0 ) {
668     SET_IP(ainstTarget);
669   }
670 }
671
672 IFLT ( #ainstTarget iValue -- ) 0x9b
673 {
674   if ( iValue < 0 )
675     SET_IP(ainstTarget);
676 }
677
678 IFGE ( #ainstTarget iValue -- ) 0x9c
679 {
680   if ( iValue >= 0 )
681     SET_IP(ainstTarget);
682 }
683
684 IFGT ( #ainstTarget iValue -- ) 0x9d
685 {
686   if ( iValue > 0 )
687     SET_IP(ainstTarget);
688 }
689
690 IFLE ( #ainstTarget iValue -- ) 0x9e
691 {
692   if ( iValue <= 0 )
693     SET_IP(ainstTarget);
694 }
695
696 IF_ICMPEQ ( #ainstTarget iValue1 iValue2 -- ) 0x9f
697 {
698   if ( iValue1 == iValue2 )
699     SET_IP(ainstTarget);
700 }
701
702 IF_ICMPNE  ( #ainstTarget iValue1 iValue2 -- ) 0xa0
703 {
704   if ( iValue1 != iValue2 )
705     SET_IP(ainstTarget);
706 }
707
708 IF_ICMPLT  ( #ainstTarget iValue1 iValue2 -- ) 0xa1
709 {
710   if ( iValue1 < iValue2 )
711     SET_IP(ainstTarget);
712 }
713
714 IF_ICMPGE  ( #ainstTarget iValue1 iValue2 -- ) 0xa2
715 {
716   if ( iValue1 >= iValue2 )
717     SET_IP(ainstTarget);
718 }
719
720 IF_ICMPGT  ( #ainstTarget iValue1 iValue2 -- ) 0xa3
721 {
722   if ( iValue1 > iValue2 )
723     SET_IP(ainstTarget);
724 }
725
726 IF_ICMPLE  ( #ainstTarget iValue1 iValue2 -- ) 0xa4
727 {
728   if ( iValue1 <= iValue2 )
729     SET_IP(ainstTarget);
730 }
731
732 IF_LCMPEQ ( #ainstTarget lValue1 lValue2 -- ) opt
733 {
734   if ( lValue1 == lValue2 )
735     SET_IP(ainstTarget);
736 }
737
738 IF_LCMPNE  ( #ainstTarget lValue1 lValue2 -- ) opt
739 {
740   if ( lValue1 != lValue2 )
741     SET_IP(ainstTarget);
742 }
743
744 IF_LCMPLT  ( #ainstTarget lValue1 lValue2 -- ) opt
745 {
746   if ( lValue1 < lValue2 )
747     SET_IP(ainstTarget);
748 }
749
750 IF_LCMPGE  ( #ainstTarget lValue1 lValue2 -- ) opt
751 {
752   if ( lValue1 >= lValue2 )
753     SET_IP(ainstTarget);
754 }
755
756 IF_LCMPGT  ( #ainstTarget lValue1 lValue2 -- ) opt
757 {
758   if ( lValue1 > lValue2 )
759     SET_IP(ainstTarget);
760 }
761
762 IF_LCMPLE  ( #ainstTarget lValue1 lValue2 -- ) opt
763 {
764   if ( lValue1 <= lValue2 )
765     SET_IP(ainstTarget);
766 }
767
768 IF_ACMPEQ  ( #ainstTarget aRef1 aRef2 -- ) 0xa5
769 {
770   if ( aRef1 == aRef2 )
771     SET_IP(ainstTarget);
772 }
773
774 IF_ACMPNE  ( #ainstTarget aRef1 aRef2 -- ) 0xa6
775 {
776   if ( aRef1 != aRef2 )
777     SET_IP(ainstTarget);
778 }
779
780 GOTO (  #ainstTarget -- ) 0xa7
781 {
782   SET_IP(ainstTarget);
783 }
784
785 JSR (  #ainstTarget -- ainstRA ) 0xa8
786 {
787     /* Warning: The generator already adds 1 to the IP
788        because there is an inline parameter. Thus, instead
789        of writing IP + 1, we write...*/
790   ainstRA = IP;
791   SET_IP(ainstTarget);
792 }
793
794 RET ( #vOffset -- ) 0xa9
795 {
796   Inst * saved_ip;
797   saved_ip = access_local_ref(vOffset);
798   SET_IP(saved_ip);
799 }
800
801 TABLESWITCH ( #iLow #iRange #addrSegment #iOffset #ainstDefault iIndex -- ) 0xaa
802 {
803   s4 idx = iIndex - iLow;
804   if ( ((u4) idx) >= iRange ) {
805     SET_IP(ainstDefault);
806   }
807   else {
808     SET_IP(((Inst **)(addrSegment+iOffset))[idx]);
809   }
810 }
811
812 LOOKUPSWITCH ( #iNpairs #addrSegment #iOffset #ainstDefault iKey -- ) 0xab
813 {
814   /* Note: This code should use a binary search, as
815      the table is sorted. Note also, we reversed the order
816      of the parms */
817   int i;
818
819   i = iNpairs;
820
821   while (--i >= 0) {
822     Cell *table = (Cell *) (addrSegment+iOffset);
823     if (iKey == (s4) (table[2 * i])) {
824       SET_IP((Inst *)(table[2 * i + 1])); INST_TAIL;
825     }
826   }
827   /* falls through if no match */
828   SET_IP(ainstDefault);
829 }
830
831
832 \ Our stack works like this:
833 \ The stack holds locals, the operand stack and the return address stack.
834 \ When we invoke a method, the paramaters are the top N elements
835 \ on the stack. These become the first N local variables.
836 \ Next we have space for the rest of the local variables.
837 \ Next comes a single position on the stack which holds
838 \ the value of the frame pointer for the calling function.
839 \ Another position holds the instruction pointer of the caller.
840 \ Finally, we have space for the elements of the operand stack.
841
842 \ fp points to the bottom local; since the stack grows downwards, the
843 \ upper end of the frame is fp+1, not fp.  That's why the sp updates
844 \ in the returns look like they are off by one.
845
846 \ fp -> local0
847 \       local1
848 \       ...
849 \       oldfp
850 \ sp -> oldip ; at the start, empty stack
851 \       stack0 ;once there is something on the stack
852 \       ...
853
854 IRETURN ( #vOffsetFP ... vValue -- vResult ) 0xac
855 {
856   Inst *new_ip;
857   MAYBE_UNUSED Cell *currentsp = sp;
858   new_ip = (Inst *) access_local_cell(vOffsetFP - SIZEOF_VOID_P);
859   sp = fp + 1;
860   fp = (Cell *) access_local_cell(vOffsetFP);
861   CLEARSTACK(currentsp - 6, sp - 1);
862   vResult = vValue;
863   SET_IP(new_ip);
864 }
865
866 LRETURN ( #vOffsetFP ... lValue -- lResult ) 0xad
867 {
868   Inst *new_ip;
869   MAYBE_UNUSED Cell *currentsp = sp;
870   new_ip = (Inst *) access_local_cell(vOffsetFP - SIZEOF_VOID_P);
871   sp = fp + 1;
872   fp = (Cell *) access_local_cell(vOffsetFP);
873   CLEARSTACK(currentsp - 7, sp - 2);
874   lResult = lValue;
875   SET_IP(new_ip);
876 }
877
878 RETURN ( #vOffsetFP ... -- ) 0xb1
879 {
880   Inst *new_ip;
881   MAYBE_UNUSED Cell *currentsp = sp;
882   new_ip = (Inst *) access_local_cell(vOffsetFP - SIZEOF_VOID_P);
883   sp = fp + 1;
884   fp = (Cell *) access_local_cell(vOffsetFP);
885   CLEARSTACK(currentsp - 5, sp - 1);
886   SET_IP(new_ip);
887 }
888
889 GETSTATIC_CELL ( #addr #afi -- vResult ) opt
890 {
891   vResult = *(Cell *)addr;
892 }
893
894 GETSTATIC_INT ( #addr #afi -- iResult ) opt
895 {
896   iResult = *(s4 *)addr;
897 }
898
899 GETSTATIC_FLOAT ( #addr #afi -- fResult ) opt
900 {
901   fResult = *(float *)addr;
902 }
903
904 GETSTATIC_LONG ( #addr #afi -- lResult ) opt
905 {
906   lResult = *((s8 *) addr);
907 }
908
909 PUTSTATIC_CELL ( #addr #afi vValue -- ) opt
910 {
911   *((Cell *) addr) = vValue;
912 }
913
914 PUTSTATIC_INT ( #addr #afi iValue -- ) opt
915 {
916   *((s4 *) addr) = iValue;
917 }
918
919 PUTSTATIC_FLOAT ( #addr #afi fValue -- ) opt
920 {
921   *((float *) addr) = fValue;
922 }
923
924 PUTSTATIC_LONG ( #addr #afi lValue -- ) opt
925 {
926   *((s8 *) addr) = lValue;
927 }
928
929 GETFIELD_CELL ( #vOffset #afi aRef -- vResult ) opt
930 {
931   CHECK_NULL_PTR(aRef);
932   vResult = *((Cell *) (((u1 *)aRef) + vOffset));
933 }
934
935 GETFIELD_INT ( #vOffset #afi aRef -- iResult ) opt
936 {
937   CHECK_NULL_PTR(aRef);
938   iResult = *((s4 *) (((u1 *)aRef) + vOffset));
939 }
940
941 GETFIELD_FLOAT ( #vOffset #afi aRef -- fResult ) opt
942 {
943   CHECK_NULL_PTR(aRef);
944   fResult = *((float *) (((u1 *) aRef) + vOffset));
945 }
946
947 GETFIELD_LONG ( #vOffset #afi aRef -- lResult ) opt
948 {
949   CHECK_NULL_PTR(aRef);
950   lResult = *((s8 *) (((u1 *)aRef) + vOffset));
951 }
952
953
954 PUTFIELD_CELL ( #vOffset #afi aRef vValue -- ) opt
955 {
956   CHECK_NULL_PTR(aRef);
957   *((Cell *) (((u1 *)aRef) + vOffset)) = vValue;
958 }
959
960 PUTFIELD_INT ( #vOffset #afi aRef iValue -- ) opt
961 {
962   CHECK_NULL_PTR(aRef);
963   *((s4 *) (((u1 *)aRef) + vOffset)) = iValue;
964 }
965
966 PUTFIELD_FLOAT ( #vOffset #afi aRef fValue -- ) opt
967 {
968   CHECK_NULL_PTR(aRef);
969   *((float *) (((u1 *)aRef) + vOffset)) = fValue;
970 }
971
972 PUTFIELD_LONG ( #vOffset #afi aRef lValue -- ) opt
973 {
974   CHECK_NULL_PTR(aRef);
975   *((s8 *) (((u1 *)aRef) + vOffset)) = lValue;
976 }
977
978 \ !! called methods have the number of locals at offset -1.
979 \ methods are always called indirectly through the codeptr in the stub 
980 \   (see createcompilerstub and TRANSLATE).
981
982 INVOKEVIRTUAL ( #vOffset #iNargs #am ... -- ... acelloldfp ainstoldip ) 0xd8
983 {
984   java_objectheader *aRef = (java_objectheader *)(sp[iNargs - 1]);
985   char *v;
986   Inst **stub;
987   Inst *target;
988   CHECK_NULL_PTR(aRef);
989   v = (char *)(aRef->vftbl);
990   stub = *(Inst ***)(v+vOffset);
991   target = *stub;
992   acelloldfp = fp;
993   ainstoldip = IP;
994   fp = sp - 1 + iNargs;
995   sp = fp - FRAMESIZE(stub) + 1;
996   SET_IP(target);
997 }
998
999 INVOKESTATIC ( #aaTarget #iNargs #am ... -- ... acelloldfp ainstoldip ) 0xb8
1000 /* an indirect pointer to target is passed to avoid references to uncompiled code */
1001 {
1002   Inst *target = *aaTarget;
1003   acelloldfp = fp;
1004   ainstoldip = IP;
1005   fp = sp - 1 + iNargs; /* !! scale nargs at translation time */
1006   sp = fp - FRAMESIZE(aaTarget) + 1;
1007   SET_IP(target);
1008 }
1009
1010 INVOKESPECIAL ( #aaTarget #iNargs #am ... -- ... acelloldfp ainstoldip ) 0xb7
1011 /* an indirect pointer to target is passed to avoid references to uncompiled code */
1012 {
1013   java_objectheader *aRef = (java_objectheader *)(sp[iNargs - 1]);
1014   Inst *target = *aaTarget;
1015   CHECK_NULL_PTR(aRef);
1016   acelloldfp = fp;
1017   ainstoldip = IP;
1018   fp = sp - 1 + iNargs; /* !! scale nargs at translation time */
1019   sp = fp - FRAMESIZE(aaTarget) + 1;
1020   SET_IP(target);
1021 }
1022
1023 INVOKEINTERFACE ( #iInterfaceOffset #vOffset #iNargs #am ... -- ... acelloldfp ainstoldip ) 0xd8
1024 {
1025   java_objectheader *aRef;
1026   char   *v, *t;
1027   Inst **stub;
1028   Inst *target;
1029   ;
1030   aRef = (java_objectheader *)sp[iNargs - 1];
1031   CHECK_NULL_PTR(aRef);
1032   v = (char *)(aRef->vftbl);
1033   t = *(char **)(v + iInterfaceOffset);
1034   stub = *(Inst ***)(t+vOffset);
1035   target = *stub;
1036   acelloldfp = fp;
1037   ainstoldip = IP;
1038   fp = sp - 1 + iNargs;
1039   sp = fp - FRAMESIZE(stub) + 1;
1040   SET_IP(target);
1041 }
1042
1043 \ the BUILTIN functions like NEW get their parameters on the stack
1044 \ instead of through immediate arguments.
1045
1046 \ !! do we need to synchronize the stack here?
1047 \ !! if so, is global_sp right?
1048
1049 NEW ( ... aClass -- ... aRef ) 0xbb
1050 {
1051   global_sp = sp;
1052   aRef = builtin_new((classinfo *) aClass);
1053   if (aRef == NULL) {
1054     global_sp = sp;
1055     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1056     CLEAR_global_sp;
1057     THROW0;
1058   }
1059   CLEAR_global_sp;
1060 }
1061
1062 \ !! use a macro
1063
1064 NEWARRAY_BOOLEAN ( ... iSize -- ... aArray )
1065 {
1066   global_sp = sp;
1067   aArray = (java_arrayheader *) builtin_newarray_boolean(iSize);
1068   if (aArray == NULL) {
1069     global_sp = sp;
1070     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1071     CLEAR_global_sp;
1072     THROW0;
1073   }
1074   CLEAR_global_sp;
1075 }
1076
1077 NEWARRAY_BYTE ( ... iSize -- ... aArray )
1078 {
1079   global_sp = sp;
1080   aArray = (java_arrayheader *) builtin_newarray_byte(iSize);
1081   if (aArray == NULL) {
1082     global_sp = sp;
1083     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1084     CLEAR_global_sp;
1085     THROW0;
1086   }
1087   CLEAR_global_sp;
1088 }
1089
1090 NEWARRAY_CHAR ( ... iSize -- ... aArray )
1091 {
1092   global_sp = sp;
1093   aArray = (java_arrayheader *) builtin_newarray_char(iSize);
1094   if (aArray == NULL) {
1095     global_sp = sp;
1096     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1097     CLEAR_global_sp;
1098     THROW0;
1099   }
1100   CLEAR_global_sp;
1101 }
1102
1103 NEWARRAY_SHORT ( ... iSize -- ... aArray )
1104 {
1105   global_sp = sp;
1106   aArray = (java_arrayheader *) builtin_newarray_short(iSize);
1107   if (aArray == NULL) {
1108     global_sp = sp;
1109     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1110     CLEAR_global_sp;
1111     THROW0;
1112   }
1113   CLEAR_global_sp;
1114 }
1115
1116 NEWARRAY_INT ( ... iSize -- ... aArray )
1117 {
1118   global_sp = sp;
1119   aArray = (java_arrayheader *) builtin_newarray_int(iSize);
1120   if (aArray == NULL) {
1121     global_sp = sp;
1122     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1123     CLEAR_global_sp;
1124     THROW0;
1125   }
1126   CLEAR_global_sp;
1127 }
1128
1129 NEWARRAY_LONG ( ... iSize -- ... aArray )
1130 {
1131   global_sp = sp;
1132   aArray = (java_arrayheader *) builtin_newarray_long(iSize);
1133   if (aArray == NULL) {
1134     global_sp = sp;
1135     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1136     CLEAR_global_sp;
1137     THROW0;
1138   }
1139   CLEAR_global_sp;
1140 }
1141
1142 NEWARRAY_FLOAT ( ... iSize -- ... aArray )
1143 {
1144   global_sp = sp;
1145   aArray = (java_arrayheader *) builtin_newarray_float(iSize);
1146   if (aArray == NULL) {
1147     global_sp = sp;
1148     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1149     CLEAR_global_sp;
1150     THROW0;
1151   }
1152   CLEAR_global_sp;
1153 }
1154
1155 NEWARRAY_DOUBLE ( ... iSize -- ... aArray )
1156 {
1157   global_sp = sp;
1158   aArray = (java_arrayheader *) builtin_newarray_double(iSize);
1159   if (aArray == NULL) {
1160     global_sp = sp;
1161     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1162     CLEAR_global_sp;
1163     THROW0;
1164   }
1165   CLEAR_global_sp;
1166 }
1167
1168 NEWARRAY ( ... iSize aClass -- ... aArray )
1169 {
1170   global_sp = sp;
1171   aArray = (java_arrayheader *) builtin_newarray(iSize, aClass);
1172   if (aArray == NULL) {
1173     global_sp = sp;
1174     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1175     CLEAR_global_sp;
1176     THROW0;
1177   }
1178   CLEAR_global_sp;
1179 }
1180
1181 ARRAYLENGTH ( aArray -- iResult )
1182 {
1183   CHECK_NULL_PTR(aArray);
1184   iResult = length_array(aArray);
1185 }
1186
1187 ATHROW ( ... aRef -- ... aRef1 )
1188 {
1189   Cell *new_sp, *new_fp;
1190   Inst *new_ip;
1191   CHECK_NULL_PTR(aRef);
1192   goto athrow;
1193 throw:
1194   CLEAR_global_sp;
1195   aRef = *exceptionptr;
1196   *exceptionptr = NULL;
1197 athrow:
1198   new_ip = intrp_asm_handle_exception(IP, aRef, fp, &new_sp, &new_fp);
1199   if (new_ip == NULL) {
1200     /* !! sp = new_sp; ? */
1201     global_sp = sp - 1;
1202     SUPER_END; /* ATHROW may end a basic block */
1203     return aRef;
1204   }
1205   SET_IP(new_ip);
1206   aRef1 = aRef;
1207   sp = new_sp;
1208   fp = new_fp;
1209 }
1210
1211 CHECKCAST ( #aClass #acr aRef -- aRef ) 0xc0
1212 {
1213   if (!builtin_checkcast(aRef, (classinfo *) aClass))
1214     THROW_CLASSCASTEXCEPTION(aRef);
1215 }
1216
1217 ARRAYCHECKCAST ( #aClass #acr aRef -- aRef ) 0xc0
1218 {
1219   if (!builtin_arraycheckcast(aRef, aClass))
1220     THROW_CLASSCASTEXCEPTION(aRef);
1221 }
1222
1223 PATCHER_ARRAYCHECKCAST ( #avftbl #acr ... -- ) 0xc0
1224 stackframeinfo sfi;
1225 bool result;
1226 global_sp = sp;
1227 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1228 result = intrp_patcher_builtin_arraycheckcast((u1 *) (IP - 3));
1229 stacktrace_remove_stackframeinfo(&sfi);
1230 CLEAR_global_sp;
1231 if (!result)
1232   THROW0;
1233 STORE_ORDER_BARRIER();
1234 IP[-3] = INST_ADDR(ARRAYCHECKCAST);
1235 SET_IP(IP - 3);
1236 patchersuper_rewrite(IP);
1237
1238 INSTANCEOF ( #aClass #acr aRef  -- iResult )
1239 {
1240   iResult = builtin_instanceof(aRef, aClass);
1241 }
1242
1243 ARRAYINSTANCEOF ( aRef aClass  -- iResult )
1244 {
1245   iResult = builtin_arrayinstanceof(aRef, aClass);
1246 }
1247
1248 MONITORENTER ( aRef -- )
1249 {
1250 #if defined(ENABLE_THREADS)
1251   /* CHECK_NULL_PTR(aRef); is now done explicitly inside lock_monitor_enter */
1252   global_sp = sp;
1253   if (!lock_monitor_enter(aRef))
1254         THROW0;
1255   CLEAR_global_sp;
1256 #endif
1257 }
1258
1259 MONITOREXIT ( aRef -- )
1260 {
1261 #if defined(ENABLE_THREADS)
1262   global_sp = sp;
1263   if (!lock_monitor_exit(aRef))
1264         THROW0;
1265   CLEAR_global_sp;
1266 #endif
1267 }
1268
1269 CHECKNULL ( aRef -- aRef )
1270 {
1271   CHECK_NULL_PTR(aRef);
1272 }
1273
1274 MULTIANEWARRAY ( #aClass #iSize #acr ... -- aRef )
1275 {
1276   long *dims;
1277   int i;
1278
1279   dims = MNEW(long, iSize);
1280
1281   for (i = 0; i < iSize; i++) {
1282     dims[i] = sp[iSize - i - 1];
1283   }
1284   global_sp = sp;
1285   aRef = (java_objectheader *) builtin_multianewarray(iSize, aClass, dims);
1286
1287   MFREE(dims, long, iSize);
1288
1289   if (aRef == NULL) {
1290     global_sp = sp;
1291     *exceptionptr = stacktrace_inline_fillInStackTrace(NULL, (u1 *) fp, (u1 *) IP, (u1 *) IP);
1292     CLEAR_global_sp;
1293     THROW0;
1294   }
1295   CLEAR_global_sp;
1296   sp += iSize;
1297 }
1298
1299 IFNULL ( #ainstTarget aRef -- )  0xc6
1300 {
1301   if ( aRef == NULL ) {
1302     SET_IP(ainstTarget);
1303   }
1304 }
1305
1306 IFNONNULL ( #ainstTarget aRef -- ) 0xc7
1307 {
1308   if ( aRef != NULL ) {
1309     SET_IP(ainstTarget);
1310   }
1311 }
1312
1313 \ patchers for resolving fields
1314
1315 PATCHER_GETSTATIC_INT ( #aRef #auf ... -- )
1316 stackframeinfo sfi;
1317 bool result;
1318 global_sp = sp;
1319 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1320 result = intrp_patcher_get_putstatic((u1 *) (IP - 3));
1321 stacktrace_remove_stackframeinfo(&sfi);
1322 CLEAR_global_sp;
1323 if (!result)
1324   THROW0;
1325 STORE_ORDER_BARRIER();
1326 IP[-3] = INST_ADDR(GETSTATIC_INT);
1327 SET_IP(IP-3);
1328 patchersuper_rewrite(IP);
1329
1330 PATCHER_GETSTATIC_FLOAT ( #aRef #auf ... -- )
1331 stackframeinfo sfi;
1332 bool result;
1333 global_sp = sp;
1334 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1335 result = intrp_patcher_get_putstatic((u1 *)(IP-3));
1336 stacktrace_remove_stackframeinfo(&sfi);
1337 CLEAR_global_sp;
1338 if (!result)
1339   THROW0;
1340 STORE_ORDER_BARRIER();
1341 IP[-3] = INST_ADDR(GETSTATIC_FLOAT);
1342 SET_IP(IP-3);
1343 patchersuper_rewrite(IP);
1344
1345 PATCHER_GETSTATIC_LONG ( #aRef #auf ... -- )
1346 stackframeinfo sfi;
1347 bool result;
1348 global_sp = sp;
1349 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1350 result = intrp_patcher_get_putstatic((u1 *) (IP - 3));
1351 stacktrace_remove_stackframeinfo(&sfi);
1352 CLEAR_global_sp;
1353 if (!result)
1354   THROW0;
1355 STORE_ORDER_BARRIER();
1356 IP[-3] = INST_ADDR(GETSTATIC_LONG);
1357 SET_IP(IP-3);
1358 patchersuper_rewrite(IP);
1359
1360 PATCHER_GETSTATIC_CELL ( #aRef #auf ... -- )
1361 stackframeinfo sfi;
1362 bool result;
1363 global_sp = sp;
1364 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1365 result = intrp_patcher_get_putstatic((u1 *) (IP - 3));
1366 stacktrace_remove_stackframeinfo(&sfi);
1367 CLEAR_global_sp;
1368 if (!result)
1369   THROW0;
1370 STORE_ORDER_BARRIER();
1371 IP[-3] = INST_ADDR(GETSTATIC_CELL);
1372 SET_IP(IP-3);
1373 patchersuper_rewrite(IP);
1374
1375 \ patchers for statically initializing classes
1376
1377 PATCHER_GETSTATIC_CLINIT_INT ( #aRef #afi ... -- )
1378 stackframeinfo sfi;
1379 bool result;
1380 global_sp = sp;
1381 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1382 result = intrp_patcher_get_putstatic_clinit((u1 *) (IP - 3));
1383 stacktrace_remove_stackframeinfo(&sfi);
1384 CLEAR_global_sp;
1385 if (!result)
1386   THROW0;
1387 STORE_ORDER_BARRIER();
1388 IP[-3] = INST_ADDR(GETSTATIC_INT);
1389 SET_IP(IP-3);
1390 patchersuper_rewrite(IP);
1391
1392 PATCHER_GETSTATIC_CLINIT_FLOAT ( #aRef #afi ... -- )
1393 stackframeinfo sfi;
1394 bool result;
1395 global_sp = sp;
1396 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1397 result = intrp_patcher_get_putstatic_clinit((u1 *)(IP-3));
1398 stacktrace_remove_stackframeinfo(&sfi);
1399 CLEAR_global_sp;
1400 if (!result)
1401   THROW0;
1402 STORE_ORDER_BARRIER();
1403 IP[-3] = INST_ADDR(GETSTATIC_FLOAT);
1404 SET_IP(IP-3);
1405 patchersuper_rewrite(IP);
1406
1407 PATCHER_GETSTATIC_CLINIT_LONG ( #aRef #afi ... -- )
1408 stackframeinfo sfi;
1409 bool result;
1410 global_sp = sp;
1411 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1412 result = intrp_patcher_get_putstatic_clinit((u1 *) (IP - 3));
1413 stacktrace_remove_stackframeinfo(&sfi);
1414 CLEAR_global_sp;
1415 if (!result)
1416   THROW0;
1417 STORE_ORDER_BARRIER();
1418 IP[-3] = INST_ADDR(GETSTATIC_LONG);
1419 SET_IP(IP-3);
1420 patchersuper_rewrite(IP);
1421
1422 PATCHER_GETSTATIC_CLINIT_CELL ( #aRef #afi ... -- )
1423 stackframeinfo sfi;
1424 bool result;
1425 global_sp = sp;
1426 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1427 result = intrp_patcher_get_putstatic_clinit((u1 *) (IP - 3));
1428 stacktrace_remove_stackframeinfo(&sfi);
1429 CLEAR_global_sp;
1430 if (!result)
1431   THROW0;
1432 STORE_ORDER_BARRIER();
1433 IP[-3] = INST_ADDR(GETSTATIC_CELL);
1434 SET_IP(IP-3);
1435 patchersuper_rewrite(IP);
1436
1437 \ patchers for resolving fields
1438
1439 PATCHER_PUTSTATIC_INT ( #aRef #auf ... -- )
1440 stackframeinfo sfi;
1441 bool result;
1442 global_sp = sp;
1443 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1444 result = intrp_patcher_get_putstatic((u1 *) (IP - 3));
1445 stacktrace_remove_stackframeinfo(&sfi);
1446 CLEAR_global_sp;
1447 if (!result)
1448   THROW0;
1449 STORE_ORDER_BARRIER();
1450 IP[-3] = INST_ADDR(PUTSTATIC_INT);
1451 SET_IP(IP-3);
1452 patchersuper_rewrite(IP);
1453
1454 PATCHER_PUTSTATIC_FLOAT ( #aRef #auf ... -- )
1455 stackframeinfo sfi;
1456 bool result;
1457 global_sp = sp;
1458 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1459 result = intrp_patcher_get_putstatic((u1 *)(IP-3));
1460 stacktrace_remove_stackframeinfo(&sfi);
1461 CLEAR_global_sp;
1462 if (!result)
1463   THROW0;
1464 STORE_ORDER_BARRIER();
1465 IP[-3] = INST_ADDR(PUTSTATIC_FLOAT);
1466 SET_IP(IP-3);
1467 patchersuper_rewrite(IP);
1468
1469 PATCHER_PUTSTATIC_LONG ( #aRef #auf ... -- )
1470 stackframeinfo sfi;
1471 bool result;
1472 global_sp = sp;
1473 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1474 result = intrp_patcher_get_putstatic((u1 *) (IP - 3));
1475 stacktrace_remove_stackframeinfo(&sfi);
1476 CLEAR_global_sp;
1477 if (!result)
1478   THROW0;
1479 STORE_ORDER_BARRIER();
1480 IP[-3] = INST_ADDR(PUTSTATIC_LONG);
1481 SET_IP(IP-3);
1482 patchersuper_rewrite(IP);
1483
1484 PATCHER_PUTSTATIC_CELL ( #aRef #auf ... -- )
1485 stackframeinfo sfi;
1486 bool result;
1487 global_sp = sp;
1488 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1489 result = intrp_patcher_get_putstatic((u1 *) (IP - 3));
1490 stacktrace_remove_stackframeinfo(&sfi);
1491 CLEAR_global_sp;
1492 if (!result)
1493   THROW0;
1494 STORE_ORDER_BARRIER();
1495 IP[-3] = INST_ADDR(PUTSTATIC_CELL);
1496 SET_IP(IP-3);
1497 patchersuper_rewrite(IP);
1498
1499 \ patchers for statically initializing classes
1500
1501 PATCHER_PUTSTATIC_CLINIT_INT ( #aRef #afi ... -- )
1502 stackframeinfo sfi;
1503 bool result;
1504 global_sp = sp;
1505 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1506 result = intrp_patcher_get_putstatic_clinit((u1 *) (IP - 3));
1507 stacktrace_remove_stackframeinfo(&sfi);
1508 CLEAR_global_sp;
1509 if (!result)
1510   THROW0;
1511 STORE_ORDER_BARRIER();
1512 IP[-3] = INST_ADDR(PUTSTATIC_INT);
1513 SET_IP(IP-3);
1514 patchersuper_rewrite(IP);
1515
1516 PATCHER_PUTSTATIC_CLINIT_FLOAT ( #aRef #afi ... -- )
1517 stackframeinfo sfi;
1518 bool result;
1519 global_sp = sp;
1520 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1521 result = intrp_patcher_get_putstatic_clinit((u1 *)(IP-3));
1522 stacktrace_remove_stackframeinfo(&sfi);
1523 CLEAR_global_sp;
1524 if (!result)
1525   THROW0;
1526 STORE_ORDER_BARRIER();
1527 IP[-3] = INST_ADDR(PUTSTATIC_FLOAT);
1528 SET_IP(IP-3);
1529 patchersuper_rewrite(IP);
1530
1531 PATCHER_PUTSTATIC_CLINIT_LONG ( #aRef #afi ... -- )
1532 stackframeinfo sfi;
1533 bool result;
1534 global_sp = sp;
1535 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1536 result = intrp_patcher_get_putstatic_clinit((u1 *) (IP - 3));
1537 stacktrace_remove_stackframeinfo(&sfi);
1538 CLEAR_global_sp;
1539 if (!result)
1540   THROW0;
1541 STORE_ORDER_BARRIER();
1542 IP[-3] = INST_ADDR(PUTSTATIC_LONG);
1543 SET_IP(IP-3);
1544 patchersuper_rewrite(IP);
1545
1546 PATCHER_PUTSTATIC_CLINIT_CELL ( #aRef #afi ... -- )
1547 stackframeinfo sfi;
1548 bool result;
1549 global_sp = sp;
1550 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1551 result = intrp_patcher_get_putstatic_clinit((u1 *) (IP - 3));
1552 stacktrace_remove_stackframeinfo(&sfi);
1553 CLEAR_global_sp;
1554 if (!result)
1555   THROW0;
1556 STORE_ORDER_BARRIER();
1557 IP[-3] = INST_ADDR(PUTSTATIC_CELL);
1558 SET_IP(IP-3);
1559 patchersuper_rewrite(IP);
1560
1561 \ patchers for resolving fields
1562
1563 PATCHER_GETFIELD_INT ( #vOffset #auf ... -- )
1564 stackframeinfo sfi;
1565 bool result;
1566 global_sp = sp;
1567 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1568 result = intrp_patcher_get_putfield((u1 *) (IP - 3));
1569 stacktrace_remove_stackframeinfo(&sfi);
1570 CLEAR_global_sp;
1571 if (!result)
1572   THROW0;
1573 STORE_ORDER_BARRIER();
1574 IP[-3] = INST_ADDR(GETFIELD_INT);
1575 SET_IP(IP-3);
1576 patchersuper_rewrite(IP);
1577
1578 PATCHER_GETFIELD_FLOAT ( #vOffset #auf ... -- )
1579 stackframeinfo sfi;
1580 bool result;
1581 global_sp = sp;
1582 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1583 result = intrp_patcher_get_putfield((u1 *)(IP-3));
1584 stacktrace_remove_stackframeinfo(&sfi);
1585 CLEAR_global_sp;
1586 if (!result)
1587   THROW0;
1588 STORE_ORDER_BARRIER();
1589 IP[-3] = INST_ADDR(GETFIELD_FLOAT);
1590 SET_IP(IP-3);
1591 patchersuper_rewrite(IP);
1592
1593 PATCHER_GETFIELD_LONG ( #vOffset #auf ... -- )
1594 stackframeinfo sfi;
1595 bool result;
1596 global_sp = sp;
1597 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1598 result = intrp_patcher_get_putfield((u1 *) (IP - 3));
1599 stacktrace_remove_stackframeinfo(&sfi);
1600 CLEAR_global_sp;
1601 if (!result)
1602   THROW0;
1603 STORE_ORDER_BARRIER();
1604 IP[-3] = INST_ADDR(GETFIELD_LONG);
1605 SET_IP(IP-3);
1606 patchersuper_rewrite(IP);
1607
1608 PATCHER_GETFIELD_CELL ( #vOffset #auf ... -- )
1609 stackframeinfo sfi;
1610 bool result;
1611 global_sp = sp;
1612 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1613 result = intrp_patcher_get_putfield((u1 *) (IP - 3));
1614 stacktrace_remove_stackframeinfo(&sfi);
1615 CLEAR_global_sp;
1616 if (!result)
1617   THROW0;
1618 STORE_ORDER_BARRIER();
1619 IP[-3] = INST_ADDR(GETFIELD_CELL);
1620 SET_IP(IP-3);
1621 patchersuper_rewrite(IP);
1622
1623 PATCHER_PUTFIELD_INT ( #vOffset #auf ... -- )
1624 stackframeinfo sfi;
1625 bool result;
1626 global_sp = sp;
1627 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1628 result = intrp_patcher_get_putfield((u1 *) (IP - 3));
1629 stacktrace_remove_stackframeinfo(&sfi);
1630 CLEAR_global_sp;
1631 if (!result)
1632   THROW0;
1633 STORE_ORDER_BARRIER();
1634 IP[-3] = INST_ADDR(PUTFIELD_INT);
1635 SET_IP(IP-3);
1636 patchersuper_rewrite(IP);
1637
1638 PATCHER_PUTFIELD_FLOAT ( #vOffset #auf ... -- )
1639 stackframeinfo sfi;
1640 bool result;
1641 global_sp = sp;
1642 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1643 result = intrp_patcher_get_putfield((u1 *)(IP-3));
1644 stacktrace_remove_stackframeinfo(&sfi);
1645 CLEAR_global_sp;
1646 if (!result)
1647   THROW0;
1648 STORE_ORDER_BARRIER();
1649 IP[-3] = INST_ADDR(PUTFIELD_FLOAT);
1650 SET_IP(IP-3);
1651 patchersuper_rewrite(IP);
1652
1653 PATCHER_PUTFIELD_LONG ( #vOffset #auf ... -- )
1654 stackframeinfo sfi;
1655 bool result;
1656 global_sp = sp;
1657 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1658 result = intrp_patcher_get_putfield((u1 *) (IP - 3));
1659 stacktrace_remove_stackframeinfo(&sfi);
1660 CLEAR_global_sp;
1661 if (!result)
1662   THROW0;
1663 STORE_ORDER_BARRIER();
1664 IP[-3] = INST_ADDR(PUTFIELD_LONG);
1665 SET_IP(IP-3);
1666 patchersuper_rewrite(IP);
1667
1668 PATCHER_PUTFIELD_CELL ( #vOffset #auf ... -- )
1669 stackframeinfo sfi;
1670 bool result;
1671 global_sp = sp;
1672 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1673 result = intrp_patcher_get_putfield((u1 *) (IP - 3));
1674 stacktrace_remove_stackframeinfo(&sfi);
1675 CLEAR_global_sp;
1676 if (!result)
1677   THROW0;
1678 STORE_ORDER_BARRIER();
1679 IP[-3] = INST_ADDR(PUTFIELD_CELL);
1680 SET_IP(IP-3);
1681 patchersuper_rewrite(IP);
1682
1683 \ other patchers for lazy resolving
1684
1685 PATCHER_MULTIANEWARRAY ( #aClass #iSize #acr ... -- )
1686 stackframeinfo sfi;
1687 bool result;
1688 global_sp = sp;
1689 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1690 result = intrp_patcher_builtin_multianewarray((u1 *) (IP - 4));
1691 stacktrace_remove_stackframeinfo(&sfi);
1692 CLEAR_global_sp;
1693 if (!result)
1694   THROW0;
1695 STORE_ORDER_BARRIER();
1696 IP[-4] = INST_ADDR(MULTIANEWARRAY);
1697 SET_IP(IP - 4);
1698 patchersuper_rewrite(IP);
1699
1700 PATCHER_INVOKESTATIC ( #aaTarget #iNargs #aum ... -- ) 0xd8
1701 stackframeinfo sfi;
1702 bool result;
1703 global_sp = sp;
1704 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1705 result = intrp_patcher_invokestatic_special((u1 *) (IP - 4));
1706 stacktrace_remove_stackframeinfo(&sfi);
1707 CLEAR_global_sp;
1708 if (!result)
1709   THROW0;
1710 STORE_ORDER_BARRIER();
1711 IP[-4] = INST_ADDR(INVOKESTATIC);
1712 SET_IP(IP-4);
1713 patchersuper_rewrite(IP);
1714
1715 PATCHER_INVOKESPECIAL ( #aaTarget #iNargs #aum ... -- ) 0xd8
1716 stackframeinfo sfi;
1717 bool result;
1718 global_sp = sp;
1719 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1720 result = intrp_patcher_invokestatic_special((u1 *) (IP - 4));
1721 stacktrace_remove_stackframeinfo(&sfi);
1722 CLEAR_global_sp;
1723 if (!result)
1724   THROW0;
1725 STORE_ORDER_BARRIER();
1726 IP[-4] = INST_ADDR(INVOKESPECIAL);
1727 SET_IP(IP-4);
1728 patchersuper_rewrite(IP);
1729
1730 PATCHER_INVOKEVIRTUAL ( #vOffset #iNargs #aum ... -- ) 0xd8
1731 stackframeinfo sfi;
1732 bool result;
1733 global_sp = sp;
1734 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1735 result = intrp_patcher_invokevirtual((u1 *) (IP - 4));
1736 stacktrace_remove_stackframeinfo(&sfi);
1737 CLEAR_global_sp;
1738 if (!result)
1739   THROW0;
1740 STORE_ORDER_BARRIER();
1741 IP[-4] = INST_ADDR(INVOKEVIRTUAL);
1742 SET_IP(IP-4);
1743 patchersuper_rewrite(IP);
1744
1745 PATCHER_INVOKEINTERFACE ( #iInterfaceoffset #vOffset #iNargs #aum ... -- ) 0xd8
1746 stackframeinfo sfi;
1747 bool result;
1748 global_sp = sp;
1749 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1750 result = intrp_patcher_invokeinterface((u1 *) (IP - 5));
1751 stacktrace_remove_stackframeinfo(&sfi);
1752 CLEAR_global_sp;
1753 if (!result)
1754   THROW0;
1755 STORE_ORDER_BARRIER();
1756 IP[-5] = INST_ADDR(INVOKEINTERFACE);
1757 SET_IP(IP-5);
1758 patchersuper_rewrite(IP);
1759
1760 PATCHER_CHECKCAST ( #aClass #acr ... -- ) 0xc
1761 stackframeinfo sfi;
1762 bool result;
1763 global_sp = sp;
1764 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1765 result = intrp_patcher_checkcast_instanceof((u1 *) (IP - 3));
1766 stacktrace_remove_stackframeinfo(&sfi);
1767 CLEAR_global_sp;
1768 if (!result)
1769   THROW0;
1770 STORE_ORDER_BARRIER();
1771 IP[-3] = INST_ADDR(CHECKCAST);
1772 SET_IP(IP-3);
1773 patchersuper_rewrite(IP);
1774
1775 PATCHER_INSTANCEOF ( #aClass #acr ... -- ) 0xc1
1776 stackframeinfo sfi;
1777 bool result;
1778 global_sp = sp;
1779 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1780 result = intrp_patcher_checkcast_instanceof((u1 *) (IP - 3));
1781 stacktrace_remove_stackframeinfo(&sfi);
1782 CLEAR_global_sp;
1783 if (!result)
1784   THROW0;
1785 STORE_ORDER_BARRIER();
1786 IP[-3] = INST_ADDR(INSTANCEOF);
1787 SET_IP(IP-3);
1788 patchersuper_rewrite(IP);
1789
1790 \ This is stub code for methods that we have not yet translated.
1791 \ Initially, the code for each method is set to this stub. The
1792 \ first time the method is called, the code in the stub runs, which
1793 \ translates the bytecode, and replaces the stub with the threaded code.
1794
1795 TRANSLATE ( #am ... --  )
1796 {
1797   Inst *codeptr;
1798   stackframeinfo sfi;
1799   Cell *acelloldfp;
1800   Inst *ainstoldip;
1801   ;
1802   vm_Cell2acell(sp[1],acelloldfp);
1803   vm_Cell2ainst(sp[0],ainstoldip);
1804   global_sp = sp;
1805   stacktrace_create_extern_stackframeinfo(&sfi, NULL, (u1 *) acelloldfp, (u1 *) ainstoldip, (u1 *) ainstoldip);
1806   codeptr = (Inst *) jit_compile(am);
1807   stacktrace_remove_stackframeinfo(&sfi);
1808   if (codeptr == NULL) {
1809     fp = acelloldfp;
1810     SET_IP(ainstoldip); /* set up ip and fp for throw */
1811     THROW0;
1812   }
1813   CLEAR_global_sp;
1814   IP[-4] = codeptr;
1815   SET_IP(codeptr);
1816 }
1817
1818 NATIVECALL ( #am #af #addrcif ... acelloldfp ainstoldip -- )
1819 sp = nativecall(af, am, sp, ainstoldip, acelloldfp, addrcif);
1820 fp = acelloldfp;
1821 SET_IP(ainstoldip);
1822 if (*exceptionptr)
1823   THROW0;
1824
1825
1826 TRACENATIVECALL ( #am #af #addrcif ... acelloldfp ainstoldip -- )
1827 sp = nativecall(af, am, sp, ainstoldip, acelloldfp, addrcif);
1828 fp = acelloldfp;
1829 SET_IP(ainstoldip);
1830 {
1831 Cell v = sp[0];
1832 float f;
1833 vm_Cell2f(v,f);
1834 #if !defined(NDEBUG)
1835 builtin_verbosecall_exit((s8) v, f, f, am);
1836 #endif
1837 }
1838 if (*exceptionptr)
1839   THROW0;
1840
1841 PATCHER_NATIVECALL ( #am #af #addrcif ... -- )
1842 #if !defined(WITH_STATIC_CLASSPATH)
1843 stackframeinfo sfi;
1844 bool result;
1845 global_sp = sp;
1846 stacktrace_create_stackframeinfo(&sfi, NULL, (u1 *) fp, (u1 *) IP);
1847 result = intrp_patcher_resolve_native((u1 *) (IP - 4));
1848 stacktrace_remove_stackframeinfo(&sfi);
1849 CLEAR_global_sp;
1850 if (!result)
1851   THROW0;
1852 STORE_ORDER_BARRIER();
1853 IP[-4] = opt_verbosecall ? INST_ADDR(TRACENATIVECALL) : INST_ADDR(NATIVECALL);
1854 SET_IP(IP - 4);
1855 patchersuper_rewrite(IP);
1856 #else
1857 assert(false);
1858 #endif
1859
1860 TRACECALL ( #am -- )
1861 #if !defined(NDEBUG)
1862 #if SIZEOF_VOID_P == 4
1863 {
1864     s8 args[TRACE_ARGS_NUM];
1865     int i;
1866     int ofs = 0;
1867     typedesc *params = am->parseddesc->paramtypes;
1868     for (i=0; i < TRACE_ARGS_NUM; ++i, ++params) {
1869         if (IS_2_WORD_TYPE(params->type)) {
1870             vm_twoCell2l(access_local_cell(ofs), access_local_cell(ofs - SIZEOF_VOID_P), args[i]);
1871             ofs -= 2*SIZEOF_VOID_P;
1872         }
1873         else {
1874             args[i] = access_local_cell(ofs);
1875             ofs -= SIZEOF_VOID_P;
1876         }
1877     }
1878     builtin_verbosecall_enter(args[0], args[1], args[2], args[3],  
1879 #if TRACE_ARGS_NUM > 4
1880                               args[4], args[5],
1881 #endif
1882 #if TRACE_ARGS_NUM == 8
1883                               args[6], args[7],
1884 #endif
1885                               am);
1886 }
1887 #else /* SIZEOF_VOID_P */
1888     builtin_verbosecall_enter(
1889         access_local_cell(0 * -SIZEOF_VOID_P),
1890         access_local_cell(1 * -SIZEOF_VOID_P),
1891         access_local_cell(2 * -SIZEOF_VOID_P),
1892         access_local_cell(3 * -SIZEOF_VOID_P),
1893 #if TRACE_ARGS_NUM > 4
1894         access_local_cell(4 * -SIZEOF_VOID_P),
1895         access_local_cell(5 * -SIZEOF_VOID_P),
1896 #endif
1897 #if TRACE_ARGS_NUM == 8
1898         access_local_cell(6 * -SIZEOF_VOID_P),
1899         access_local_cell(7 * -SIZEOF_VOID_P),
1900 #endif
1901         am);
1902 #endif /* SIZEOF_VOID_P */
1903 #endif /* !defined(NDEBUG) */
1904
1905 TRACERETURN ( #am v -- v )
1906 float f;
1907 vm_Cell2f(v,f);
1908 #if !defined(NDEBUG)
1909 builtin_verbosecall_exit((s8) v, f, f, am);
1910 #endif
1911
1912 TRACELRETURN ( #am l -- l )
1913 Double_Store ds;
1914 ds.l = l;
1915 #if !defined(NDEBUG)
1916 builtin_verbosecall_exit(l, ds.d, ds.d, am);
1917 #endif
1918
1919 END ( ... -- )
1920 global_sp = sp;
1921 SUPER_END;
1922 vm_uncount_block(IP); /* undo the count part of SUPER_END,
1923                          because there is no fallthrough */
1924 return NULL;
1925
1926 _ALOAD_GETFIELD_CELL_ =  ALOAD GETFIELD_CELL 
1927 _DUP_ICONST_ =  DUP ICONST 
1928 _ALOAD_ALOAD_ =  ALOAD ALOAD 
1929 _ICONST_ICONST_ =  ICONST ICONST 
1930 _DUP_ICONST_ICONST_ =  DUP ICONST ICONST 
1931 _ICONST_CASTORE_ =  ICONST CASTORE 
1932 _ICONST_ICONST_CASTORE_ =  ICONST ICONST CASTORE 
1933 _DUP_ICONST_ICONST_CASTORE_ =  DUP ICONST ICONST CASTORE 
1934 _CASTORE_DUP_ =  CASTORE DUP 
1935 _CASTORE_DUP_ICONST_ =  CASTORE DUP ICONST 
1936 _DUP_ICONST_ICONST_CASTORE_DUP_ =  DUP ICONST ICONST CASTORE DUP 
1937 _ICONST_CASTORE_DUP_ =  ICONST CASTORE DUP 
1938 _ICONST_CASTORE_DUP_ICONST_ =  ICONST CASTORE DUP ICONST 
1939 _ICONST_ICONST_CASTORE_DUP_ =  ICONST ICONST CASTORE DUP 
1940 _ICONST_ICONST_CASTORE_DUP_ICONST_ =  ICONST ICONST CASTORE DUP ICONST 
1941 _CASTORE_DUP_ICONST_ICONST_ =  CASTORE DUP ICONST ICONST 
1942 _CASTORE_DUP_ICONST_ICONST_CASTORE_ =  CASTORE DUP ICONST ICONST CASTORE 
1943 _ICONST_CASTORE_DUP_ICONST_ICONST_ =  ICONST CASTORE DUP ICONST ICONST 
1944 _ASTORE_ALOAD_ =  ASTORE ALOAD 
1945 _ALOAD_GETFIELD_INT_ =  ALOAD GETFIELD_INT 
1946 _ALOAD_ILOAD_ =  ALOAD ILOAD 
1947 _ALOAD_ACONST_ =  ALOAD ACONST 
1948 _ICONST_ACONST_ =  ICONST ACONST 
1949 _AASTORE_DUP_ =  AASTORE DUP 
1950 _AASTORE_DUP_ICONST_ =  AASTORE DUP ICONST 
1951 _ALOAD_ICONST_ =  ALOAD ICONST 
1952 _ILOAD_ICONST_ =  ILOAD ICONST 
1953 _ILOAD_ILOAD_ =  ILOAD ILOAD 
1954 _DUP_ICONST_ACONST_ =  DUP ICONST ACONST 
1955 _GETFIELD_CELL_ALOAD_ =  GETFIELD_CELL ALOAD 
1956 _AASTORE_DUP_ICONST_ACONST_ =  AASTORE DUP ICONST ACONST 
1957 _ACONST_AASTORE_ =  ACONST AASTORE 
1958 _ICONST_ACONST_AASTORE_ =  ICONST ACONST AASTORE 
1959 _DUP_ICONST_ACONST_AASTORE_ =  DUP ICONST ACONST AASTORE 
1960 _ALOAD_GETFIELD_CELL_ALOAD_ =  ALOAD GETFIELD_CELL ALOAD 
1961 _ACONST_AASTORE_DUP_ =  ACONST AASTORE DUP 
1962 _ACONST_AASTORE_DUP_ICONST_ =  ACONST AASTORE DUP ICONST 
1963 _DUP_ICONST_ACONST_AASTORE_DUP_ =  DUP ICONST ACONST AASTORE DUP 
1964 _ICONST_ACONST_AASTORE_DUP_ =  ICONST ACONST AASTORE DUP 
1965 _ICONST_ACONST_AASTORE_DUP_ICONST_ =  ICONST ACONST AASTORE DUP ICONST 
1966 _AASTORE_DUP_ICONST_ACONST_AASTORE_ =  AASTORE DUP ICONST ACONST AASTORE 
1967 _DUP_ACONST_ =  DUP ACONST 
1968 _ACONST_AASTORE_DUP_ICONST_ACONST_ =  ACONST AASTORE DUP ICONST ACONST 
1969 _PUTFIELD_CELL_ALOAD_ =  PUTFIELD_CELL ALOAD 
1970 _ILOAD_ALOAD_ =  ILOAD ALOAD 
1971 _ICONST_ALOAD_ =  ICONST ALOAD 
1972 _DUP_ALOAD_ =  DUP ALOAD 
1973 _ICONST_ISTORE_ =  ICONST ISTORE 
1974 _ASTORE_ALOAD_ALOAD_ =  ASTORE ALOAD ALOAD 
1975 _ALOAD_PUTFIELD_CELL_ =  ALOAD PUTFIELD_CELL 
1976 _PUTFIELD_INT_ALOAD_ =  PUTFIELD_INT ALOAD 
1977 _ALOAD_ALOAD_PUTFIELD_CELL_ =  ALOAD ALOAD PUTFIELD_CELL 
1978 _ICONST_IADD_ =  ICONST IADD 
1979 _ISTORE_GOTO_ =  ISTORE GOTO 
1980 _ACONST_ACONST_ =  ACONST ACONST 
1981 _POP_ALOAD_ =  POP ALOAD 
1982 _ACONST_ICONST_ =  ACONST ICONST 
1983 _ALOAD_ALOAD_ALOAD_ =  ALOAD ALOAD ALOAD 
1984 _ALOAD_ALOAD_GETFIELD_CELL_ =  ALOAD ALOAD GETFIELD_CELL 
1985 _ISTORE_ALOAD_ =  ISTORE ALOAD 
1986 _GETFIELD_CELL_ILOAD_ =  GETFIELD_CELL ILOAD 
1987 _IINC_ILOAD_ =  IINC ILOAD 
1988 _ISTORE_ILOAD_ =  ISTORE ILOAD 
1989 _ALOAD_GETFIELD_CELL_ILOAD_ =  ALOAD GETFIELD_CELL ILOAD 
1990 _ILOAD_ICONST_IADD_ =  ILOAD ICONST IADD 
1991 _CHECKCAST_ASTORE_ =  CHECKCAST ASTORE 
1992 _ASTORE_ACONST_ =  ASTORE ACONST 
1993 _GETFIELD_INT_ALOAD_ =  GETFIELD_INT ALOAD 
1994 _ACONST_ALOAD_ =  ACONST ALOAD 
1995 _ICONST_ISTORE_GOTO_ =  ICONST ISTORE GOTO 
1996 _CHECKCAST_ASTORE_ALOAD_ =  CHECKCAST ASTORE ALOAD 
1997 _ASTORE_GOTO_ =  ASTORE GOTO 
1998 _ALOAD_PUTFIELD_CELL_ALOAD_ =  ALOAD PUTFIELD_CELL ALOAD 
1999 _ALOAD_ALOAD_PUTFIELD_CELL_ALOAD_ =  ALOAD ALOAD PUTFIELD_CELL ALOAD 
2000 _ICONST_PUTFIELD_INT_ =  ICONST PUTFIELD_INT 
2001 _ALOAD_IFNULL_ =  ALOAD IFNULL 
2002 _ALOAD_IFNONNULL_ =  ALOAD IFNONNULL 
2003 _ALOAD_ICONST_PUTFIELD_INT_ =  ALOAD ICONST PUTFIELD_INT 
2004 _ALOAD_GETFIELD_INT_ALOAD_ =  ALOAD GETFIELD_INT ALOAD 
2005 _ALOAD_ILOAD_ILOAD_ =  ALOAD ILOAD ILOAD 
2006 _DUP_ICONST_ALOAD_ =  DUP ICONST ALOAD 
2007 _IADD_ILOAD_ =  IADD ILOAD 
2008 _GETFIELD_CELL_ICONST_ =  GETFIELD_CELL ICONST 
2009 _ILOAD_PUTFIELD_INT_ =  ILOAD PUTFIELD_INT 
2010 _GETFIELD_INT_ALOAD_GETFIELD_INT_ =  GETFIELD_INT ALOAD GETFIELD_INT 
2011 _GETFIELD_CELL_GETFIELD_CELL_ =  GETFIELD_CELL GETFIELD_CELL 
2012 _ALOAD_ACONST_ACONST_ =  ALOAD ACONST ACONST 
2013 _ALOAD_ARRAYLENGTH_ =  ALOAD ARRAYLENGTH 
2014 _GETFIELD_CELL_IFNULL_ =  GETFIELD_CELL IFNULL 
2015 _ICONST_ISUB_ =  ICONST ISUB 
2016 _ALOAD_ILOAD_PUTFIELD_INT_ =  ALOAD ILOAD PUTFIELD_INT 
2017 _ALOAD_GETFIELD_CELL_GETFIELD_CELL_ =  ALOAD GETFIELD_CELL GETFIELD_CELL 
2018 _PUTFIELD_CELL_ALOAD_ALOAD_ =  PUTFIELD_CELL ALOAD ALOAD 
2019 _ILOAD_AALOAD_ =  ILOAD AALOAD 
2020 _ALOAD_MONITOREXIT_ =  ALOAD MONITOREXIT 
2021 _ALOAD_CHECKCAST_ =  ALOAD CHECKCAST 
2022 _ALOAD_GETFIELD_CELL_ICONST_ =  ALOAD GETFIELD_CELL ICONST 
2023 _ICONST_ILOAD_ =  ICONST ILOAD 
2024 _ACONST_ICONST_ICONST_ =  ACONST ICONST ICONST 
2025 _ALOAD_GETFIELD_CELL_IFNULL_ =  ALOAD GETFIELD_CELL IFNULL