1 /* jit/stack.c *****************************************************************
3 Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
5 See file COPYRIGHT for information on usage and disclaimer of warranties
7 Parser for JavaVM to intermediate code translation
9 Authors: Andreas Krall EMAIL: cacao@complang.tuwien.ac.at
11 Last Change: 1997/11/18
13 *******************************************************************************/
16 #define COUNT(cnt) cnt++
21 #define STACKRESET {curstack=0;stackdepth=0;}
23 #define TYPEPANIC {show_icmd_method();panic("Stack type mismatch");}
24 #define CURKIND curstack->varkind
25 #define CURTYPE curstack->type
27 #define NEWSTACK(s,v,n) {new->prev=curstack;new->type=s;new->flags=0;\
28 new->varkind=v;new->varnum=n;curstack=new;new++;}
29 #define NEWSTACKn(s,n) NEWSTACK(s,UNDEFVAR,n)
30 #define NEWSTACK0(s) NEWSTACK(s,UNDEFVAR,0)
31 #define NEWXSTACK {NEWSTACK(TYPE_ADR,STACKVAR,0);curstack=0;}
33 #define SETDST {iptr->dst=curstack;}
34 #define POP(s) {if(s!=curstack->type){TYPEPANIC;}\
35 if(curstack->varkind==UNDEFVAR)curstack->varkind=TEMPVAR;\
36 curstack=curstack->prev;}
37 #define POPANY {if(curstack->varkind==UNDEFVAR)curstack->varkind=TEMPVAR;\
38 curstack=curstack->prev;}
39 #define COPY(s,d) {(d)->flags=0;(d)->type=(s)->type;\
40 (d)->varkind=(s)->varkind;(d)->varnum=(s)->varnum;}
42 #define PUSHCONST(s){NEWSTACKn(s,stackdepth);SETDST;stackdepth++;}
43 #define LOAD(s,v,n) {NEWSTACK(s,v,n);SETDST;stackdepth++;}
44 #define STORE(s) {POP(s);SETDST;stackdepth--;}
45 #define OP1_0(s) {POP(s);SETDST;stackdepth--;}
46 #define OP1_0ANY {POPANY;SETDST;stackdepth--;}
47 #define OP0_1(s) {NEWSTACKn(s,stackdepth);SETDST;stackdepth++;}
48 #define OP1_1(s,d) {POP(s);NEWSTACKn(d,stackdepth-1);SETDST;}
49 #define OP2_0(s) {POP(s);POP(s);SETDST;stackdepth-=2;}
50 #define OPTT2_0(t,b){POP(t);POP(b);SETDST;stackdepth-=2;}
51 #define OP2_1(s) {POP(s);POP(s);NEWSTACKn(s,stackdepth-2);SETDST;stackdepth--;}
52 #define OP2IAT_1(s) {POP(TYPE_INT);POP(TYPE_ADR);NEWSTACKn(s,stackdepth-2);\
54 #define OP2IT_1(s) {POP(TYPE_INT);POP(s);NEWSTACKn(s,stackdepth-2);\
56 #define OPTT2_1(s,d){POP(s);POP(s);NEWSTACKn(d,stackdepth-2);SETDST;stackdepth--;}
57 #define OP2_2(s) {POP(s);POP(s);NEWSTACKn(s,stackdepth-2);\
58 NEWSTACKn(s,stackdepth-1);SETDST;}
59 #define OP3TIA_0(s) {POP(s);POP(TYPE_INT);POP(TYPE_ADR);SETDST;stackdepth-=3;}
60 #define OP3_0(s) {POP(s);POP(s);POP(s);SETDST;stackdepth-=3;}
61 #define POPMANY(i) {stackdepth-=i;while(--i>=0){POPANY;}SETDST;}
62 #define DUP {NEWSTACK(CURTYPE,CURKIND,curstack->varnum);SETDST;\
64 #define SWAP {COPY(curstack,new);POPANY;COPY(curstack,new+1);POPANY;\
65 new[0].prev=curstack;new[1].prev=new;\
66 curstack=new+1;new+=2;SETDST;}
67 #define DUP_X1 {COPY(curstack,new);COPY(curstack,new+2);POPANY;\
68 COPY(curstack,new+1);POPANY;new[0].prev=curstack;\
69 new[1].prev=new;new[2].prev=new+1;\
70 curstack=new+2;new+=3;SETDST;stackdepth++;}
71 #define DUP2_X1 {COPY(curstack,new+1);COPY(curstack,new+4);POPANY;\
72 COPY(curstack,new);COPY(curstack,new+3);POPANY;\
73 COPY(curstack,new+2);POPANY;new[0].prev=curstack;\
74 new[1].prev=new;new[2].prev=new+1;\
75 new[3].prev=new+2;new[4].prev=new+3;\
76 curstack=new+4;new+=5;SETDST;stackdepth+=2;}
77 #define DUP_X2 {COPY(curstack,new);COPY(curstack,new+3);POPANY;\
78 COPY(curstack,new+2);POPANY;COPY(curstack,new+1);POPANY;\
79 new[0].prev=curstack;new[1].prev=new;\
80 new[2].prev=new+1;new[3].prev=new+2;\
81 curstack=new+3;new+=4;SETDST;stackdepth++;}
82 #define DUP2_X2 {COPY(curstack,new+1);COPY(curstack,new+5);POPANY;\
83 COPY(curstack,new);COPY(curstack,new+4);POPANY;\
84 COPY(curstack,new+3);POPANY;COPY(curstack,new+2);POPANY;\
85 new[0].prev=curstack;new[1].prev=new;\
86 new[2].prev=new+1;new[3].prev=new+2;\
87 new[4].prev=new+3;new[5].prev=new+4;\
88 curstack=new+5;new+=6;SETDST;stackdepth+=2;}
90 #define COPYCURSTACK(copy) {\
103 copy->varkind=STACKVAR;\
119 if((copy->varkind==STACKVAR)&&(copy->varnum>i))\
120 copy->varkind=TEMPVAR;\
122 copy->varkind=STACKVAR;\
125 interfaces[i][copy->type].type = copy->type;\
126 interfaces[i][copy->type].flags |= copy->flags;\
127 i--;copy=copy->prev;\
132 interfaces[i][copy->type].type = copy->type;\
133 if(copy->varkind==STACKVAR){\
134 if (copy->flags & SAVEDVAR)\
135 interfaces[i][copy->type].flags |= SAVEDVAR;\
137 i--;copy=copy->prev;\
142 #define MARKREACHED(b,c) {\
144 {COPYCURSTACK(c);b->flags=0;b->instack=c;b->indepth=stackdepth;}\
145 else {stackptr s=curstack;stackptr t=b->instack;\
146 if(b->indepth!=stackdepth)\
147 {show_icmd_method();panic("Stack depth mismatch");}\
148 while(s){if (s->type!=t->type)\
150 s=s->prev;t=t->prev;\
156 static void show_icmd_method();
158 static void analyse_stack()
160 int b_count, b_index;
162 stackptr curstack, new, copy;
163 int opcode, i, len, loops;
164 int superblockend, repeat, deadcode;
165 instruction *iptr = instr;
166 basicblock *bptr, *tbptr;
174 block[0].flags = BBREACHED;
175 block[0].instack = 0;
176 block[0].indepth = 0;
178 for (i = 0; i < exceptiontablelength; i++) {
179 bptr = &block[block_index[extable[i].handlerpc]];
180 bptr->flags = BBREACHED;
181 bptr->type = BBTYPE_EXH;
184 bptr->pre_count = 10000;
189 #ifdef CONDITIONAL_LOADCONST
190 b_count = block_count;
192 while (--b_count >= 0) {
193 if (bptr->icount != 0) {
194 iptr = bptr->iinstr + bptr->icount - 1;
227 block[block_index[iptr->op1]].pre_count++;
230 case ICMD_TABLESWITCH:
232 block[block_index[*s4ptr++]].pre_count++; /* default */
233 i = *s4ptr++; /* low */
234 i = *s4ptr++ - i + 1; /* high */
236 block[block_index[*s4ptr++]].pre_count++;
240 case ICMD_LOOKUPSWITCH:
242 block[block_index[*s4ptr++]].pre_count++; /* default */
243 i = *s4ptr++; /* count */
245 block[block_index[s4ptr[1]]].pre_count++;
261 b_count = block_count;
263 superblockend = true;
267 while (--b_count >= 0) {
268 if (bptr->flags == BBDELETED) {
271 else if (superblockend && (bptr->flags < BBREACHED))
273 else if (bptr->flags <= BBREACHED) {
275 stackdepth = bptr->indepth;
276 else if (bptr->flags < BBREACHED) {
278 bptr->instack = copy;
279 bptr->indepth = stackdepth;
281 else if (bptr->indepth != stackdepth) {
283 panic("Stack depth mismatch");
286 curstack = bptr->instack;
288 superblockend = false;
289 bptr->flags = BBFINISHED;
292 b_index = bptr - block;
301 case ICMD_CHECKASIZE:
303 case ICMD_IFEQ_ICONST:
304 case ICMD_IFNE_ICONST:
305 case ICMD_IFLT_ICONST:
306 case ICMD_IFGE_ICONST:
307 case ICMD_IFGT_ICONST:
308 case ICMD_IFLE_ICONST:
309 case ICMD_ELSE_ICONST:
314 locals[iptr->op1][TYPE_ADR].type = TYPE_ADR;
316 COUNT(count_pcmd_return);
318 superblockend = true;
321 /* pop 0 push 1 const */
324 COUNT(count_pcmd_load);
326 switch (iptr[1].opc) {
328 iptr[0].opc = ICMD_IADDCONST;
330 iptr[1].opc = ICMD_NOP;
331 OP1_1(TYPE_INT,TYPE_INT);
332 COUNT(count_pcmd_op);
335 iptr[0].opc = ICMD_ISUBCONST;
336 goto icmd_iconst_tail;
338 iptr[0].opc = ICMD_IMULCONST;
339 goto icmd_iconst_tail;
341 if (iptr[0].val.i == 0x00000002)
343 else if (iptr[0].val.i == 0x00000004)
345 else if (iptr[0].val.i == 0x00000008)
347 else if (iptr[0].val.i == 0x00000010)
349 else if (iptr[0].val.i == 0x00000020)
351 else if (iptr[0].val.i == 0x00000040)
353 else if (iptr[0].val.i == 0x00000080)
355 else if (iptr[0].val.i == 0x00000100)
357 else if (iptr[0].val.i == 0x00000200)
359 else if (iptr[0].val.i == 0x00000400)
361 else if (iptr[0].val.i == 0x00000800)
363 else if (iptr[0].val.i == 0x00001000)
365 else if (iptr[0].val.i == 0x00002000)
367 else if (iptr[0].val.i == 0x00004000)
369 else if (iptr[0].val.i == 0x00008000)
371 else if (iptr[0].val.i == 0x00010000)
373 else if (iptr[0].val.i == 0x00020000)
375 else if (iptr[0].val.i == 0x00040000)
377 else if (iptr[0].val.i == 0x00080000)
379 else if (iptr[0].val.i == 0x00100000)
381 else if (iptr[0].val.i == 0x00200000)
383 else if (iptr[0].val.i == 0x00400000)
385 else if (iptr[0].val.i == 0x00800000)
387 else if (iptr[0].val.i == 0x01000000)
389 else if (iptr[0].val.i == 0x02000000)
391 else if (iptr[0].val.i == 0x04000000)
393 else if (iptr[0].val.i == 0x08000000)
395 else if (iptr[0].val.i == 0x10000000)
397 else if (iptr[0].val.i == 0x20000000)
399 else if (iptr[0].val.i == 0x40000000)
401 else if (iptr[0].val.i == 0x80000000)
407 iptr[0].opc = ICMD_IDIVPOW2;
408 goto icmd_iconst_tail;
410 if (iptr[0].val.i == 0x10001) {
411 iptr[0].opc = ICMD_IREM0X10001;
412 goto icmd_iconst_tail;
414 if ((iptr[0].val.i == 0x00000002) ||
415 (iptr[0].val.i == 0x00000004) ||
416 (iptr[0].val.i == 0x00000008) ||
417 (iptr[0].val.i == 0x00000010) ||
418 (iptr[0].val.i == 0x00000020) ||
419 (iptr[0].val.i == 0x00000040) ||
420 (iptr[0].val.i == 0x00000080) ||
421 (iptr[0].val.i == 0x00000100) ||
422 (iptr[0].val.i == 0x00000200) ||
423 (iptr[0].val.i == 0x00000400) ||
424 (iptr[0].val.i == 0x00000800) ||
425 (iptr[0].val.i == 0x00001000) ||
426 (iptr[0].val.i == 0x00002000) ||
427 (iptr[0].val.i == 0x00004000) ||
428 (iptr[0].val.i == 0x00008000) ||
429 (iptr[0].val.i == 0x00010000) ||
430 (iptr[0].val.i == 0x00020000) ||
431 (iptr[0].val.i == 0x00040000) ||
432 (iptr[0].val.i == 0x00080000) ||
433 (iptr[0].val.i == 0x00100000) ||
434 (iptr[0].val.i == 0x00200000) ||
435 (iptr[0].val.i == 0x00400000) ||
436 (iptr[0].val.i == 0x00800000) ||
437 (iptr[0].val.i == 0x01000000) ||
438 (iptr[0].val.i == 0x02000000) ||
439 (iptr[0].val.i == 0x04000000) ||
440 (iptr[0].val.i == 0x08000000) ||
441 (iptr[0].val.i == 0x10000000) ||
442 (iptr[0].val.i == 0x20000000) ||
443 (iptr[0].val.i == 0x40000000) ||
444 (iptr[0].val.i == 0x80000000)) {
445 iptr[0].opc = ICMD_IREMPOW2;
447 goto icmd_iconst_tail;
452 iptr[0].opc = ICMD_IANDCONST;
453 goto icmd_iconst_tail;
455 iptr[0].opc = ICMD_IORCONST;
456 goto icmd_iconst_tail;
458 iptr[0].opc = ICMD_IXORCONST;
459 goto icmd_iconst_tail;
461 iptr[0].opc = ICMD_ISHLCONST;
462 goto icmd_iconst_tail;
464 iptr[0].opc = ICMD_ISHRCONST;
465 goto icmd_iconst_tail;
467 iptr[0].opc = ICMD_IUSHRCONST;
468 goto icmd_iconst_tail;
470 iptr[0].opc = ICMD_IFEQ;
472 iptr[0].op1 = iptr[1].op1;
475 /* iptr[1].opc = ICMD_NOP; */
477 tbptr = block + block_index[iptr->op1];
479 iptr[0].target = (void *) tbptr;
481 MARKREACHED(tbptr, copy);
482 COUNT(count_pcmd_bra);
485 iptr[0].opc = ICMD_IFLT;
486 goto icmd_if_icmp_tail;
488 iptr[0].opc = ICMD_IFLE;
489 goto icmd_if_icmp_tail;
491 iptr[0].opc = ICMD_IFNE;
492 goto icmd_if_icmp_tail;
494 iptr[0].opc = ICMD_IFGT;
495 goto icmd_if_icmp_tail;
497 iptr[0].opc = ICMD_IFGE;
498 goto icmd_if_icmp_tail;
507 COUNT(count_pcmd_load);
509 switch (iptr[1].opc) {
511 iptr[0].opc = ICMD_LADDCONST;
513 iptr[1].opc = ICMD_NOP;
514 OP1_1(TYPE_LNG,TYPE_LNG);
515 COUNT(count_pcmd_op);
518 iptr[0].opc = ICMD_LSUBCONST;
519 goto icmd_lconst_tail;
521 iptr[0].opc = ICMD_LMULCONST;
522 goto icmd_lconst_tail;
524 if (iptr[0].val.l == 0x00000002)
526 else if (iptr[0].val.l == 0x00000004)
528 else if (iptr[0].val.l == 0x00000008)
530 else if (iptr[0].val.l == 0x00000010)
532 else if (iptr[0].val.l == 0x00000020)
534 else if (iptr[0].val.l == 0x00000040)
536 else if (iptr[0].val.l == 0x00000080)
538 else if (iptr[0].val.l == 0x00000100)
540 else if (iptr[0].val.l == 0x00000200)
542 else if (iptr[0].val.l == 0x00000400)
544 else if (iptr[0].val.l == 0x00000800)
546 else if (iptr[0].val.l == 0x00001000)
548 else if (iptr[0].val.l == 0x00002000)
550 else if (iptr[0].val.l == 0x00004000)
552 else if (iptr[0].val.l == 0x00008000)
554 else if (iptr[0].val.l == 0x00010000)
556 else if (iptr[0].val.l == 0x00020000)
558 else if (iptr[0].val.l == 0x00040000)
560 else if (iptr[0].val.l == 0x00080000)
562 else if (iptr[0].val.l == 0x00100000)
564 else if (iptr[0].val.l == 0x00200000)
566 else if (iptr[0].val.l == 0x00400000)
568 else if (iptr[0].val.l == 0x00800000)
570 else if (iptr[0].val.l == 0x01000000)
572 else if (iptr[0].val.l == 0x02000000)
574 else if (iptr[0].val.l == 0x04000000)
576 else if (iptr[0].val.l == 0x08000000)
578 else if (iptr[0].val.l == 0x10000000)
580 else if (iptr[0].val.l == 0x20000000)
582 else if (iptr[0].val.l == 0x40000000)
584 else if (iptr[0].val.l == 0x80000000)
590 iptr[0].opc = ICMD_LDIVPOW2;
591 goto icmd_lconst_tail;
593 if (iptr[0].val.l == 0x10001) {
594 iptr[0].opc = ICMD_LREM0X10001;
595 goto icmd_lconst_tail;
597 if ((iptr[0].val.l == 0x00000002) ||
598 (iptr[0].val.l == 0x00000004) ||
599 (iptr[0].val.l == 0x00000008) ||
600 (iptr[0].val.l == 0x00000010) ||
601 (iptr[0].val.l == 0x00000020) ||
602 (iptr[0].val.l == 0x00000040) ||
603 (iptr[0].val.l == 0x00000080) ||
604 (iptr[0].val.l == 0x00000100) ||
605 (iptr[0].val.l == 0x00000200) ||
606 (iptr[0].val.l == 0x00000400) ||
607 (iptr[0].val.l == 0x00000800) ||
608 (iptr[0].val.l == 0x00001000) ||
609 (iptr[0].val.l == 0x00002000) ||
610 (iptr[0].val.l == 0x00004000) ||
611 (iptr[0].val.l == 0x00008000) ||
612 (iptr[0].val.l == 0x00010000) ||
613 (iptr[0].val.l == 0x00020000) ||
614 (iptr[0].val.l == 0x00040000) ||
615 (iptr[0].val.l == 0x00080000) ||
616 (iptr[0].val.l == 0x00100000) ||
617 (iptr[0].val.l == 0x00200000) ||
618 (iptr[0].val.l == 0x00400000) ||
619 (iptr[0].val.l == 0x00800000) ||
620 (iptr[0].val.l == 0x01000000) ||
621 (iptr[0].val.l == 0x02000000) ||
622 (iptr[0].val.l == 0x04000000) ||
623 (iptr[0].val.l == 0x08000000) ||
624 (iptr[0].val.l == 0x10000000) ||
625 (iptr[0].val.l == 0x20000000) ||
626 (iptr[0].val.l == 0x40000000) ||
627 (iptr[0].val.l == 0x80000000)) {
628 iptr[0].opc = ICMD_LREMPOW2;
630 goto icmd_lconst_tail;
635 iptr[0].opc = ICMD_LANDCONST;
636 goto icmd_lconst_tail;
638 iptr[0].opc = ICMD_LORCONST;
639 goto icmd_lconst_tail;
641 iptr[0].opc = ICMD_LXORCONST;
642 goto icmd_lconst_tail;
644 iptr[0].opc = ICMD_LSHLCONST;
645 goto icmd_lconst_tail;
647 iptr[0].opc = ICMD_LSHRCONST;
648 goto icmd_lconst_tail;
650 iptr[0].opc = ICMD_LUSHRCONST;
651 goto icmd_lconst_tail;
653 if ((len > 1) && (iptr[2].val.i == 0)) {
654 switch (iptr[2].opc) {
656 iptr[0].opc = ICMD_IF_LEQ;
657 icmd_lconst_lcmp_tail:
658 iptr[0].op1 = iptr[2].op1;
661 /* iptr[1].opc = ICMD_NOP;
662 iptr[2].opc = ICMD_NOP; */
664 tbptr = block + block_index[iptr->op1];
666 iptr[0].target = (void *) tbptr;
668 MARKREACHED(tbptr, copy);
669 COUNT(count_pcmd_bra);
670 COUNT(count_pcmd_op);
673 iptr[0].opc = ICMD_IF_LNE;
674 goto icmd_lconst_lcmp_tail;
676 iptr[0].opc = ICMD_IF_LLT;
677 goto icmd_lconst_lcmp_tail;
679 iptr[0].opc = ICMD_IF_LGT;
680 goto icmd_lconst_lcmp_tail;
682 iptr[0].opc = ICMD_IF_LLE;
683 goto icmd_lconst_lcmp_tail;
685 iptr[0].opc = ICMD_IF_LGE;
686 goto icmd_lconst_lcmp_tail;
689 } /* switch (iptr[2].opc) */
690 } /* if (iptr[2].val.i == 0) */
702 COUNT(count_pcmd_load);
706 COUNT(count_pcmd_load);
710 COUNT(count_pcmd_load);
714 /* pop 0 push 1 load */
721 COUNT(count_load_instruction);
722 i = opcode-ICMD_ILOAD;
723 locals[iptr->op1][i].type = i;
724 LOAD(i, LOCALVAR, iptr->op1);
734 COUNT(count_check_null);
735 COUNT(count_check_bound);
736 COUNT(count_pcmd_mem);
737 OP2IAT_1(opcode-ICMD_IALOAD);
743 COUNT(count_check_null);
744 COUNT(count_check_bound);
745 COUNT(count_pcmd_mem);
749 /* pop 0 push 0 iinc */
755 count_store_depth[10]++;
757 count_store_depth[i]++;
762 if ((copy->varkind == LOCALVAR) &&
763 (copy->varnum == curstack->varnum)) {
764 copy->varkind = TEMPVAR;
773 /* pop 1 push 0 store */
780 i = opcode-ICMD_ISTORE;
781 locals[iptr->op1][i].type = i;
786 count_store_length[20]++;
788 count_store_length[i]++;
791 count_store_depth[10]++;
793 count_store_depth[i]++;
795 copy = curstack->prev;
798 if ((copy->varkind == LOCALVAR) &&
799 (copy->varnum == curstack->varnum)) {
800 copy->varkind = TEMPVAR;
806 if ((new - curstack) == 1) {
807 curstack->varkind = LOCALVAR;
808 curstack->varnum = iptr->op1;
810 STORE(opcode-ICMD_ISTORE);
820 COUNT(count_check_null);
821 COUNT(count_check_bound);
822 COUNT(count_pcmd_mem);
823 OP3TIA_0(opcode-ICMD_IASTORE);
828 COUNT(count_check_null);
829 COUNT(count_check_bound);
830 COUNT(count_pcmd_mem);
845 COUNT(count_pcmd_return);
846 OP1_0(opcode-ICMD_IRETURN);
847 superblockend = true;
851 COUNT(count_check_null);
855 superblockend = true;
859 COUNT(count_pcmd_mem);
863 /* pop 1 push 0 branch */
867 COUNT(count_pcmd_bra);
869 tbptr = block + block_index[iptr->op1];
871 iptr[0].target = (void *) tbptr;
873 MARKREACHED(tbptr, copy);
882 COUNT(count_pcmd_bra);
883 #ifdef CONDITIONAL_LOADCONST
885 tbptr = block + b_index;
886 if ((b_count >= 3) &&
887 ((b_index + 2) == block_index[iptr[0].op1]) &&
888 (tbptr[1].pre_count == 1) &&
889 (iptr[1].opc == ICMD_ICONST) &&
890 (iptr[2].opc == ICMD_GOTO) &&
891 ((b_index + 3) == block_index[iptr[2].op1]) &&
892 (tbptr[2].pre_count == 1) &&
893 (iptr[3].opc == ICMD_ICONST)) {
894 OP1_1(TYPE_INT, TYPE_INT);
895 switch (iptr[0].opc) {
897 iptr[0].opc = ICMD_IFNE_ICONST;
900 iptr[0].opc = ICMD_IFEQ_ICONST;
903 iptr[0].opc = ICMD_IFGE_ICONST;
906 iptr[0].opc = ICMD_IFLT_ICONST;
909 iptr[0].opc = ICMD_IFLE_ICONST;
912 iptr[0].opc = ICMD_IFGT_ICONST;
915 iptr[0].val.i = iptr[1].val.i;
916 iptr[1].opc = ICMD_ELSE_ICONST;
917 iptr[1].val.i = iptr[3].val.i;
918 iptr[2].opc = ICMD_NOP;
919 iptr[3].opc = ICMD_NOP;
920 tbptr[1].flags = BBDELETED;
921 tbptr[2].flags = BBDELETED;
924 if (tbptr[3].pre_count == 2) {
925 len += tbptr[3].icount + 3;
926 bptr->icount += tbptr[3].icount + 3;
927 tbptr[3].flags = BBDELETED;
941 tbptr = block + block_index[iptr->op1];
943 iptr[0].target = (void *) tbptr;
945 MARKREACHED(tbptr, copy);
948 /* pop 0 push 0 branch */
951 COUNT(count_pcmd_bra);
952 tbptr = block + block_index[iptr->op1];
954 iptr[0].target = (void *) tbptr;
956 MARKREACHED(tbptr, copy);
958 superblockend = true;
961 /* pop 1 push 0 table branch */
963 case ICMD_TABLESWITCH:
964 COUNT(count_pcmd_table);
967 tbptr = block + block_index[*s4ptr++]; /* default */
968 MARKREACHED(tbptr, copy);
969 i = *s4ptr++; /* low */
970 i = *s4ptr++ - i + 1; /* high */
972 tptr = DMNEW(void*, i+1);
973 iptr->target = (void *) tptr;
975 tptr[0] = (void *) tbptr;
979 tbptr = block + block_index[*s4ptr++];
981 tptr[0] = (void *) tbptr;
984 MARKREACHED(tbptr, copy);
987 superblockend = true;
990 /* pop 1 push 0 table branch */
992 case ICMD_LOOKUPSWITCH:
993 COUNT(count_pcmd_table);
996 tbptr = block + block_index[*s4ptr++]; /* default */
997 MARKREACHED(tbptr, copy);
998 i = *s4ptr++; /* count */
1000 tptr = DMNEW(void*, i+1);
1001 iptr->target = (void *) tptr;
1003 tptr[0] = (void *) tbptr;
1007 tbptr = block + block_index[s4ptr[1]];
1009 tptr[0] = (void *) tbptr;
1012 MARKREACHED(tbptr, copy);
1016 superblockend = true;
1019 case ICMD_NULLCHECKPOP:
1020 case ICMD_MONITORENTER:
1021 COUNT(count_check_null);
1022 case ICMD_MONITOREXIT:
1026 /* pop 2 push 0 branch */
1028 case ICMD_IF_ICMPEQ:
1029 case ICMD_IF_ICMPNE:
1030 case ICMD_IF_ICMPLT:
1031 case ICMD_IF_ICMPGE:
1032 case ICMD_IF_ICMPGT:
1033 case ICMD_IF_ICMPLE:
1034 COUNT(count_pcmd_bra);
1036 tbptr = block + block_index[iptr->op1];
1038 iptr[0].target = (void *) tbptr;
1040 MARKREACHED(tbptr, copy);
1043 case ICMD_IF_ACMPEQ:
1044 case ICMD_IF_ACMPNE:
1045 COUNT(count_pcmd_bra);
1047 tbptr = block + block_index[iptr->op1];
1049 iptr[0].target = (void *) tbptr;
1051 MARKREACHED(tbptr, copy);
1057 COUNT(count_check_null);
1058 COUNT(count_pcmd_mem);
1059 OPTT2_0(iptr->op1,TYPE_ADR);
1063 if (! IS_2_WORD_TYPE(curstack->type)) {
1064 OP1_0ANY; /* second pop */
1067 iptr->opc = ICMD_POP;
1071 /* pop 0 push 1 dup */
1074 COUNT(count_dup_instruction);
1079 if (IS_2_WORD_TYPE(curstack->type)) {
1080 iptr->opc = ICMD_DUP;
1085 NEWSTACK(copy->prev->type, copy->prev->varkind,
1086 copy->prev->varnum);
1087 NEWSTACK(copy->type, copy->varkind,
1094 /* pop 2 push 3 dup */
1101 if (IS_2_WORD_TYPE(curstack->type)) {
1102 iptr->opc = ICMD_DUP_X1;
1110 /* pop 3 push 4 dup */
1113 if (IS_2_WORD_TYPE(curstack->prev->type)) {
1114 iptr->opc = ICMD_DUP_X1;
1123 if (IS_2_WORD_TYPE(curstack->type)) {
1124 if (IS_2_WORD_TYPE(curstack->prev->type)) {
1125 iptr->opc = ICMD_DUP_X1;
1129 iptr->opc = ICMD_DUP_X2;
1134 if (IS_2_WORD_TYPE(curstack->prev->prev->type)) {
1135 iptr->opc = ICMD_DUP2_X1;
1143 /* pop 2 push 2 swap */
1152 if (!(SUPPORT_DIVISION)) {
1153 iptr[0].opc = ICMD_BUILTIN2;
1154 iptr[0].op1 = TYPE_INT;
1155 iptr[0].val.a = (functionptr) asm_builtin_idiv;
1156 isleafmethod = false;
1161 if (!(SUPPORT_DIVISION)) {
1162 iptr[0].opc = ICMD_BUILTIN2;
1163 iptr[0].op1 = TYPE_INT;
1164 iptr[0].val.a = (functionptr) asm_builtin_irem;
1165 isleafmethod = false;
1179 COUNT(count_pcmd_op);
1184 if (!(SUPPORT_DIVISION && SUPPORT_LONG && SUPPORT_LONG_MULDIV)) {
1185 iptr[0].opc = ICMD_BUILTIN2;
1186 iptr[0].op1 = TYPE_LNG;
1187 iptr[0].val.a = (functionptr) asm_builtin_ldiv;
1188 isleafmethod = false;
1193 if (!(SUPPORT_DIVISION && SUPPORT_LONG && SUPPORT_LONG_MULDIV)) {
1194 iptr[0].opc = ICMD_BUILTIN2;
1195 iptr[0].op1 = TYPE_LNG;
1196 iptr[0].val.a = (functionptr) asm_builtin_lrem;
1197 isleafmethod = false;
1208 COUNT(count_pcmd_op);
1215 COUNT(count_pcmd_op);
1224 COUNT(count_pcmd_op);
1233 COUNT(count_pcmd_op);
1238 COUNT(count_pcmd_op);
1239 if ((len > 0) && (iptr[1].val.i == 0)) {
1240 switch (iptr[1].opc) {
1242 iptr[0].opc = ICMD_IF_LCMPEQ;
1244 iptr[0].op1 = iptr[1].op1;
1247 /* iptr[1].opc = ICMD_NOP; */
1249 tbptr = block + block_index[iptr->op1];
1251 iptr[0].target = (void *) tbptr;
1253 MARKREACHED(tbptr, copy);
1254 COUNT(count_pcmd_bra);
1257 iptr[0].opc = ICMD_IF_LCMPNE;
1258 goto icmd_lcmp_if_tail;
1260 iptr[0].opc = ICMD_IF_LCMPLT;
1261 goto icmd_lcmp_if_tail;
1263 iptr[0].opc = ICMD_IF_LCMPGT;
1264 goto icmd_lcmp_if_tail;
1266 iptr[0].opc = ICMD_IF_LCMPLE;
1267 goto icmd_lcmp_if_tail;
1269 iptr[0].opc = ICMD_IF_LCMPGE;
1270 goto icmd_lcmp_if_tail;
1272 OPTT2_1(TYPE_LNG, TYPE_INT);
1276 OPTT2_1(TYPE_LNG, TYPE_INT);
1280 COUNT(count_pcmd_op);
1281 OPTT2_1(TYPE_FLT, TYPE_INT);
1285 COUNT(count_pcmd_op);
1286 OPTT2_1(TYPE_DBL, TYPE_INT);
1294 case ICMD_INT2SHORT:
1295 COUNT(count_pcmd_op);
1296 OP1_1(TYPE_INT, TYPE_INT);
1299 COUNT(count_pcmd_op);
1300 OP1_1(TYPE_LNG, TYPE_LNG);
1303 COUNT(count_pcmd_op);
1304 OP1_1(TYPE_FLT, TYPE_FLT);
1307 COUNT(count_pcmd_op);
1308 OP1_1(TYPE_DBL, TYPE_DBL);
1312 COUNT(count_pcmd_op);
1313 OP1_1(TYPE_INT, TYPE_LNG);
1316 COUNT(count_pcmd_op);
1317 OP1_1(TYPE_INT, TYPE_FLT);
1320 COUNT(count_pcmd_op);
1321 OP1_1(TYPE_INT, TYPE_DBL);
1324 COUNT(count_pcmd_op);
1325 OP1_1(TYPE_LNG, TYPE_INT);
1328 COUNT(count_pcmd_op);
1329 OP1_1(TYPE_LNG, TYPE_FLT);
1332 COUNT(count_pcmd_op);
1333 OP1_1(TYPE_LNG, TYPE_DBL);
1336 COUNT(count_pcmd_op);
1337 OP1_1(TYPE_FLT, TYPE_INT);
1340 COUNT(count_pcmd_op);
1341 OP1_1(TYPE_FLT, TYPE_LNG);
1344 COUNT(count_pcmd_op);
1345 OP1_1(TYPE_FLT, TYPE_DBL);
1348 COUNT(count_pcmd_op);
1349 OP1_1(TYPE_DBL, TYPE_INT);
1352 COUNT(count_pcmd_op);
1353 OP1_1(TYPE_DBL, TYPE_LNG);
1356 COUNT(count_pcmd_op);
1357 OP1_1(TYPE_DBL, TYPE_FLT);
1360 case ICMD_CHECKCAST:
1361 OP1_1(TYPE_ADR, TYPE_ADR);
1364 case ICMD_ARRAYLENGTH:
1365 case ICMD_INSTANCEOF:
1366 OP1_1(TYPE_ADR, TYPE_INT);
1370 case ICMD_ANEWARRAY:
1371 OP1_1(TYPE_INT, TYPE_ADR);
1375 COUNT(count_check_null);
1376 COUNT(count_pcmd_mem);
1377 OP1_1(TYPE_ADR, iptr->op1);
1382 case ICMD_GETSTATIC:
1383 COUNT(count_pcmd_mem);
1393 tbptr = block + block_index[iptr->op1];
1395 iptr[0].target = (void *) tbptr;
1397 tbptr->type=BBTYPE_SBR;
1398 MARKREACHED(tbptr, copy);
1402 /* pop many push any */
1404 case ICMD_INVOKEVIRTUAL:
1405 case ICMD_INVOKESPECIAL:
1406 case ICMD_INVOKEINTERFACE:
1407 case ICMD_INVOKESTATIC:
1408 COUNT(count_pcmd_met);
1410 methodinfo *m = iptr->val.a;
1411 if (m->flags & ACC_STATIC)
1412 {COUNT(count_check_null);}
1414 if (i > arguments_num)
1418 if (! (copy->flags & SAVEDVAR)) {
1419 copy->varkind = ARGVAR;
1425 copy->flags |= SAVEDVAR;
1430 if (m->returntype != TYPE_VOID) {
1431 OP0_1(m->returntype);
1437 if (! (curstack->flags & SAVEDVAR)) {
1438 curstack->varkind = ARGVAR;
1439 curstack->varnum = 2;
1444 if (! (curstack->flags & SAVEDVAR)) {
1445 curstack->varkind = ARGVAR;
1446 curstack->varnum = 1;
1450 if (! (curstack->flags & SAVEDVAR)) {
1451 curstack->varkind = ARGVAR;
1452 curstack->varnum = 0;
1457 copy->flags |= SAVEDVAR;
1460 if (iptr->op1 != TYPE_VOID)
1464 case ICMD_MULTIANEWARRAY:
1466 if ((i + intreg_argnum) > arguments_num)
1467 arguments_num = i + intreg_argnum;
1470 if (! (copy->flags & SAVEDVAR)) {
1471 copy->varkind = ARGVAR;
1472 copy->varnum = i + intreg_argnum;
1477 copy->flags |= SAVEDVAR;
1486 printf("ICMD %d at %d\n", iptr->opc, (int)(iptr-instr));
1487 panic("Missing ICMD code during stack analysis");
1490 } /* while instructions */
1491 bptr->outstack = curstack;
1492 bptr->outdepth = stackdepth;
1496 superblockend = true;
1498 } /* while blocks */
1499 } while (repeat && ! deadcode);
1502 if (block_count > count_max_basic_blocks)
1503 count_max_basic_blocks = block_count;
1504 count_basic_blocks += block_count;
1505 if (instr_count > count_max_javainstr)
1506 count_max_javainstr = instr_count;
1507 count_javainstr += instr_count;
1508 if (stack_count > count_upper_bound_new_stack)
1509 count_upper_bound_new_stack = stack_count;
1510 if ((new - stack) > count_max_new_stack)
1511 count_max_new_stack = (new - stack);
1513 b_count = block_count;
1515 while (--b_count >= 0) {
1516 if (bptr->flags > BBREACHED) {
1517 if (bptr->indepth >= 10)
1518 count_block_stack[10]++;
1520 count_block_stack[bptr->indepth]++;
1523 count_block_size_distribution[len]++;
1525 count_block_size_distribution[10]++;
1527 count_block_size_distribution[11]++;
1529 count_block_size_distribution[12]++;
1531 count_block_size_distribution[13]++;
1533 count_block_size_distribution[14]++;
1535 count_block_size_distribution[15]++;
1537 count_block_size_distribution[16]++;
1539 count_block_size_distribution[17]++;
1545 count_analyse_iterations[0]++;
1546 else if (loops == 2)
1547 count_analyse_iterations[1]++;
1548 else if (loops == 3)
1549 count_analyse_iterations[2]++;
1550 else if (loops == 4)
1551 count_analyse_iterations[3]++;
1553 count_analyse_iterations[4]++;
1555 if (block_count <= 5)
1556 count_method_bb_distribution[0]++;
1557 else if (block_count <= 10)
1558 count_method_bb_distribution[1]++;
1559 else if (block_count <= 15)
1560 count_method_bb_distribution[2]++;
1561 else if (block_count <= 20)
1562 count_method_bb_distribution[3]++;
1563 else if (block_count <= 30)
1564 count_method_bb_distribution[4]++;
1565 else if (block_count <= 40)
1566 count_method_bb_distribution[5]++;
1567 else if (block_count <= 50)
1568 count_method_bb_distribution[6]++;
1569 else if (block_count <= 75)
1570 count_method_bb_distribution[7]++;
1572 count_method_bb_distribution[8]++;
1577 static void print_stack(stackptr s) {
1593 if (s->flags & SAVEDVAR)
1594 switch (s->varkind) {
1596 if (s->flags & INMEMORY)
1597 printf(" M%02d", s->regoff);
1598 else if ((s->type == TYPE_FLT) || (s->type == TYPE_DBL))
1599 printf(" F%02d", s->regoff);
1601 printf(" %3s", regs[s->regoff]);
1604 printf(" I%02d", s->varnum);
1607 printf(" L%02d", s->varnum);
1610 printf(" A%02d", s->varnum);
1613 printf(" !%02d", j);
1616 switch (s->varkind) {
1618 if (s->flags & INMEMORY)
1619 printf(" m%02d", s->regoff);
1620 else if ((s->type == TYPE_FLT) || (s->type == TYPE_DBL))
1621 printf(" f%02d", s->regoff);
1623 printf(" %3s", regs[s->regoff]);
1626 printf(" i%02d", s->varnum);
1629 printf(" l%02d", s->varnum);
1632 printf(" a%02d", s->varnum);
1635 printf(" ?%02d", j);
1643 static void print_reg(stackptr s) {
1645 if (s->flags & SAVEDVAR)
1646 switch (s->varkind) {
1648 if (s->flags & INMEMORY)
1649 printf(" tm%02d", s->regoff);
1651 printf(" tr%02d", s->regoff);
1654 printf(" s %02d", s->varnum);
1657 printf(" l %02d", s->varnum);
1660 printf(" a %02d", s->varnum);
1663 printf(" ! %02d", s->varnum);
1666 switch (s->varkind) {
1668 if (s->flags & INMEMORY)
1669 printf(" Tm%02d", s->regoff);
1671 printf(" Tr%02d", s->regoff);
1674 printf(" S %02d", s->varnum);
1677 printf(" L %02d", s->varnum);
1680 printf(" A %02d", s->varnum);
1683 printf(" ? %02d", s->varnum);
1693 static char *builtin_name(functionptr bptr)
1695 builtin_descriptor *bdesc = builtin_desc;
1696 while ((bdesc->bptr != NULL) && (bdesc->bptr != bptr))
1702 static char *jit_type[] = {
1711 static void show_icmd_method()
1722 utf_fprint(stdout, class->name);
1724 utf_fprint(stdout, method->name);
1726 utf_fprint(stdout, method->descriptor);
1727 printf ("\n\nMax locals: %d\n", (int) maxlocals);
1728 printf ("Max stack: %d\n", (int) maxstack);
1730 printf ("Exceptions (Number: %d):\n", exceptiontablelength);
1731 for (ex = extable; ex != NULL; ex = ex->down) {
1732 printf(" L%03d ... ", ex->start->debug_nr );
1733 printf("L%03d = ", ex->end->debug_nr);
1734 printf("L%03d\n", ex->handler->debug_nr);
1737 printf ("Local Table:\n");
1738 for (i = 0; i < maxlocals; i++) {
1739 printf(" %3d: ", i);
1740 for (j = TYPE_INT; j <= TYPE_ADR; j++)
1741 if (locals[i][j].type >= 0) {
1742 printf(" (%s) ", jit_type[j]);
1743 if (locals[i][j].flags & INMEMORY)
1744 printf("m%2d", locals[i][j].regoff);
1745 else if ((j == TYPE_FLT) || (j == TYPE_DBL))
1746 printf("f%02d", locals[i][j].regoff);
1748 printf("%3s", regs[locals[i][j].regoff]);
1754 printf ("Interface Table:\n");
1755 for (i = 0; i < maxstack; i++) {
1756 if ((interfaces[i][0].type >= 0) || (interfaces[i][1].type >= 0) ||
1757 (interfaces[i][2].type >= 0) || (interfaces[i][3].type >= 0) ||
1758 (interfaces[i][4].type >= 0)) {
1759 printf(" %3d: ", i);
1760 for (j = TYPE_INT; j <= TYPE_ADR; j++)
1761 if (interfaces[i][j].type >= 0) {
1762 printf(" (%s) ", jit_type[j]);
1763 if (interfaces[i][j].flags & SAVEDVAR) {
1764 if (interfaces[i][j].flags & INMEMORY)
1765 printf("M%2d", interfaces[i][j].regoff);
1766 else if ((j == TYPE_FLT) || (j == TYPE_DBL))
1767 printf("F%02d", interfaces[i][j].regoff);
1769 printf("%3s", regs[interfaces[i][j].regoff]);
1772 if (interfaces[i][j].flags & INMEMORY)
1773 printf("m%2d", interfaces[i][j].regoff);
1774 else if ((j == TYPE_FLT) || (j == TYPE_DBL))
1775 printf("f%02d", interfaces[i][j].regoff);
1777 printf("%3s", regs[interfaces[i][j].regoff]);
1785 if (showdisassemble) {
1787 extern s4 *codestatic;
1790 s4ptr = (s4 *) (method->mcode + dseglen);
1791 for (i = 0; i < block[0].mpc; i++, ((s4) s4ptr)++) {
1792 disassinstr((s4) s4ptr, i);
1798 s4ptr = (s4 *) (method->mcode + dseglen);
1799 for (i = 0; i < block[0].mpc; i += 4, s4ptr++) {
1800 disassinstr(*s4ptr, i);
1807 for (bptr = block; bptr != NULL; bptr = bptr->next)
1808 if (bptr->flags != BBDELETED) {
1809 deadcode = bptr->flags <= BBREACHED;
1812 for (j = maxstack; j > 0; j--)
1815 print_stack(bptr->instack);
1816 printf("] L%03d(%d - %d):\n", bptr->debug_nr, bptr->icount, bptr->pre_count);
1817 iptr = bptr->iinstr;
1819 for (i=0; i < bptr->icount; i++, iptr++) {
1822 for (j = maxstack; j > 0; j--)
1826 print_stack(iptr->dst);
1827 printf("] %4d %s", i, icmd_names[iptr->opc]);
1828 switch ((int) iptr->opc) {
1829 case ICMD_IADDCONST:
1830 case ICMD_ISUBCONST:
1831 case ICMD_IMULCONST:
1834 case ICMD_IREM0X10001:
1835 case ICMD_IANDCONST:
1837 case ICMD_IXORCONST:
1838 case ICMD_ISHLCONST:
1839 case ICMD_ISHRCONST:
1840 case ICMD_IUSHRCONST:
1842 case ICMD_ELSE_ICONST:
1843 case ICMD_IFEQ_ICONST:
1844 case ICMD_IFNE_ICONST:
1845 case ICMD_IFLT_ICONST:
1846 case ICMD_IFGE_ICONST:
1847 case ICMD_IFGT_ICONST:
1848 case ICMD_IFLE_ICONST:
1849 printf(" %d", iptr->val.i);
1851 case ICMD_LADDCONST:
1852 case ICMD_LSUBCONST:
1853 case ICMD_LMULCONST:
1856 case ICMD_LANDCONST:
1858 case ICMD_LXORCONST:
1859 case ICMD_LSHLCONST:
1860 case ICMD_LSHRCONST:
1861 case ICMD_LUSHRCONST:
1863 printf(" %ld", iptr->val.l);
1866 printf(" %f", iptr->val.f);
1869 printf(" %f", iptr->val.d);
1872 printf(" %p", iptr->val.a);
1876 printf(" %d,", ((fieldinfo *) iptr->val.a)->offset);
1877 case ICMD_PUTSTATIC:
1878 case ICMD_GETSTATIC:
1881 ((fieldinfo *) iptr->val.a)->name);
1884 printf(" %d + %d", iptr->op1, iptr->val.i);
1919 printf(" %d", iptr->op1);
1924 ((classinfo *) iptr->val.a)->name);
1927 switch (iptr->op1) {
1954 case ICMD_ANEWARRAY:
1958 ((classinfo *) iptr->val.a)->name);
1961 case ICMD_CHECKCAST:
1962 case ICMD_INSTANCEOF:
1964 classinfo *c = iptr->val.a;
1965 if (c->flags & ACC_INTERFACE)
1966 printf(" (INTERFACE) ");
1968 printf(" (CLASS,%3d) ", c->vftbl->diffval);
1969 utf_fprint(stdout, c->name);
1975 printf(" %s", builtin_name((functionptr) iptr->val.a));
1977 case ICMD_INVOKEVIRTUAL:
1978 case ICMD_INVOKESPECIAL:
1979 case ICMD_INVOKESTATIC:
1980 case ICMD_INVOKEINTERFACE:
1983 ((methodinfo *) iptr->val.a)->class->name);
1986 ((methodinfo *) iptr->val.a)->name);
2000 printf("(%d) L%03d", iptr->val.i, ((basicblock *) iptr->target)->debug_nr);
2005 case ICMD_IFNONNULL:
2006 case ICMD_IF_ICMPEQ:
2007 case ICMD_IF_ICMPNE:
2008 case ICMD_IF_ICMPLT:
2009 case ICMD_IF_ICMPGE:
2010 case ICMD_IF_ICMPGT:
2011 case ICMD_IF_ICMPLE:
2012 case ICMD_IF_LCMPEQ:
2013 case ICMD_IF_LCMPNE:
2014 case ICMD_IF_LCMPLT:
2015 case ICMD_IF_LCMPGE:
2016 case ICMD_IF_LCMPGT:
2017 case ICMD_IF_LCMPLE:
2018 case ICMD_IF_ACMPEQ:
2019 case ICMD_IF_ACMPNE:
2020 printf(" L%03d", ((basicblock *) iptr->target)->debug_nr);
2022 case ICMD_TABLESWITCH:
2024 s4ptr = iptr->val.a;
2025 tptr = (void **) iptr->target;
2027 printf(" L%03d;", ((basicblock *) *tptr)->debug_nr);
2033 j = *s4ptr++; /* low */
2034 j = *s4ptr++ - j; /* high */
2036 printf(" L%03d", ((basicblock *) *tptr)->debug_nr);
2041 case ICMD_LOOKUPSWITCH:
2042 s4ptr = iptr->val.a;
2043 tptr = (void **) iptr->target;
2045 printf(" L%03d", ((basicblock *) *tptr)->debug_nr);
2046 s4ptr++; /* default */
2047 j = *s4ptr; /* count */
2051 printf(" L%03d", ((basicblock *) *tptr)->debug_nr);
2059 if (showdisassemble && (!deadcode)) {
2061 extern s4 *codestatic;
2066 s4ptr = (s4 *) (method->mcode + dseglen + i);
2068 if (bptr->next != NULL) {
2069 for (; i < bptr->next->mpc; i++, ((s4) s4ptr)++) {
2070 disassinstr((s4) s4ptr, i);
2077 for (; s4ptr < (s4 *) (method->mcode + method->mcodelength); i++, ((s4) s4ptr)++) {
2078 disassinstr((s4) s4ptr, i);
2087 s4ptr = (s4 *) (method->mcode + dseglen + i);
2089 if (bptr->next != NULL) {
2090 for (; i < bptr->next->mpc; i += 4, s4ptr++) {
2091 disassinstr(*s4ptr, i);
2096 for (; s4ptr < (s4 *) (method->mcode + method->mcodelength); i += 4, s4ptr++) {
2097 disassinstr(*s4ptr, i);
2107 s4ptr = (s4 *) (method->mcode + dseglen + i);
2108 if (showdisassemble && (s4ptr < (s4 *) (method->mcode + method->mcodelength))) {
2110 for (; s4ptr < (s4 *) (method->mcode + method->mcodelength); i += 4, s4ptr++) {
2111 disassinstr(*s4ptr, i);
2120 * These are local overrides for various environment variables in Emacs.
2121 * Please do not remove this and leave it at the end of the file, where
2122 * Emacs will automagically detect them.
2123 * ---------------------------------------------------------------------
2126 * indent-tabs-mode: t