1 /* src/vm/jit/show.c - showing the intermediate representation
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Andreas Krall
29 Changes: Edwin Steiner
43 #include "mm/memory.h"
45 #if defined(ENABLE_THREADS)
46 # include "threads/native/lock.h"
48 # include "threads/none/lock.h"
51 #include "vm/global.h"
52 #include "vm/options.h"
53 #include "vm/builtin.h"
54 #include "vm/stringlocal.h"
55 #include "vm/jit/jit.h"
56 #include "vm/jit/show.h"
57 #include "vm/jit/disass.h"
58 #include "vm/jit/stack.h"
61 /* global variables ***********************************************************/
63 #if defined(ENABLE_THREADS) && !defined(NDEBUG)
64 static java_objectheader *show_global_lock;
68 /* forward declarations *******************************************************/
71 static void new_show_variable_array(jitdata *jd, stackptr *vars, int n, int stage);
75 /* show_init *******************************************************************
77 Initialized the show subsystem (called by jit_init).
79 *******************************************************************************/
84 #if defined(ENABLE_THREADS)
85 /* initialize the show lock */
87 show_global_lock = NEW(java_objectheader);
89 lock_init_object_lock(show_global_lock);
100 static char *jit_type[] = {
110 /* show_method *****************************************************************
112 Print the intermediate representation of a method.
114 NOTE: Currently this function may only be called after register allocation!
116 *******************************************************************************/
119 void new_show_method(jitdata *jd, int stage)
126 basicblock *lastbptr;
131 /* get required compiler data */
138 /* We need to enter a lock here, since the binutils disassembler
139 is not reentrant-able and we could not read functions printed
142 LOCK_MONITOR_ENTER(show_global_lock);
144 /* get the last basic block */
146 for (lastbptr = jd->new_basicblocks; lastbptr->next != NULL; lastbptr = lastbptr->next);
152 printf("\n(NEW INSTRUCTION FORMAT)\n");
153 printf("\nBasic blocks: %d\n", jd->new_basicblockcount);
154 if (stage >= SHOW_CODE) {
155 printf("Code length: %d\n", (lastbptr->mpc - jd->new_basicblocks[0].mpc));
156 printf("Data length: %d\n", cd->dseglen);
157 printf("Stub length: %d\n", (s4) (code->mcodelength -
158 ((ptrint) cd->dseglen + lastbptr->mpc)));
160 printf("Max locals: %d\n", cd->maxlocals);
161 printf("Max stack: %d\n", cd->maxstack);
162 printf("Line number table length: %d\n", m->linenumbercount);
164 if (stage >= SHOW_PARSE) {
165 printf("Exceptions (Number: %d):\n", cd->exceptiontablelength);
166 for (ex = cd->exceptiontable; ex != NULL; ex = ex->down) {
167 printf(" L%03d ... ", ex->start->nr );
168 printf("L%03d = ", ex->end->nr);
169 printf("L%03d", ex->handler->nr);
170 printf(" (catchtype: ");
171 if (ex->catchtype.any)
172 if (IS_CLASSREF(ex->catchtype))
173 utf_display_printable_ascii_classname(ex->catchtype.ref->name);
175 utf_display_printable_ascii_classname(ex->catchtype.cls->name);
182 if (stage >= SHOW_PARSE && rd) {
183 printf("Local Table:\n");
184 for (i = 0; i < cd->maxlocals; i++) {
187 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
188 for (j = TYPE_INT; j <= TYPE_ADR; j++) {
189 # if defined(ENABLE_INTRP)
192 if (rd->locals[i][j].type >= 0) {
193 printf(" (%s) ", jit_type[j]);
194 if (stage >= SHOW_REGS) {
195 if (rd->locals[i][j].flags & INMEMORY)
196 printf("m%2d", rd->locals[i][j].regoff);
197 # ifdef HAS_ADDRESS_REGISTER_FILE
198 else if (j == TYPE_ADR)
199 printf("r%02d", rd->locals[i][j].regoff);
201 else if ((j == TYPE_FLT) || (j == TYPE_DBL))
202 printf("f%02d", rd->locals[i][j].regoff);
204 # if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
205 if (IS_2_WORD_TYPE(j))
207 regs[GET_LOW_REG(rd->locals[i][j].regoff)],
208 regs[GET_HIGH_REG(rd->locals[i][j].regoff)]);
211 printf("%3s", regs[rd->locals[i][j].regoff]);
215 # if defined(ENABLE_INTRP)
219 #endif /* defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER) */
226 if (stage >= SHOW_STACK && rd) {
227 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
230 #if defined(ENABLE_INTRP)
233 printf("Interface Table:\n");
234 for (i = 0; i < cd->maxstack; i++) {
235 if ((rd->interfaces[i][0].type >= 0) ||
236 (rd->interfaces[i][1].type >= 0) ||
237 (rd->interfaces[i][2].type >= 0) ||
238 (rd->interfaces[i][3].type >= 0) ||
239 (rd->interfaces[i][4].type >= 0)) {
242 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
243 # if defined(ENABLE_INTRP)
246 for (j = TYPE_INT; j <= TYPE_ADR; j++) {
247 if (rd->interfaces[i][j].type >= 0) {
248 printf(" (%s) ", jit_type[j]);
249 if (stage >= SHOW_REGS) {
250 if (rd->interfaces[i][j].flags & SAVEDVAR) {
251 if (rd->interfaces[i][j].flags & INMEMORY)
252 printf("M%2d", rd->interfaces[i][j].regoff);
253 #ifdef HAS_ADDRESS_REGISTER_FILE
254 else if (j == TYPE_ADR)
255 printf("R%02d", rd->interfaces[i][j].regoff);
257 else if ((j == TYPE_FLT) || (j == TYPE_DBL))
258 printf("F%02d", rd->interfaces[i][j].regoff);
260 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
261 if (IS_2_WORD_TYPE(j))
263 regs[GET_LOW_REG(rd->interfaces[i][j].regoff)],
264 regs[GET_HIGH_REG(rd->interfaces[i][j].regoff)]);
267 printf("%3s",regs[rd->interfaces[i][j].regoff]);
271 if (rd->interfaces[i][j].flags & INMEMORY)
272 printf("m%2d", rd->interfaces[i][j].regoff);
273 #ifdef HAS_ADDRESS_REGISTER_FILE
274 else if (j == TYPE_ADR)
275 printf("r%02d", rd->interfaces[i][j].regoff);
277 else if ((j == TYPE_FLT) || (j == TYPE_DBL))
278 printf("f%02d", rd->interfaces[i][j].regoff);
280 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
281 if (IS_2_WORD_TYPE(j))
283 regs[GET_LOW_REG(rd->interfaces[i][j].regoff)],
284 regs[GET_HIGH_REG(rd->interfaces[i][j].regoff)]);
287 printf("%3s",regs[rd->interfaces[i][j].regoff]);
294 # if defined(ENABLE_INTRP)
297 #endif /* defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER) */
303 #if defined(ENABLE_INTRP)
306 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
309 } /* if >= SHOW_STACK */
311 if (code->rplpoints) {
312 printf("Replacement Points:\n");
313 replace_show_replacement_points(code);
317 #if defined(ENABLE_DISASSEMBLER)
318 /* show code before first basic block */
320 if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd)) {
321 u1ptr = (u1 *) ((ptrint) code->mcode + cd->dseglen);
323 for (; u1ptr < (u1 *) ((ptrint) code->mcode + cd->dseglen + jd->new_basicblocks[0].mpc);)
330 /* show code of all basic blocks */
332 for (bptr = jd->new_basicblocks; bptr != NULL; bptr = bptr->next)
333 new_show_basicblock(jd, bptr, stage);
335 #if defined(ENABLE_DISASSEMBLER)
336 /* show stubs code */
338 if (stage >= SHOW_CODE && opt_showdisassemble && opt_showexceptionstubs) {
339 printf("\nStubs code:\n");
340 printf("Length: %d\n\n", (s4) (code->mcodelength -
341 ((ptrint) cd->dseglen + lastbptr->mpc)));
343 u1ptr = (u1 *) ((ptrint) code->mcode + cd->dseglen + lastbptr->mpc);
345 for (; (ptrint) u1ptr < ((ptrint) code->mcode + code->mcodelength);)
352 LOCK_MONITOR_EXIT(show_global_lock);
354 /* finally flush the output */
358 #endif /* !defined(NDEBUG) */
361 /* show_basicblock *************************************************************
363 Print the intermediate representation of a basic block.
365 NOTE: Currently this function may only be called after register allocation!
367 *******************************************************************************/
370 void new_show_basicblock(jitdata *jd, basicblock *bptr, int stage)
380 /* get required compiler data */
386 if (bptr->flags != BBDELETED) {
387 deadcode = bptr->flags <= BBREACHED;
389 printf("======== %sL%03d ======== (flags: %d, bitflags: %01x, next: %d, type: ",
390 (bptr->bitflags & BBFLAG_REPLACEMENT) ? "<REPLACE> " : "",
391 bptr->nr, bptr->flags, bptr->bitflags,
392 (bptr->next) ? (bptr->next->nr) : -1);
394 switch (bptr->type) {
406 printf(", instruction count: %d, predecessors: %d [ ",
407 bptr->icount, bptr->predecessorcount);
409 for (i = 0; i < bptr->predecessorcount; i++)
410 printf("%d ", bptr->predecessors[i]->nr);
414 if (stage >= SHOW_STACK) {
416 new_show_variable_array(jd, bptr->invars, bptr->indepth, stage);
422 for (i = 0; i < bptr->icount; i++, iptr++) {
423 printf("%4d: ", iptr->line);
425 new_show_icmd(jd, iptr, deadcode, stage);
429 if (stage >= SHOW_STACK) {
431 new_show_variable_array(jd, bptr->outvars, bptr->outdepth, stage);
435 #if defined(ENABLE_DISASSEMBLER)
436 if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd) &&
440 u1ptr = (u1 *) (code->mcode + cd->dseglen + bptr->mpc);
442 if (bptr->next != NULL) {
443 for (; u1ptr < (u1 *) (code->mcode + cd->dseglen + bptr->next->mpc);)
448 for (; u1ptr < (u1 *) (code->mcode + code->mcodelength);)
456 #endif /* !defined(NDEBUG) */
459 /* show_icmd *******************************************************************
461 Print the intermediate representation of an instruction.
463 NOTE: Currently this function may only be called after register allocation!
465 *******************************************************************************/
469 #define SHOW_TARGET(target) \
470 if (stage >= SHOW_STACK) { \
471 printf("--> L%03d ", (target).block->nr); \
473 else if (stage >= SHOW_PARSE) { \
474 printf("--> insindex %d (L%03d) ", (target).insindex, \
475 jd->new_basicblocks[jd->new_basicblockindex[ \
476 (target).insindex]].nr); \
479 printf("--> insindex %d ", (target).insindex); \
482 #define SHOW_INT_CONST(val) \
483 if (stage >= SHOW_PARSE) { \
484 printf("%ld ", (long) (val)); \
490 #define SHOW_LNG_CONST(val) \
491 if (stage >= SHOW_PARSE) { \
492 printf("%lld ", (long long)(val)); \
498 #define SHOW_FLT_CONST(val) \
499 if (stage >= SHOW_PARSE) { \
500 printf("%g ", (val)); \
506 #define SHOW_DBL_CONST(val) \
507 if (stage >= SHOW_PARSE) { \
508 printf("%g ", (val)); \
514 #define SHOW_INDEX(index) \
515 if (stage >= SHOW_PARSE) { \
516 printf("%d ", index); \
522 #define SHOW_STRING(val) \
523 if (stage >= SHOW_PARSE) { \
525 utf_display_printable_ascii( \
526 javastring_toutf((java_lang_String *)(val), false)); \
533 #define SHOW_CLASSREF_OR_CLASSINFO(c) \
534 if (stage >= SHOW_PARSE) { \
535 if (IS_CLASSREF(c)) \
536 class_classref_print(c.ref); \
538 class_print(c.cls); \
545 #define SHOW_FIELD(fmiref) \
546 if (stage >= SHOW_PARSE) { \
547 field_fieldref_print(fmiref); \
554 #define SHOW_STACKVAR(sp) \
555 new_show_stackvar(jd, (sp), stage)
557 #define SHOW_S1(iptr) \
558 if (stage >= SHOW_STACK) { \
559 SHOW_STACKVAR(iptr->s1.var); \
562 #define SHOW_S2(iptr) \
563 if (stage >= SHOW_STACK) { \
564 SHOW_STACKVAR(iptr->sx.s23.s2.var); \
567 #define SHOW_S3(iptr) \
568 if (stage >= SHOW_STACK) { \
569 SHOW_STACKVAR(iptr->sx.s23.s3.var); \
572 #define SHOW_DST(iptr) \
573 if (stage >= SHOW_STACK) { \
575 SHOW_STACKVAR(iptr->dst.var); \
578 #define SHOW_S1_LOCAL(iptr) \
579 if (stage >= SHOW_STACK) { \
580 printf("L%d ", iptr->s1.localindex); \
583 #define SHOW_DST_LOCAL(iptr) \
584 if (stage >= SHOW_STACK) { \
585 printf("=> L%d ", iptr->dst.localindex); \
588 static void new_show_stackvar(jitdata *jd, stackptr sp, int stage)
593 case TYPE_INT: type = 'i'; break;
594 case TYPE_LNG: type = 'l'; break;
595 case TYPE_FLT: type = 'f'; break;
596 case TYPE_DBL: type = 'd'; break;
597 case TYPE_ADR: type = 'a'; break;
600 printf("S%c%d", type, (int) (sp - jd->new_stack));
602 if (stage >= SHOW_REGS) {
605 if (sp->flags & SAVEDVAR) {
606 switch (sp->varkind) {
608 if (sp->flags & INMEMORY)
609 printf("M%02d", sp->regoff);
610 #ifdef HAS_ADDRESS_REGISTER_FILE
611 else if (sp->type == TYPE_ADR)
612 printf("R%02d", sp->regoff);
614 else if (IS_FLT_DBL_TYPE(sp->type))
615 printf("F%02d", sp->regoff);
617 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
618 if (IS_2_WORD_TYPE(sp->type)) {
619 # if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
620 # if defined(ENABLE_INTRP)
622 printf("%3d/%3d", GET_LOW_REG(sp->regoff),
623 GET_HIGH_REG(sp->regoff));
626 printf("%3s/%3s", regs[GET_LOW_REG(sp->regoff)],
627 regs[GET_HIGH_REG(sp->regoff)]);
629 printf("%3d/%3d", GET_LOW_REG(sp->regoff),
630 GET_HIGH_REG(sp->regoff));
634 #endif /* defined(SUPPORT_COMBINE_INTEGER_REGISTERS) */
636 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
637 # if defined(ENABLE_INTRP)
639 printf("%3d", sp->regoff);
642 printf("%3s", regs[sp->regoff]);
644 printf("%3d", sp->regoff);
650 printf("I%02d", sp->varnum);
653 printf("L%02d", sp->varnum);
656 if (sp->varnum == -1) {
658 /* varkind ARGVAR "misused for this special case */
661 else /* "normal" Argvar */
662 printf("A%02d", sp->varnum);
665 printf("!xx {kind=%d, num=%d}", sp->varkind, sp->varnum);
668 else { /* not SAVEDVAR */
669 switch (sp->varkind) {
671 if (sp->flags & INMEMORY)
672 printf("m%02d", sp->regoff);
673 #ifdef HAS_ADDRESS_REGISTER_FILE
674 else if (sp->type == TYPE_ADR)
675 printf("r%02d", sp->regoff);
677 else if (IS_FLT_DBL_TYPE(sp->type))
678 printf("f%02d", sp->regoff);
680 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
681 if (IS_2_WORD_TYPE(sp->type)) {
682 # if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
683 # if defined(ENABLE_INTRP)
685 printf("%3d/%3d", GET_LOW_REG(sp->regoff),
686 GET_HIGH_REG(sp->regoff));
689 printf("%3s/%3s", regs[GET_LOW_REG(sp->regoff)],
690 regs[GET_HIGH_REG(sp->regoff)]);
692 printf("%3d/%3d", GET_LOW_REG(sp->regoff),
693 GET_HIGH_REG(sp->regoff));
697 #endif /* defined(SUPPORT_COMBINE_INTEGER_REGISTERS) */
699 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
700 # if defined(ENABLE_INTRP)
702 printf("%3d", sp->regoff);
705 printf("%3s", regs[sp->regoff]);
707 printf("%3d", sp->regoff);
713 printf("i%02d", sp->varnum);
716 printf("l%02d", sp->varnum);
719 if (sp->varnum == -1) {
721 /* varkind ARGVAR "misused for this special case */
724 else /* "normal" Argvar */
725 printf("a%02d", sp->varnum);
728 printf("?xx {kind=%d, num=%d}", sp->varkind, sp->varnum);
737 static void new_show_variable_array(jitdata *jd, stackptr *vars, int n, int stage)
742 for (i=0; i<n; ++i) {
745 new_show_stackvar(jd, vars[i], stage);
750 void new_show_icmd(jitdata *jd, instruction *iptr, bool deadcode, int stage)
753 branch_target_t *table;
754 lookup_target_t *lookup;
755 constant_FMIref *fmiref;
759 /* get the opcode and the condition */
763 printf("%s ", icmd_names[opcode]);
765 if (stage < SHOW_PARSE)
771 /* Print the condition for conditional instructions. */
773 /* XXX print condition from flags */
775 if (iptr->flags.bits & INS_FLAG_UNRESOLVED)
776 printf("(UNRESOLVED) ");
782 case ICMD_CHECKNULL_POP:
787 case ICMD_ARRAYLENGTH:
854 /* binary/const INT */
866 case ICMD_IUSHRCONST:
869 case ICMD_LUSHRCONST:
871 SHOW_INT_CONST(iptr->sx.val.i);
875 /* ?ASTORECONST (trinary/const INT) */
876 case ICMD_IASTORECONST:
877 case ICMD_BASTORECONST:
878 case ICMD_CASTORECONST:
879 case ICMD_SASTORECONST:
882 SHOW_INT_CONST(iptr->sx.s23.s3.constval);
887 SHOW_INT_CONST(iptr->sx.val.i);
891 /* binary/const LNG */
902 SHOW_LNG_CONST(iptr->sx.val.l);
906 /* trinary/const LNG (<= pointer size) */
907 case ICMD_LASTORECONST:
910 SHOW_LNG_CONST(iptr->sx.s23.s3.constval);
915 SHOW_LNG_CONST(iptr->sx.val.l);
921 SHOW_FLT_CONST(iptr->sx.val.f);
927 SHOW_DBL_CONST(iptr->sx.val.d);
933 if (iptr->flags.bits & INS_FLAG_CLASS) {
934 SHOW_CLASSREF_OR_CLASSINFO(iptr->sx.val.c);
936 else if (iptr->sx.val.anyptr == NULL) {
940 SHOW_STRING(iptr->sx.val.stringconst);
945 case ICMD_AASTORECONST:
948 printf("%p ", (void*) iptr->sx.s23.s3.constval);
951 case ICMD_GETFIELD: /* 1 -> 1 */
952 case ICMD_PUTFIELD: /* 2 -> 0 */
953 case ICMD_PUTSTATIC: /* 1 -> 0 */
954 case ICMD_GETSTATIC: /* 0 -> 1 */
955 case ICMD_PUTSTATICCONST: /* 0 -> 0 */
956 case ICMD_PUTFIELDCONST: /* 1 -> 0 */
957 if (opcode != ICMD_GETSTATIC && opcode != ICMD_PUTSTATICCONST) {
959 if (opcode == ICMD_PUTFIELD) {
963 INSTRUCTION_GET_FIELDREF(iptr, fmiref);
966 if (opcode == ICMD_GETSTATIC || opcode == ICMD_GETFIELD) {
973 SHOW_INT_CONST(iptr->sx.val.i);
974 SHOW_DST_LOCAL(iptr);
1004 SHOW_S1_LOCAL(iptr);
1012 SHOW_S1_LOCAL(iptr);
1022 SHOW_DST_LOCAL(iptr);
1033 case ICMD_ANEWARRAY:
1037 case ICMD_MULTIANEWARRAY:
1038 if (stage >= SHOW_STACK) {
1039 argp = iptr->sx.s23.s2.args;
1040 i = iptr->s1.argcount;
1042 SHOW_STACKVAR(*(argp++));
1046 printf("argcount=%d ", iptr->s1.argcount);
1051 case ICMD_CHECKCAST:
1056 case ICMD_INSTANCEOF:
1061 case ICMD_INLINE_START:
1062 case ICMD_INLINE_END:
1066 if (stage >= SHOW_STACK) {
1067 argp = iptr->sx.s23.s2.args;
1068 i = iptr->s1.argcount;
1070 SHOW_STACKVAR(*(argp++));
1073 printf("%s ", iptr->sx.s23.s3.bte->cname);
1074 if (iptr->sx.s23.s3.bte->md->returntype.type != TYPE_VOID) {
1079 case ICMD_INVOKEVIRTUAL:
1080 case ICMD_INVOKESPECIAL:
1081 case ICMD_INVOKESTATIC:
1082 case ICMD_INVOKEINTERFACE:
1083 if (stage >= SHOW_STACK) {
1084 argp = iptr->sx.s23.s2.args;
1085 i = iptr->s1.argcount;
1087 SHOW_STACKVAR(*(argp++));
1090 INSTRUCTION_GET_METHODREF(iptr, fmiref);
1091 method_methodref_print(fmiref);
1092 if (fmiref->parseddesc.md->returntype.type != TYPE_VOID) {
1104 SHOW_TARGET(iptr->dst);
1114 SHOW_TARGET(iptr->dst);
1118 case ICMD_INLINE_GOTO:
1119 SHOW_TARGET(iptr->dst);
1123 SHOW_TARGET(iptr->sx.s23.s3.jsrtarget);
1128 case ICMD_IFNONNULL:
1130 SHOW_TARGET(iptr->dst);
1133 case ICMD_IF_ICMPEQ:
1134 case ICMD_IF_ICMPNE:
1135 case ICMD_IF_ICMPLT:
1136 case ICMD_IF_ICMPGE:
1137 case ICMD_IF_ICMPGT:
1138 case ICMD_IF_ICMPLE:
1140 case ICMD_IF_LCMPEQ:
1141 case ICMD_IF_LCMPNE:
1142 case ICMD_IF_LCMPLT:
1143 case ICMD_IF_LCMPGE:
1144 case ICMD_IF_LCMPGT:
1145 case ICMD_IF_LCMPLE:
1147 case ICMD_IF_FCMPEQ:
1148 case ICMD_IF_FCMPNE:
1150 case ICMD_IF_FCMPL_LT:
1151 case ICMD_IF_FCMPL_GE:
1152 case ICMD_IF_FCMPL_GT:
1153 case ICMD_IF_FCMPL_LE:
1155 case ICMD_IF_FCMPG_LT:
1156 case ICMD_IF_FCMPG_GE:
1157 case ICMD_IF_FCMPG_GT:
1158 case ICMD_IF_FCMPG_LE:
1160 case ICMD_IF_DCMPEQ:
1161 case ICMD_IF_DCMPNE:
1163 case ICMD_IF_DCMPL_LT:
1164 case ICMD_IF_DCMPL_GE:
1165 case ICMD_IF_DCMPL_GT:
1166 case ICMD_IF_DCMPL_LE:
1168 case ICMD_IF_DCMPG_LT:
1169 case ICMD_IF_DCMPG_GE:
1170 case ICMD_IF_DCMPG_GT:
1171 case ICMD_IF_DCMPG_LE:
1173 case ICMD_IF_ACMPEQ:
1174 case ICMD_IF_ACMPNE:
1177 SHOW_TARGET(iptr->dst);
1180 case ICMD_TABLESWITCH:
1182 table = iptr->dst.table;
1184 i = iptr->sx.s23.s3.tablehigh
1185 - iptr->sx.s23.s2.tablelow + 1;
1187 printf("high=%d low=%d count=%d\n", iptr->sx.s23.s3.tablehigh, iptr->sx.s23.s2.tablelow, i);
1189 printf("\t\t%d --> ", table - iptr->dst.table);
1190 if (stage >= SHOW_STACK) {
1191 printf("L%03d\n", table->block->nr);
1194 printf("insindex %d (L%03d)\n", table->insindex, BLOCK_OF(table->insindex)->nr);
1201 case ICMD_LOOKUPSWITCH:
1204 printf("count=%d, default=", iptr->sx.s23.s2.lookupcount);
1205 if (stage >= SHOW_STACK) {
1206 printf("L%03d\n", iptr->sx.s23.s3.lookupdefault.block->nr);
1209 printf("insindex %d (L%03d)\n", iptr->sx.s23.s3.lookupdefault.insindex, BLOCK_OF(iptr->sx.s23.s3.lookupdefault.insindex)->nr);
1212 lookup = iptr->dst.lookup;
1213 i = iptr->sx.s23.s2.lookupcount;
1215 printf("\t\t%d --> ", lookup->value);
1216 if (stage >= SHOW_STACK) {
1217 printf("L%03d\n", lookup->target.block->nr);
1220 printf("insindex %d (L%03d)\n", lookup->target.insindex, BLOCK_OF(lookup->target.insindex)->nr);
1240 if (stage >= SHOW_STACK) {
1241 SHOW_STACKVAR(iptr->dst.dupslots[0]);
1242 SHOW_STACKVAR(iptr->dst.dupslots[1]);
1244 SHOW_STACKVAR(iptr->dst.dupslots[2+0]);
1245 SHOW_STACKVAR(iptr->dst.dupslots[2+1]);
1250 if (stage >= SHOW_STACK) {
1251 SHOW_STACKVAR(iptr->dst.dupslots[0]);
1252 SHOW_STACKVAR(iptr->dst.dupslots[1]);
1254 SHOW_STACKVAR(iptr->dst.dupslots[2+0]);
1255 SHOW_STACKVAR(iptr->dst.dupslots[2+1]);
1256 SHOW_STACKVAR(iptr->dst.dupslots[2+2]);
1261 if (stage >= SHOW_STACK) {
1262 SHOW_STACKVAR(iptr->dst.dupslots[0]);
1263 SHOW_STACKVAR(iptr->dst.dupslots[1]);
1264 SHOW_STACKVAR(iptr->dst.dupslots[2]);
1266 SHOW_STACKVAR(iptr->dst.dupslots[3+0]);
1267 SHOW_STACKVAR(iptr->dst.dupslots[3+1]);
1268 SHOW_STACKVAR(iptr->dst.dupslots[3+2]);
1269 SHOW_STACKVAR(iptr->dst.dupslots[3+3]);
1270 SHOW_STACKVAR(iptr->dst.dupslots[3+4]);
1275 if (stage >= SHOW_STACK) {
1276 SHOW_STACKVAR(iptr->dst.dupslots[0]);
1277 SHOW_STACKVAR(iptr->dst.dupslots[1]);
1278 SHOW_STACKVAR(iptr->dst.dupslots[2]);
1280 SHOW_STACKVAR(iptr->dst.dupslots[3+0]);
1281 SHOW_STACKVAR(iptr->dst.dupslots[3+1]);
1282 SHOW_STACKVAR(iptr->dst.dupslots[3+2]);
1283 SHOW_STACKVAR(iptr->dst.dupslots[3+3]);
1288 if (stage >= SHOW_STACK) {
1289 SHOW_STACKVAR(iptr->dst.dupslots[0]);
1290 SHOW_STACKVAR(iptr->dst.dupslots[1]);
1291 SHOW_STACKVAR(iptr->dst.dupslots[2]);
1292 SHOW_STACKVAR(iptr->dst.dupslots[4]);
1294 SHOW_STACKVAR(iptr->dst.dupslots[4+0]);
1295 SHOW_STACKVAR(iptr->dst.dupslots[4+1]);
1296 SHOW_STACKVAR(iptr->dst.dupslots[4+2]);
1297 SHOW_STACKVAR(iptr->dst.dupslots[4+3]);
1298 SHOW_STACKVAR(iptr->dst.dupslots[4+4]);
1299 SHOW_STACKVAR(iptr->dst.dupslots[4+5]);
1304 if (stage >= SHOW_STACK) {
1305 SHOW_STACKVAR(iptr->dst.dupslots[0]);
1306 SHOW_STACKVAR(iptr->dst.dupslots[1]);
1308 SHOW_STACKVAR(iptr->dst.dupslots[2+0]);
1309 SHOW_STACKVAR(iptr->dst.dupslots[2+1]);
1315 #endif /* !defined(NDEBUG) */
1319 * These are local overrides for various environment variables in Emacs.
1320 * Please do not remove this and leave it at the end of the file, where
1321 * Emacs will automagically detect them.
1322 * ---------------------------------------------------------------------
1325 * indent-tabs-mode: t
1329 * vim:noexpandtab:sw=4:ts=4: