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"
59 #include "vm/jit/parse.h"
62 /* global variables ***********************************************************/
64 #if defined(ENABLE_THREADS) && !defined(NDEBUG)
65 static java_objectheader *show_global_lock;
69 /* prototypes *****************************************************************/
72 static void show_variable_intern(jitdata *jd, s4 index, int stage);
76 /* show_init *******************************************************************
78 Initialized the show subsystem (called by jit_init).
80 *******************************************************************************/
85 #if defined(ENABLE_THREADS)
86 /* initialize the show lock */
88 show_global_lock = NEW(java_objectheader);
90 lock_init_object_lock(show_global_lock);
101 char *show_jit_type_names[] = {
112 char show_jit_type_letters[] = {
126 /* show_method *****************************************************************
128 Print the intermediate representation of a method.
130 NOTE: Currently this function may only be called after register allocation!
132 *******************************************************************************/
135 void show_method(jitdata *jd, int stage)
142 basicblock *lastbptr;
146 #if defined(ENABLE_DISASSEMBLER)
150 /* get required compiler data */
157 /* We need to enter a lock here, since the binutils disassembler
158 is not reentrant-able and we could not read functions printed
161 LOCK_MONITOR_ENTER(show_global_lock);
163 #if defined(ENABLE_INTRP)
165 irstage = SHOW_PARSE;
170 /* get the last basic block */
172 for (lastbptr = jd->basicblocks; lastbptr->next != NULL; lastbptr = lastbptr->next);
178 if (jd->isleafmethod)
179 printf("LEAFMETHOD\n");
181 printf("\nBasic blocks: %d\n", jd->basicblockcount);
182 if (stage >= SHOW_CODE) {
183 printf("Code length: %d\n", (lastbptr->mpc - jd->basicblocks[0].mpc));
184 printf("Data length: %d\n", cd->dseglen);
185 printf("Stub length: %d\n", (s4) (code->mcodelength -
186 ((ptrint) cd->dseglen + lastbptr->mpc)));
188 printf("Variables: %d (%d used)\n", jd->varcount, jd->vartop);
189 if (stage >= SHOW_STACK)
190 printf("Max interfaces: %d\n", jd->maxinterfaces);
191 printf("Max locals: %d\n", jd->maxlocals);
192 printf("Max stack: %d\n", m->maxstack);
193 printf("Linenumbers: %d\n", m->linenumbercount);
194 printf("Branch to entry: %s\n", (jd->branchtoentry) ? "yes" : "no");
195 printf("Branch to end: %s\n", (jd->branchtoend) ? "yes" : "no");
196 if (stage >= SHOW_STACK) {
197 printf("Number of RETURNs: %d", jd->returncount);
198 if (jd->returncount == 1)
199 printf(" (block L%03d)", jd->returnblock->nr);
203 if (stage >= SHOW_PARSE) {
204 printf("Exceptions (Number: %d):\n", jd->exceptiontablelength);
205 for (ex = jd->exceptiontable; ex != NULL; ex = ex->down) {
206 printf(" L%03d ... ", ex->start->nr );
207 printf("L%03d = ", ex->end->nr);
208 printf("L%03d", ex->handler->nr);
209 printf(" (catchtype: ");
210 if (ex->catchtype.any)
211 if (IS_CLASSREF(ex->catchtype))
212 class_classref_print(ex->catchtype.ref);
214 class_print(ex->catchtype.cls);
221 if (irstage >= SHOW_PARSE && rd && jd->localcount > 0) {
222 printf("Local Table:\n");
223 for (i = 0; i < jd->localcount; i++) {
226 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
227 # if defined(ENABLE_INTRP)
230 printf(" (%s) ", show_jit_type_names[VAR(i)->type]);
231 if (irstage >= SHOW_REGS)
232 show_allocation(VAR(i)->type, VAR(i)->flags, VAR(i)->vv.regoff);
234 # if defined(ENABLE_INTRP)
237 #endif /* defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER) */
242 if (jd->maxlocals > 0 && jd->local_map != NULL) {
243 printf("Local Map:\n");
245 for (j = 0; j < jd->maxlocals; j++) {
249 for (i = 0; i < 5; i++) {
250 printf(" %5s ",show_jit_type_names[i]);
251 for (j = 0; j < jd->maxlocals; j++) {
252 if (jd->local_map[j*5+i] == UNUSED)
255 printf("%4i ",jd->local_map[j*5+i]);
262 if (jd->maxinterfaces > 0 && jd->interface_map && irstage >= SHOW_STACK) {
264 interface_info *mapptr = jd->interface_map;
266 /* look if there exist any INOUTS */
267 for (i = 0; (i < (5 * jd->maxinterfaces)) && !exist; i++, mapptr++)
268 exist = (mapptr->flags != UNUSED);
271 printf("Interface Table: (In/Outvars)\n");
273 for (j = 0; j < jd->maxinterfaces; j++) {
278 for (i = 0; i < 5; i++) {
279 printf(" %5s ",show_jit_type_names[i]);
280 for (j = 0; j < jd->maxinterfaces; j++) {
281 s4 flags = jd->interface_map[j*5+i].flags;
282 s4 regoff = jd->interface_map[j*5+i].regoff;
288 if (irstage >= SHOW_REGS) {
289 if (flags & SAVEDVAR) {
290 if (flags & INMEMORY)
296 if (flags & INMEMORY)
301 printf("%c%03d(", ch, regoff);
302 show_allocation(i, flags, regoff);
306 if (flags & SAVEDVAR)
319 if (rd->memuse && irstage >= SHOW_REGS) {
323 printf("Stack slots: (memuse=%d", rd->memuse);
324 if (irstage >= SHOW_CODE) {
325 printf(", stackframesize=%d", cd->stackframesize);
326 max = cd->stackframesize;
329 for (i = 0; i < max; ++i) {
330 #if defined(HAS_4BYTE_STACKSLOT)
331 printf(" M%02d = 0x%02x(sp): ", i, i * 4);
333 printf(" M%02d = 0x%02x(sp): ", i, i * 8);
335 for (j = 0; j < jd->vartop; ++j) {
337 if ((v->flags & INMEMORY) && (v->vv.regoff == i)) {
338 show_variable(jd, j, irstage);
349 if (code->rplpoints) {
350 printf("Replacement Points:\n");
351 replace_show_replacement_points(code);
355 #if defined(ENABLE_DISASSEMBLER)
356 /* show code before first basic block */
358 if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd)) {
359 u1ptr = (u1 *) ((ptrint) code->mcode + cd->dseglen);
361 for (; u1ptr < (u1 *) ((ptrint) code->mcode + cd->dseglen + jd->basicblocks[0].mpc);)
368 /* show code of all basic blocks */
370 for (bptr = jd->basicblocks; bptr != NULL; bptr = bptr->next)
371 show_basicblock(jd, bptr, stage);
373 #if defined(ENABLE_DISASSEMBLER)
374 /* show stubs code */
376 if (stage >= SHOW_CODE && opt_showdisassemble && opt_showexceptionstubs) {
377 printf("\nStubs code:\n");
378 printf("Length: %d\n\n", (s4) (code->mcodelength -
379 ((ptrint) cd->dseglen + lastbptr->mpc)));
381 u1ptr = (u1 *) ((ptrint) code->mcode + cd->dseglen + lastbptr->mpc);
383 for (; (ptrint) u1ptr < ((ptrint) code->mcode + code->mcodelength);)
390 LOCK_MONITOR_EXIT(show_global_lock);
392 /* finally flush the output */
396 #endif /* !defined(NDEBUG) */
399 #if !defined(NDEBUG) && defined(ENABLE_INLINING)
400 static void show_inline_info(jitdata *jd, insinfo_inline *ii, s4 opcode, s4 stage)
405 printf("(pt %d+%d st ", ii->throughcount - ii->stackvarscount,
407 show_variable_array(jd, ii->stackvars, ii->stackvarscount, stage);
409 if (opcode == ICMD_INLINE_START || opcode == ICMD_INLINE_END) {
411 jl = (opcode == ICMD_INLINE_START) ? ii->javalocals_start : ii->javalocals_end;
412 n = (opcode == ICMD_INLINE_START) ? ii->method->maxlocals : ii->outer->maxlocals;
413 show_variable_array(jd, jl, n, stage);
420 method_print(ii->outer);
424 method_print(ii->method);
426 #endif /* !defined(NDEBUG) && defined(ENABLE_INLINING) */
429 /* show_basicblock *************************************************************
431 Print the intermediate representation of a basic block.
433 NOTE: Currently this function may only be called after register allocation!
435 *******************************************************************************/
438 void show_basicblock(jitdata *jd, basicblock *bptr, int stage)
446 #if defined(ENABLE_DISASSEMBLER)
450 /* get required compiler data */
455 if (bptr->flags != BBDELETED) {
456 #if defined(ENABLE_INTRP)
459 irstage = SHOW_PARSE;
464 deadcode = (bptr->flags < BBREACHED);
468 printf("======== %sL%03d ======== %s(flags: %d, bitflags: %01x, next: %d, type: ",
469 (bptr->bitflags & BBFLAG_REPLACEMENT) ? "<REPLACE> " : "",
471 (deadcode && stage >= SHOW_STACK) ? "DEADCODE! " : "",
472 bptr->flags, bptr->bitflags,
473 (bptr->next) ? (bptr->next->nr) : -1);
475 switch (bptr->type) {
487 printf(", icount: %d", bptr->icount);
489 if (irstage >= SHOW_CFG) {
490 printf(", preds: %d [ ", bptr->predecessorcount);
492 for (i = 0; i < bptr->predecessorcount; i++)
493 printf("%d ", bptr->predecessors[i]->nr);
501 printf(" (clone of L%03d)", bptr->original->nr);
503 basicblock *b = bptr->copied_to;
505 printf(" (copied to ");
506 for (; b; b = b->copied_to)
507 printf("L%03d ", b->nr);
514 if (irstage >= SHOW_STACK) {
516 show_variable_array(jd, bptr->invars, bptr->indepth, irstage);
517 printf(" javalocals: ");
518 show_variable_array(jd, bptr->javalocals, bptr->method->maxlocals, irstage);
522 #if defined(ENABLE_INLINING)
523 if (bptr->inlineinfo) {
524 printf("inlineinfo: ");
525 show_inline_info(jd, bptr->inlineinfo, -1, irstage);
528 #endif /* defined(ENABLE_INLINING) */
532 for (i = 0; i < bptr->icount; i++, iptr++) {
533 printf("%4d:%4d: ", iptr->line, iptr->flags.bits >> INS_FLAG_ID_SHIFT);
535 show_icmd(jd, iptr, deadcode, irstage);
539 if (irstage >= SHOW_STACK) {
541 show_variable_array(jd, bptr->outvars, bptr->outdepth, irstage);
545 #if defined(ENABLE_DISASSEMBLER)
546 if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd) &&
550 u1ptr = (u1 *) (code->mcode + cd->dseglen + bptr->mpc);
552 if (bptr->next != NULL) {
553 for (; u1ptr < (u1 *) (code->mcode + cd->dseglen + bptr->next->mpc);)
558 for (; u1ptr < (u1 *) (code->mcode + code->mcodelength);)
566 #endif /* !defined(NDEBUG) */
569 /* show_icmd *******************************************************************
571 Print the intermediate representation of an instruction.
573 NOTE: Currently this function may only be called after register allocation!
575 *******************************************************************************/
579 #define SHOW_TARGET(target) \
580 if (stage >= SHOW_STACK) { \
581 printf("--> L%03d ", (target).block->nr); \
583 else if (stage >= SHOW_PARSE) { \
584 printf("--> insindex %d (L%03d) ", (target).insindex, \
585 jd->basicblocks[jd->basicblockindex[ \
586 (target).insindex]].nr); \
589 printf("--> insindex %d ", (target).insindex); \
592 #define SHOW_INT_CONST(val) \
593 if (stage >= SHOW_PARSE) { \
594 printf("%d (0x%08x) ", (val), (val)); \
600 #if SIZEOF_VOID_P == 4
601 #define SHOW_LNG_CONST(val) \
602 if (stage >= SHOW_PARSE) \
603 printf("%lld (0x%016llx) ", (val), (val)); \
607 #define SHOW_LNG_CONST(val) \
608 if (stage >= SHOW_PARSE) \
609 printf("%ld (0x%016lx) ", (val), (val)); \
614 #if SIZEOF_VOID_P == 4
615 #define SHOW_ADR_CONST(val) \
616 if (stage >= SHOW_PARSE) \
617 printf("0x%08x ", (ptrint) (val)); \
621 #define SHOW_ADR_CONST(val) \
622 if (stage >= SHOW_PARSE) \
623 printf("0x%016lx ", (ptrint) (val)); \
628 #define SHOW_FLT_CONST(val) \
629 if (stage >= SHOW_PARSE) { \
632 printf("%g (0x%08x) ", (val), v.i); \
638 #if SIZEOF_VOID_P == 4
639 #define SHOW_DBL_CONST(val) \
640 if (stage >= SHOW_PARSE) { \
643 printf("%g (0x%016llx) ", (val), v.l); \
648 #define SHOW_DBL_CONST(val) \
649 if (stage >= SHOW_PARSE) { \
652 printf("%g (0x%016lx) ", (val), v.l); \
658 #define SHOW_INDEX(index) \
659 if (stage >= SHOW_PARSE) { \
660 printf("%d ", index); \
666 #define SHOW_STRING(val) \
667 if (stage >= SHOW_PARSE) { \
669 utf_display_printable_ascii( \
670 javastring_toutf((java_lang_String *)(val), false)); \
677 #define SHOW_CLASSREF_OR_CLASSINFO(c) \
678 if (stage >= SHOW_PARSE) { \
679 if (IS_CLASSREF(c)) \
680 class_classref_print(c.ref); \
682 class_print(c.cls); \
689 #define SHOW_FIELD(fmiref) \
690 if (stage >= SHOW_PARSE) { \
691 field_fieldref_print(fmiref); \
698 #define SHOW_VARIABLE(v) \
699 show_variable(jd, (v), stage)
701 #define SHOW_S1(iptr) \
702 if (stage >= SHOW_STACK) { \
703 SHOW_VARIABLE(iptr->s1.varindex); \
706 #define SHOW_S2(iptr) \
707 if (stage >= SHOW_STACK) { \
708 SHOW_VARIABLE(iptr->sx.s23.s2.varindex); \
711 #define SHOW_S3(iptr) \
712 if (stage >= SHOW_STACK) { \
713 SHOW_VARIABLE(iptr->sx.s23.s3.varindex); \
716 #define SHOW_DST(iptr) \
717 if (stage >= SHOW_STACK) { \
719 SHOW_VARIABLE(iptr->dst.varindex); \
722 #define SHOW_S1_LOCAL(iptr) \
723 if (stage >= SHOW_STACK) { \
724 printf("L%d ", iptr->s1.varindex); \
727 printf("JavaL%d ", iptr->s1.varindex); \
730 #define SHOW_DST_LOCAL(iptr) \
731 if (stage >= SHOW_STACK) { \
732 printf("=> L%d ", iptr->dst.varindex); \
735 printf("=> JavaL%d ", iptr->dst.varindex); \
738 void show_allocation(s4 type, s4 flags, s4 regoff)
740 if (flags & INMEMORY) {
741 printf("M%02d", regoff);
745 #ifdef HAS_ADDRESS_REGISTER_FILE
746 if (type == TYPE_ADR) {
747 printf("R%02d", regoff);
752 if (IS_FLT_DBL_TYPE(type)) {
753 printf("F%02d", regoff);
757 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
758 if (IS_2_WORD_TYPE(type)) {
759 # if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
760 # if defined(ENABLE_INTRP)
762 printf("%3d/%3d", GET_LOW_REG(regoff),
763 GET_HIGH_REG(regoff));
766 printf("%3s/%3s", regs[GET_LOW_REG(regoff)],
767 regs[GET_HIGH_REG(regoff)]);
769 printf("%3d/%3d", GET_LOW_REG(regoff),
770 GET_HIGH_REG(regoff));
774 #endif /* defined(SUPPORT_COMBINE_INTEGER_REGISTERS) */
776 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
777 # if defined(ENABLE_INTRP)
779 printf("%3d", regoff);
782 printf("%3s", regs[regoff]);
784 printf("%3d", regoff);
788 void show_variable(jitdata *jd, s4 index, int stage)
790 show_variable_intern(jd, index, stage);
794 static void show_variable_intern(jitdata *jd, s4 index, int stage)
800 if (index < 0 || index >= jd->vartop) {
801 printf("<INVALID INDEX:%d>", index);
808 case TYPE_INT: type = 'i'; break;
809 case TYPE_LNG: type = 'l'; break;
810 case TYPE_FLT: type = 'f'; break;
811 case TYPE_DBL: type = 'd'; break;
812 case TYPE_ADR: type = 'a'; break;
813 case TYPE_RET: type = 'r'; break;
817 if (index < jd->localcount) {
819 if (v->flags & (PREALLOC | INOUT))
820 printf("<INVALID FLAGS!>");
823 if (v->flags & PREALLOC) {
825 if (v->flags & INOUT)
826 printf("<INVALID FLAGS!>");
828 else if (v->flags & INOUT)
834 printf("%c%c%d", kind, type, index);
836 if (v->flags & SAVEDVAR)
839 if (stage >= SHOW_REGS || (v->flags & PREALLOC)) {
841 show_allocation(v->type, v->flags, v->vv.regoff);
846 void show_variable_array(jitdata *jd, s4 *vars, int n, int stage)
856 for (i=0; i<n; ++i) {
859 if (vars[i] == UNUSED)
862 show_variable_intern(jd, vars[i], stage);
867 void show_icmd(jitdata *jd, instruction *iptr, bool deadcode, int stage)
870 branch_target_t *table;
871 lookup_target_t *lookup;
872 constant_FMIref *fmiref;
876 /* get the opcode and the condition */
880 printf("%s ", icmd_table[opcode].name);
882 if (stage < SHOW_PARSE)
888 /* Print the condition for conditional instructions. */
890 /* XXX print condition from flags */
892 if (iptr->flags.bits & INS_FLAG_UNRESOLVED)
893 printf("(UNRESOLVED) ");
899 case ICMD_CHECKNULL_POP:
904 case ICMD_ARRAYLENGTH:
971 /* binary/const INT */
983 case ICMD_IUSHRCONST:
986 case ICMD_LUSHRCONST:
988 SHOW_INT_CONST(iptr->sx.val.i);
992 /* ?ASTORECONST (trinary/const INT) */
993 case ICMD_IASTORECONST:
994 case ICMD_BASTORECONST:
995 case ICMD_CASTORECONST:
996 case ICMD_SASTORECONST:
999 SHOW_INT_CONST(iptr->sx.s23.s3.constval);
1004 SHOW_INT_CONST(iptr->sx.val.i);
1008 /* binary/const LNG */
1009 case ICMD_LADDCONST:
1010 case ICMD_LSUBCONST:
1011 case ICMD_LMULCONST:
1015 case ICMD_LANDCONST:
1017 case ICMD_LXORCONST:
1019 SHOW_LNG_CONST(iptr->sx.val.l);
1023 /* trinary/const LNG (<= pointer size) */
1024 case ICMD_LASTORECONST:
1027 SHOW_ADR_CONST(iptr->sx.s23.s3.constval);
1032 SHOW_LNG_CONST(iptr->sx.val.l);
1038 SHOW_FLT_CONST(iptr->sx.val.f);
1044 SHOW_DBL_CONST(iptr->sx.val.d);
1050 if (iptr->flags.bits & INS_FLAG_CLASS) {
1051 SHOW_ADR_CONST(iptr->sx.val.anyptr);
1052 SHOW_CLASSREF_OR_CLASSINFO(iptr->sx.val.c);
1054 else if (iptr->sx.val.anyptr == NULL) {
1058 SHOW_ADR_CONST(iptr->sx.val.anyptr);
1059 SHOW_STRING(iptr->sx.val.stringconst);
1064 case ICMD_AASTORECONST:
1067 printf("%p ", (void*) iptr->sx.s23.s3.constval);
1070 case ICMD_GETFIELD: /* 1 -> 1 */
1071 case ICMD_PUTFIELD: /* 2 -> 0 */
1072 case ICMD_PUTSTATIC: /* 1 -> 0 */
1073 case ICMD_GETSTATIC: /* 0 -> 1 */
1074 case ICMD_PUTSTATICCONST: /* 0 -> 0 */
1075 case ICMD_PUTFIELDCONST: /* 1 -> 0 */
1076 if (opcode != ICMD_GETSTATIC && opcode != ICMD_PUTSTATICCONST) {
1078 if (opcode == ICMD_PUTFIELD) {
1082 INSTRUCTION_GET_FIELDREF(iptr, fmiref);
1085 if (opcode == ICMD_GETSTATIC || opcode == ICMD_GETFIELD) {
1091 SHOW_S1_LOCAL(iptr);
1092 SHOW_INT_CONST(iptr->sx.val.i);
1093 SHOW_DST_LOCAL(iptr);
1123 SHOW_S1_LOCAL(iptr);
1124 if (stage >= SHOW_STACK) {
1125 printf(" ---> L%03d", iptr->dst.block->nr);
1134 SHOW_S1_LOCAL(iptr);
1144 SHOW_DST_LOCAL(iptr);
1145 if (stage >= SHOW_STACK && iptr->sx.s23.s3.javaindex != UNUSED)
1146 printf(" (javaindex %d)", iptr->sx.s23.s3.javaindex);
1157 case ICMD_ANEWARRAY:
1161 case ICMD_MULTIANEWARRAY:
1162 if (stage >= SHOW_STACK) {
1163 argp = iptr->sx.s23.s2.args;
1164 i = iptr->s1.argcount;
1166 SHOW_VARIABLE(*(argp++));
1170 printf("argcount=%d ", iptr->s1.argcount);
1175 case ICMD_CHECKCAST:
1178 class_classref_or_classinfo_print(iptr->sx.s23.s3.c);
1182 case ICMD_INSTANCEOF:
1187 case ICMD_INLINE_START:
1188 case ICMD_INLINE_END:
1189 #if defined(ENABLE_INLINING)
1191 insinfo_inline *ii = iptr->sx.s23.s3.inlineinfo;
1192 show_inline_info(jd, ii, opcode, stage);
1198 if (stage >= SHOW_STACK) {
1199 argp = iptr->sx.s23.s2.args;
1200 i = iptr->s1.argcount;
1202 if ((iptr->s1.argcount - 1 - i) == iptr->sx.s23.s3.bte->md->paramcount)
1203 printf(" pass-through: ");
1204 SHOW_VARIABLE(*(argp++));
1207 printf("%s ", iptr->sx.s23.s3.bte->cname);
1208 if (iptr->sx.s23.s3.bte->md->returntype.type != TYPE_VOID) {
1213 case ICMD_INVOKEVIRTUAL:
1214 case ICMD_INVOKESPECIAL:
1215 case ICMD_INVOKESTATIC:
1216 case ICMD_INVOKEINTERFACE:
1217 if (stage >= SHOW_STACK) {
1219 INSTRUCTION_GET_METHODDESC(iptr, md);
1220 argp = iptr->sx.s23.s2.args;
1221 i = iptr->s1.argcount;
1223 if ((iptr->s1.argcount - 1 - i) == md->paramcount)
1224 printf(" pass-through: ");
1225 SHOW_VARIABLE(*(argp++));
1228 INSTRUCTION_GET_METHODREF(iptr, fmiref);
1229 method_methodref_print(fmiref);
1230 if (fmiref->parseddesc.md->returntype.type != TYPE_VOID) {
1243 SHOW_INT_CONST(iptr->sx.val.i);
1244 SHOW_TARGET(iptr->dst);
1254 SHOW_LNG_CONST(iptr->sx.val.l);
1255 SHOW_TARGET(iptr->dst);
1259 case ICMD_INLINE_GOTO:
1260 SHOW_TARGET(iptr->dst);
1264 SHOW_TARGET(iptr->sx.s23.s3.jsrtarget);
1269 case ICMD_IFNONNULL:
1271 SHOW_TARGET(iptr->dst);
1274 case ICMD_IF_ICMPEQ:
1275 case ICMD_IF_ICMPNE:
1276 case ICMD_IF_ICMPLT:
1277 case ICMD_IF_ICMPGE:
1278 case ICMD_IF_ICMPGT:
1279 case ICMD_IF_ICMPLE:
1281 case ICMD_IF_LCMPEQ:
1282 case ICMD_IF_LCMPNE:
1283 case ICMD_IF_LCMPLT:
1284 case ICMD_IF_LCMPGE:
1285 case ICMD_IF_LCMPGT:
1286 case ICMD_IF_LCMPLE:
1288 case ICMD_IF_FCMPEQ:
1289 case ICMD_IF_FCMPNE:
1291 case ICMD_IF_FCMPL_LT:
1292 case ICMD_IF_FCMPL_GE:
1293 case ICMD_IF_FCMPL_GT:
1294 case ICMD_IF_FCMPL_LE:
1296 case ICMD_IF_FCMPG_LT:
1297 case ICMD_IF_FCMPG_GE:
1298 case ICMD_IF_FCMPG_GT:
1299 case ICMD_IF_FCMPG_LE:
1301 case ICMD_IF_DCMPEQ:
1302 case ICMD_IF_DCMPNE:
1304 case ICMD_IF_DCMPL_LT:
1305 case ICMD_IF_DCMPL_GE:
1306 case ICMD_IF_DCMPL_GT:
1307 case ICMD_IF_DCMPL_LE:
1309 case ICMD_IF_DCMPG_LT:
1310 case ICMD_IF_DCMPG_GE:
1311 case ICMD_IF_DCMPG_GT:
1312 case ICMD_IF_DCMPG_LE:
1314 case ICMD_IF_ACMPEQ:
1315 case ICMD_IF_ACMPNE:
1318 SHOW_TARGET(iptr->dst);
1321 case ICMD_TABLESWITCH:
1323 table = iptr->dst.table;
1325 i = iptr->sx.s23.s3.tablehigh - iptr->sx.s23.s2.tablelow + 1;
1327 printf("high=%d low=%d count=%d\n", iptr->sx.s23.s3.tablehigh, iptr->sx.s23.s2.tablelow, i);
1329 printf("\t\t%d --> ", (int) (table - iptr->dst.table));
1330 if (stage >= SHOW_STACK) {
1331 printf("L%03d\n", table->block->nr);
1334 printf("insindex %d (L%03d)\n", table->insindex, BLOCK_OF(table->insindex)->nr);
1341 case ICMD_LOOKUPSWITCH:
1344 printf("count=%d, default=", iptr->sx.s23.s2.lookupcount);
1345 if (stage >= SHOW_STACK) {
1346 printf("L%03d\n", iptr->sx.s23.s3.lookupdefault.block->nr);
1349 printf("insindex %d (L%03d)\n", iptr->sx.s23.s3.lookupdefault.insindex, BLOCK_OF(iptr->sx.s23.s3.lookupdefault.insindex)->nr);
1352 lookup = iptr->dst.lookup;
1353 i = iptr->sx.s23.s2.lookupcount;
1355 printf("\t\t%d --> ", lookup->value);
1356 if (stage >= SHOW_STACK) {
1357 printf("L%03d\n", lookup->target.block->nr);
1360 printf("insindex %d (L%03d)\n", lookup->target.insindex, BLOCK_OF(lookup->target.insindex)->nr);
1376 if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
1377 /* XXX this needs more work */
1379 unresolved_class_debug_dump(iptr->sx.s23.s2.uc, stdout);
1392 #endif /* !defined(NDEBUG) */
1396 * These are local overrides for various environment variables in Emacs.
1397 * Please do not remove this and leave it at the end of the file, where
1398 * Emacs will automagically detect them.
1399 * ---------------------------------------------------------------------
1402 * indent-tabs-mode: t
1406 * vim:noexpandtab:sw=4:ts=4: