1 /* src/vm/jit/show.c - showing the intermediate representation
3 Copyright (C) 1996-2005, 2006, 2007 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
36 #include "mm/memory.h"
38 #include "threads/lock-common.h"
40 #include "vm/global.h"
41 #include "vm/builtin.h"
42 #include "vm/stringlocal.h"
44 #include "vm/jit/abi.h"
45 #include "vm/jit/jit.h"
46 #include "vm/jit/show.h"
47 #include "vm/jit/disass.h"
48 #include "vm/jit/stack.h"
49 #include "vm/jit/parse.h"
51 #include "vmcore/options.h"
54 /* global variables ***********************************************************/
56 #if defined(ENABLE_THREADS) && !defined(NDEBUG)
57 static java_objectheader *show_global_lock;
61 /* prototypes *****************************************************************/
64 static void show_variable_intern(jitdata *jd, s4 index, int stage);
68 /* show_init *******************************************************************
70 Initialized the show subsystem (called by jit_init).
72 *******************************************************************************/
77 #if defined(ENABLE_THREADS)
78 /* initialize the show lock */
80 show_global_lock = NEW(java_objectheader);
82 LOCK_INIT_OBJECT_LOCK(show_global_lock);
93 char *show_jit_type_names[] = {
104 char show_jit_type_letters[] = {
118 /* show_method *****************************************************************
120 Print the intermediate representation of a method.
122 NOTE: Currently this function may only be called after register allocation!
124 *******************************************************************************/
127 void show_method(jitdata *jd, int stage)
134 basicblock *lastbptr;
138 #if defined(ENABLE_DISASSEMBLER)
142 /* get required compiler data */
149 /* We need to enter a lock here, since the binutils disassembler
150 is not reentrant-able and we could not read functions printed
153 LOCK_MONITOR_ENTER(show_global_lock);
155 #if defined(ENABLE_INTRP)
157 irstage = SHOW_PARSE;
162 /* get the last basic block */
164 for (lastbptr = jd->basicblocks; lastbptr->next != NULL; lastbptr = lastbptr->next);
170 if (jd->isleafmethod)
171 printf("LEAFMETHOD\n");
173 printf("\nBasic blocks: %d\n", jd->basicblockcount);
174 if (stage >= SHOW_CODE) {
175 printf("Code length: %d\n", (lastbptr->mpc - jd->basicblocks[0].mpc));
176 printf("Data length: %d\n", cd->dseglen);
177 printf("Stub length: %d\n", (s4) (code->mcodelength -
178 ((ptrint) cd->dseglen + lastbptr->mpc)));
180 printf("Variables: %d (%d used)\n", jd->varcount, jd->vartop);
181 if (stage >= SHOW_STACK)
182 printf("Max interfaces: %d\n", jd->maxinterfaces);
183 printf("Max locals: %d\n", jd->maxlocals);
184 printf("Max stack: %d\n", m->maxstack);
185 printf("Linenumbers: %d\n", m->linenumbercount);
186 printf("Branch to entry: %s\n", (jd->branchtoentry) ? "yes" : "no");
187 printf("Branch to end: %s\n", (jd->branchtoend) ? "yes" : "no");
188 if (stage >= SHOW_STACK) {
189 printf("Number of RETURNs: %d", jd->returncount);
190 if (jd->returncount == 1)
191 printf(" (block L%03d)", jd->returnblock->nr);
195 if (stage >= SHOW_PARSE) {
196 printf("Exceptions (Number: %d):\n", jd->exceptiontablelength);
197 for (ex = jd->exceptiontable; ex != NULL; ex = ex->down) {
198 printf(" L%03d ... ", ex->start->nr );
199 printf("L%03d = ", ex->end->nr);
200 printf("L%03d", ex->handler->nr);
201 printf(" (catchtype: ");
202 if (ex->catchtype.any)
203 if (IS_CLASSREF(ex->catchtype))
204 class_classref_print(ex->catchtype.ref);
206 class_print(ex->catchtype.cls);
213 if (irstage >= SHOW_PARSE && rd && jd->localcount > 0) {
214 printf("Local Table:\n");
215 for (i = 0; i < jd->localcount; i++) {
218 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
219 # if defined(ENABLE_INTRP)
222 printf(" (%s) ", show_jit_type_names[VAR(i)->type]);
223 if (irstage >= SHOW_REGS)
224 show_allocation(VAR(i)->type, VAR(i)->flags, VAR(i)->vv.regoff);
226 # if defined(ENABLE_INTRP)
229 #endif /* defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER) */
234 if (jd->maxlocals > 0 && jd->local_map != NULL) {
235 printf("Local Map:\n");
237 for (j = 0; j < jd->maxlocals; j++) {
241 for (i = 0; i < 5; i++) {
242 printf(" %5s ",show_jit_type_names[i]);
243 for (j = 0; j < jd->maxlocals; j++) {
244 if (jd->local_map[j*5+i] == UNUSED)
247 printf("%4i ",jd->local_map[j*5+i]);
254 if (jd->maxinterfaces > 0 && jd->interface_map && irstage >= SHOW_STACK) {
256 interface_info *mapptr = jd->interface_map;
258 /* look if there exist any INOUTS */
259 for (i = 0; (i < (5 * jd->maxinterfaces)) && !exist; i++, mapptr++)
260 exist = (mapptr->flags != UNUSED);
263 printf("Interface Table: (In/Outvars)\n");
265 for (j = 0; j < jd->maxinterfaces; j++) {
270 for (i = 0; i < 5; i++) {
271 printf(" %5s ",show_jit_type_names[i]);
272 for (j = 0; j < jd->maxinterfaces; j++) {
273 s4 flags = jd->interface_map[j*5+i].flags;
274 s4 regoff = jd->interface_map[j*5+i].regoff;
280 if (irstage >= SHOW_REGS) {
281 if (flags & SAVEDVAR) {
282 if (flags & INMEMORY)
288 if (flags & INMEMORY)
293 printf("%c%03d(", ch, regoff);
294 show_allocation(i, flags, regoff);
298 if (flags & SAVEDVAR)
311 if (rd->memuse && irstage >= SHOW_REGS) {
315 printf("Stack slots: (memuse=%d", rd->memuse);
316 if (irstage >= SHOW_CODE) {
317 printf(", stackframesize=%d", cd->stackframesize);
318 max = cd->stackframesize;
321 for (i = 0; i < max; ++i) {
322 #if defined(HAS_4BYTE_STACKSLOT)
323 printf(" M%02d = 0x%02x(sp): ", i, i * 4);
325 printf(" M%02d = 0x%02x(sp): ", i, i * 8);
327 for (j = 0; j < jd->vartop; ++j) {
329 if ((v->flags & INMEMORY) && (v->vv.regoff == i)) {
330 show_variable(jd, j, irstage);
341 #if defined(ENABLE_REPLACEMENT)
342 if (code->rplpoints) {
343 printf("Replacement Points:\n");
344 replace_show_replacement_points(code);
347 #endif /* defined(ENABLE_REPLACEMENT) */
349 #if defined(ENABLE_DISASSEMBLER)
350 /* show code before first basic block */
352 if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd)) {
353 pc = (u1 *) ((ptrint) code->mcode + cd->dseglen);
355 for (; pc < (u1 *) ((ptrint) code->mcode + cd->dseglen + jd->basicblocks[0].mpc);)
362 /* show code of all basic blocks */
364 for (bptr = jd->basicblocks; bptr != NULL; bptr = bptr->next)
365 show_basicblock(jd, bptr, stage);
367 #if defined(ENABLE_DISASSEMBLER)
368 /* show stubs code */
370 if (stage >= SHOW_CODE && opt_showdisassemble && opt_showexceptionstubs) {
371 printf("\nStubs code:\n");
372 printf("Length: %d\n\n", (s4) (code->mcodelength -
373 ((ptrint) cd->dseglen + lastbptr->mpc)));
375 pc = (u1 *) ((ptrint) code->mcode + cd->dseglen + lastbptr->mpc);
377 for (; (ptrint) pc < ((ptrint) code->mcode + code->mcodelength);)
384 LOCK_MONITOR_EXIT(show_global_lock);
386 /* finally flush the output */
390 #endif /* !defined(NDEBUG) */
393 #if !defined(NDEBUG) && defined(ENABLE_INLINING)
394 static void show_inline_info(jitdata *jd, insinfo_inline *ii, s4 opcode, s4 stage)
399 printf("(pt %d+%d+%d st ",
400 ii->throughcount - (ii->stackvarscount - ii->paramcount),
401 ii->stackvarscount - ii->paramcount,
403 show_variable_array(jd, ii->stackvars, ii->stackvarscount, stage);
405 if (opcode == ICMD_INLINE_START || opcode == ICMD_INLINE_END) {
407 jl = (opcode == ICMD_INLINE_START) ? ii->javalocals_start : ii->javalocals_end;
408 n = (opcode == ICMD_INLINE_START) ? ii->method->maxlocals : ii->outer->maxlocals;
409 show_javalocals_array(jd, jl, n, stage);
416 method_print(ii->outer);
420 method_print(ii->method);
422 #endif /* !defined(NDEBUG) && defined(ENABLE_INLINING) */
425 /* show_basicblock *************************************************************
427 Print the intermediate representation of a basic block.
429 NOTE: Currently this function may only be called after register allocation!
431 *******************************************************************************/
434 void show_basicblock(jitdata *jd, basicblock *bptr, int stage)
442 #if defined(ENABLE_DISASSEMBLER)
443 methodinfo *m; /* this is only a dummy */
446 s4 currentlinenumber;
449 /* get required compiler data */
454 if (bptr->flags != BBDELETED) {
455 #if defined(ENABLE_INTRP)
458 irstage = SHOW_PARSE;
463 deadcode = (bptr->flags < BBREACHED);
467 printf("======== %sL%03d ======== %s(flags: %d, bitflags: %01x, next: %d, type: ",
468 #if defined(ENABLE_REPLACEMENT)
469 (bptr->bitflags & BBFLAG_REPLACEMENT) ? "<REPLACE> " :
473 (deadcode && stage >= SHOW_STACK) ? "DEADCODE! " : "",
474 bptr->flags, bptr->bitflags,
475 (bptr->next) ? (bptr->next->nr) : -1);
477 switch (bptr->type) {
489 printf(", icount: %d", bptr->icount);
491 if (irstage >= SHOW_CFG) {
492 printf(", preds: %d [ ", bptr->predecessorcount);
494 for (i = 0; i < bptr->predecessorcount; i++)
495 printf("%d ", bptr->predecessors[i]->nr);
503 printf(" (clone of L%03d)", bptr->original->nr);
505 basicblock *b = bptr->copied_to;
507 printf(" (copied to ");
508 for (; b; b = b->copied_to)
509 printf("L%03d ", b->nr);
516 if (irstage >= SHOW_STACK) {
518 show_variable_array(jd, bptr->invars, bptr->indepth, irstage);
519 printf(" javalocals: ");
520 show_javalocals_array(jd, bptr->javalocals, bptr->method->maxlocals, irstage);
524 #if defined(ENABLE_INLINING)
525 if (bptr->inlineinfo) {
526 printf("inlineinfo: ");
527 show_inline_info(jd, bptr->inlineinfo, -1, irstage);
530 #endif /* defined(ENABLE_INLINING) */
534 for (i = 0; i < bptr->icount; i++, iptr++) {
535 printf("%4d:%4d: ", iptr->line, iptr->flags.bits >> INS_FLAG_ID_SHIFT);
537 show_icmd(jd, iptr, deadcode, irstage);
541 if (irstage >= SHOW_STACK) {
543 show_variable_array(jd, bptr->outvars, bptr->outdepth, irstage);
547 #if defined(ENABLE_DISASSEMBLER)
548 if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd) &&
552 pc = (u1 *) (code->mcode + cd->dseglen + bptr->mpc);
555 if (bptr->next != NULL) {
556 for (; pc < (u1 *) (code->mcode + cd->dseglen + bptr->next->mpc);) {
558 dseg_get_linenumber_from_pc(&m, code->entrypoint, pc);
560 if (currentlinenumber != linenumber) {
561 linenumber = currentlinenumber;
562 printf("%4d:\n", linenumber);
569 for (; pc < (u1 *) (code->mcode + code->mcodelength);) {
571 dseg_get_linenumber_from_pc(&m, code->entrypoint, pc);
573 if (currentlinenumber != linenumber) {
574 linenumber = currentlinenumber;
575 printf("%4d:\n", linenumber);
586 #endif /* !defined(NDEBUG) */
589 /* show_icmd *******************************************************************
591 Print the intermediate representation of an instruction.
593 NOTE: Currently this function may only be called after register allocation!
595 *******************************************************************************/
599 #define SHOW_TARGET(target) \
600 if (stage >= SHOW_PARSE) { \
601 printf("--> L%03d ", (target).block->nr); \
604 printf("--> insindex %d ", (target).insindex); \
607 #define SHOW_INT_CONST(val) \
608 if (stage >= SHOW_PARSE) { \
609 printf("%d (0x%08x) ", (val), (val)); \
615 #if SIZEOF_VOID_P == 4
616 #define SHOW_LNG_CONST(val) \
617 if (stage >= SHOW_PARSE) \
618 printf("%lld (0x%016llx) ", (val), (val)); \
622 #define SHOW_LNG_CONST(val) \
623 if (stage >= SHOW_PARSE) \
624 printf("%ld (0x%016lx) ", (val), (val)); \
629 #if SIZEOF_VOID_P == 4
630 #define SHOW_ADR_CONST(val) \
631 if (stage >= SHOW_PARSE) \
632 printf("0x%08x ", (ptrint) (val)); \
636 #define SHOW_ADR_CONST(val) \
637 if (stage >= SHOW_PARSE) \
638 printf("0x%016lx ", (ptrint) (val)); \
643 #define SHOW_FLT_CONST(val) \
644 if (stage >= SHOW_PARSE) { \
647 printf("%g (0x%08x) ", (val), v.i); \
653 #if SIZEOF_VOID_P == 4
654 #define SHOW_DBL_CONST(val) \
655 if (stage >= SHOW_PARSE) { \
658 printf("%g (0x%016llx) ", (val), v.l); \
663 #define SHOW_DBL_CONST(val) \
664 if (stage >= SHOW_PARSE) { \
667 printf("%g (0x%016lx) ", (val), v.l); \
673 #define SHOW_INDEX(index) \
674 if (stage >= SHOW_PARSE) { \
675 printf("%d ", index); \
681 #define SHOW_STRING(val) \
682 if (stage >= SHOW_PARSE) { \
684 utf_display_printable_ascii( \
685 javastring_toutf((java_objectheader *)(val), false)); \
692 #define SHOW_CLASSREF_OR_CLASSINFO(c) \
693 if (stage >= SHOW_PARSE) { \
694 if (IS_CLASSREF(c)) \
695 class_classref_print(c.ref); \
697 class_print(c.cls); \
704 #define SHOW_FIELD(fmiref) \
705 if (stage >= SHOW_PARSE) { \
706 field_fieldref_print(fmiref); \
713 #define SHOW_VARIABLE(v) \
714 show_variable(jd, (v), stage)
716 #define SHOW_S1(iptr) \
717 if (stage >= SHOW_STACK) { \
718 SHOW_VARIABLE(iptr->s1.varindex); \
721 #define SHOW_S2(iptr) \
722 if (stage >= SHOW_STACK) { \
723 SHOW_VARIABLE(iptr->sx.s23.s2.varindex); \
726 #define SHOW_S3(iptr) \
727 if (stage >= SHOW_STACK) { \
728 SHOW_VARIABLE(iptr->sx.s23.s3.varindex); \
731 #define SHOW_DST(iptr) \
732 if (stage >= SHOW_STACK) { \
734 SHOW_VARIABLE(iptr->dst.varindex); \
737 #define SHOW_S1_LOCAL(iptr) \
738 if (stage >= SHOW_STACK) { \
739 printf("L%d ", iptr->s1.varindex); \
742 printf("JavaL%d ", iptr->s1.varindex); \
745 #define SHOW_DST_LOCAL(iptr) \
746 if (stage >= SHOW_STACK) { \
747 printf("=> L%d ", iptr->dst.varindex); \
750 printf("=> JavaL%d ", iptr->dst.varindex); \
753 void show_allocation(s4 type, s4 flags, s4 regoff)
755 if (type == TYPE_RET) {
760 if (flags & INMEMORY) {
761 printf("M%02d", regoff);
765 #ifdef HAS_ADDRESS_REGISTER_FILE
766 if (type == TYPE_ADR) {
767 printf("R%02d", regoff);
772 if (IS_FLT_DBL_TYPE(type)) {
773 printf("F%02d", regoff);
777 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
778 if (IS_2_WORD_TYPE(type)) {
779 # if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
780 # if defined(ENABLE_INTRP)
782 printf("%3d/%3d", GET_LOW_REG(regoff),
783 GET_HIGH_REG(regoff));
786 printf("%3s/%3s", abi_registers_integer_name[GET_LOW_REG(regoff)],
787 abi_registers_integer_name[GET_HIGH_REG(regoff)]);
789 printf("%3d/%3d", GET_LOW_REG(regoff),
790 GET_HIGH_REG(regoff));
794 #endif /* defined(SUPPORT_COMBINE_INTEGER_REGISTERS) */
796 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
797 # if defined(ENABLE_INTRP)
799 printf("%3d", regoff);
802 printf("%3s", abi_registers_integer_name[regoff]);
804 printf("%3d", regoff);
808 void show_variable(jitdata *jd, s4 index, int stage)
810 show_variable_intern(jd, index, stage);
814 static void show_variable_intern(jitdata *jd, s4 index, int stage)
820 if (index < 0 || index >= jd->vartop) {
821 printf("<INVALID INDEX:%d>", index);
828 case TYPE_INT: type = 'i'; break;
829 case TYPE_LNG: type = 'l'; break;
830 case TYPE_FLT: type = 'f'; break;
831 case TYPE_DBL: type = 'd'; break;
832 case TYPE_ADR: type = 'a'; break;
833 case TYPE_RET: type = 'r'; break;
837 if (index < jd->localcount) {
839 if (v->flags & (PREALLOC | INOUT))
840 printf("<INVALID FLAGS!>");
843 if (v->flags & PREALLOC) {
845 if (v->flags & INOUT) {
846 /* PREALLOC is used to avoid allocation of TYPE_RET */
847 if (v->type == TYPE_RET)
850 printf("<INVALID FLAGS!>");
853 else if (v->flags & INOUT)
859 printf("%c%c%d", kind, type, index);
861 if (v->flags & SAVEDVAR)
864 if (stage >= SHOW_REGS || (v->flags & PREALLOC)) {
866 show_allocation(v->type, v->flags, v->vv.regoff);
870 if (v->type == TYPE_RET && (v->flags & PREALLOC)) {
871 printf("(L%03d)", v->vv.retaddr->nr);
875 static void show_variable_array_intern(jitdata *jd, s4 *vars, int n, int stage,
887 for (i=0; i<n; ++i) {
891 if (vars[i] == UNUSED)
893 else if (javalocals) {
894 nr = RETADDR_FROM_JAVALOCAL(vars[i]);
895 printf("ret(L%03d)", nr);
898 printf("<INVALID INDEX:%d>", vars[i]);
902 show_variable_intern(jd, vars[i], stage);
907 void show_variable_array(jitdata *jd, s4 *vars, int n, int stage)
909 show_variable_array_intern(jd, vars, n, stage, false);
912 void show_javalocals_array(jitdata *jd, s4 *vars, int n, int stage)
914 show_variable_array_intern(jd, vars, n, stage, true);
917 void show_icmd(jitdata *jd, instruction *iptr, bool deadcode, int stage)
920 branch_target_t *table;
921 lookup_target_t *lookup;
922 constant_FMIref *fmiref;
926 /* get the opcode and the condition */
930 printf("%s ", icmd_table[opcode].name);
932 if (stage < SHOW_PARSE)
938 /* Print the condition for conditional instructions. */
940 /* XXX print condition from flags */
942 if (iptr->flags.bits & INS_FLAG_UNRESOLVED)
943 printf("(UNRESOLVED) ");
953 case ICMD_ARRAYLENGTH:
1020 /* binary/const INT */
1021 case ICMD_IADDCONST:
1022 case ICMD_ISUBCONST:
1023 case ICMD_IMULCONST:
1027 case ICMD_IANDCONST:
1029 case ICMD_IXORCONST:
1030 case ICMD_ISHLCONST:
1031 case ICMD_ISHRCONST:
1032 case ICMD_IUSHRCONST:
1033 case ICMD_LSHLCONST:
1034 case ICMD_LSHRCONST:
1035 case ICMD_LUSHRCONST:
1037 SHOW_INT_CONST(iptr->sx.val.i);
1041 /* ?ASTORECONST (trinary/const INT) */
1042 case ICMD_IASTORECONST:
1043 case ICMD_BASTORECONST:
1044 case ICMD_CASTORECONST:
1045 case ICMD_SASTORECONST:
1048 SHOW_INT_CONST(iptr->sx.s23.s3.constval);
1053 SHOW_INT_CONST(iptr->sx.val.i);
1057 /* binary/const LNG */
1058 case ICMD_LADDCONST:
1059 case ICMD_LSUBCONST:
1060 case ICMD_LMULCONST:
1064 case ICMD_LANDCONST:
1066 case ICMD_LXORCONST:
1068 SHOW_LNG_CONST(iptr->sx.val.l);
1072 /* trinary/const LNG (<= pointer size) */
1073 case ICMD_LASTORECONST:
1076 SHOW_ADR_CONST(iptr->sx.s23.s3.constval);
1081 SHOW_LNG_CONST(iptr->sx.val.l);
1087 SHOW_FLT_CONST(iptr->sx.val.f);
1093 SHOW_DBL_CONST(iptr->sx.val.d);
1099 if (iptr->flags.bits & INS_FLAG_CLASS) {
1100 SHOW_ADR_CONST(iptr->sx.val.anyptr);
1101 SHOW_CLASSREF_OR_CLASSINFO(iptr->sx.val.c);
1103 else if (iptr->sx.val.anyptr == NULL) {
1107 SHOW_ADR_CONST(iptr->sx.val.anyptr);
1108 SHOW_STRING(iptr->sx.val.stringconst);
1113 case ICMD_AASTORECONST:
1116 printf("%p ", (void*) iptr->sx.s23.s3.constval);
1119 case ICMD_GETFIELD: /* 1 -> 1 */
1120 case ICMD_PUTFIELD: /* 2 -> 0 */
1121 case ICMD_PUTSTATIC: /* 1 -> 0 */
1122 case ICMD_GETSTATIC: /* 0 -> 1 */
1123 case ICMD_PUTSTATICCONST: /* 0 -> 0 */
1124 case ICMD_PUTFIELDCONST: /* 1 -> 0 */
1125 if (opcode != ICMD_GETSTATIC && opcode != ICMD_PUTSTATICCONST) {
1127 if (opcode == ICMD_PUTFIELD) {
1131 INSTRUCTION_GET_FIELDREF(iptr, fmiref);
1134 if (opcode == ICMD_GETSTATIC || opcode == ICMD_GETFIELD) {
1140 SHOW_S1_LOCAL(iptr);
1141 SHOW_INT_CONST(iptr->sx.val.i);
1142 SHOW_DST_LOCAL(iptr);
1172 SHOW_S1_LOCAL(iptr);
1173 if (stage >= SHOW_STACK) {
1174 printf(" ---> L%03d", iptr->dst.block->nr);
1183 SHOW_S1_LOCAL(iptr);
1193 SHOW_DST_LOCAL(iptr);
1194 if (stage >= SHOW_STACK && iptr->sx.s23.s3.javaindex != UNUSED)
1195 printf(" (javaindex %d)", iptr->sx.s23.s3.javaindex);
1196 if (iptr->flags.bits & INS_FLAG_RETADDR) {
1197 printf(" (retaddr L%03d)", RETADDR_FROM_JAVALOCAL(iptr->sx.s23.s2.retaddrnr));
1209 case ICMD_ANEWARRAY:
1213 case ICMD_MULTIANEWARRAY:
1214 if (stage >= SHOW_STACK) {
1215 argp = iptr->sx.s23.s2.args;
1216 i = iptr->s1.argcount;
1218 SHOW_VARIABLE(*(argp++));
1222 printf("argcount=%d ", iptr->s1.argcount);
1227 case ICMD_CHECKCAST:
1230 class_classref_or_classinfo_print(iptr->sx.s23.s3.c);
1234 case ICMD_INSTANCEOF:
1239 case ICMD_INLINE_START:
1240 case ICMD_INLINE_END:
1241 case ICMD_INLINE_BODY:
1242 #if defined(ENABLE_INLINING)
1244 insinfo_inline *ii = iptr->sx.s23.s3.inlineinfo;
1245 show_inline_info(jd, ii, opcode, stage);
1251 if (stage >= SHOW_STACK) {
1252 argp = iptr->sx.s23.s2.args;
1253 i = iptr->s1.argcount;
1255 if ((iptr->s1.argcount - 1 - i) == iptr->sx.s23.s3.bte->md->paramcount)
1256 printf(" pass-through: ");
1257 SHOW_VARIABLE(*(argp++));
1260 printf("%s ", iptr->sx.s23.s3.bte->cname);
1261 if (iptr->sx.s23.s3.bte->md->returntype.type != TYPE_VOID) {
1266 case ICMD_INVOKEVIRTUAL:
1267 case ICMD_INVOKESPECIAL:
1268 case ICMD_INVOKESTATIC:
1269 case ICMD_INVOKEINTERFACE:
1270 if (stage >= SHOW_STACK) {
1272 INSTRUCTION_GET_METHODDESC(iptr, md);
1273 argp = iptr->sx.s23.s2.args;
1274 i = iptr->s1.argcount;
1276 if ((iptr->s1.argcount - 1 - i) == md->paramcount)
1277 printf(" pass-through: ");
1278 SHOW_VARIABLE(*(argp++));
1281 INSTRUCTION_GET_METHODREF(iptr, fmiref);
1282 method_methodref_print(fmiref);
1283 if (fmiref->parseddesc.md->returntype.type != TYPE_VOID) {
1296 SHOW_INT_CONST(iptr->sx.val.i);
1297 SHOW_TARGET(iptr->dst);
1307 SHOW_LNG_CONST(iptr->sx.val.l);
1308 SHOW_TARGET(iptr->dst);
1312 SHOW_TARGET(iptr->dst);
1316 SHOW_TARGET(iptr->sx.s23.s3.jsrtarget);
1321 case ICMD_IFNONNULL:
1323 SHOW_TARGET(iptr->dst);
1326 case ICMD_IF_ICMPEQ:
1327 case ICMD_IF_ICMPNE:
1328 case ICMD_IF_ICMPLT:
1329 case ICMD_IF_ICMPGE:
1330 case ICMD_IF_ICMPGT:
1331 case ICMD_IF_ICMPLE:
1333 case ICMD_IF_LCMPEQ:
1334 case ICMD_IF_LCMPNE:
1335 case ICMD_IF_LCMPLT:
1336 case ICMD_IF_LCMPGE:
1337 case ICMD_IF_LCMPGT:
1338 case ICMD_IF_LCMPLE:
1340 case ICMD_IF_FCMPEQ:
1341 case ICMD_IF_FCMPNE:
1343 case ICMD_IF_FCMPL_LT:
1344 case ICMD_IF_FCMPL_GE:
1345 case ICMD_IF_FCMPL_GT:
1346 case ICMD_IF_FCMPL_LE:
1348 case ICMD_IF_FCMPG_LT:
1349 case ICMD_IF_FCMPG_GE:
1350 case ICMD_IF_FCMPG_GT:
1351 case ICMD_IF_FCMPG_LE:
1353 case ICMD_IF_DCMPEQ:
1354 case ICMD_IF_DCMPNE:
1356 case ICMD_IF_DCMPL_LT:
1357 case ICMD_IF_DCMPL_GE:
1358 case ICMD_IF_DCMPL_GT:
1359 case ICMD_IF_DCMPL_LE:
1361 case ICMD_IF_DCMPG_LT:
1362 case ICMD_IF_DCMPG_GE:
1363 case ICMD_IF_DCMPG_GT:
1364 case ICMD_IF_DCMPG_LE:
1366 case ICMD_IF_ACMPEQ:
1367 case ICMD_IF_ACMPNE:
1370 SHOW_TARGET(iptr->dst);
1373 case ICMD_TABLESWITCH:
1375 table = iptr->dst.table;
1377 i = iptr->sx.s23.s3.tablehigh - iptr->sx.s23.s2.tablelow + 1;
1379 printf("high=%d low=%d count=%d\n", iptr->sx.s23.s3.tablehigh, iptr->sx.s23.s2.tablelow, i);
1381 printf("\t\t%d --> ", (int) (table - iptr->dst.table));
1382 printf("L%03d\n", table->block->nr);
1388 case ICMD_LOOKUPSWITCH:
1391 printf("count=%d, default=L%03d\n",
1392 iptr->sx.s23.s2.lookupcount,
1393 iptr->sx.s23.s3.lookupdefault.block->nr);
1395 lookup = iptr->dst.lookup;
1396 i = iptr->sx.s23.s2.lookupcount;
1399 printf("\t\t%d --> L%03d\n",
1401 lookup->target.block->nr);
1416 if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
1417 /* XXX this needs more work */
1419 unresolved_class_debug_dump(iptr->sx.s23.s2.uc, stdout);
1432 #endif /* !defined(NDEBUG) */
1436 * These are local overrides for various environment variables in Emacs.
1437 * Please do not remove this and leave it at the end of the file, where
1438 * Emacs will automagically detect them.
1439 * ---------------------------------------------------------------------
1442 * indent-tabs-mode: t
1446 * vim:noexpandtab:sw=4:ts=4: