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 #if defined(ENABLE_THREADS)
39 # include "threads/native/lock.h"
41 # include "threads/none/lock.h"
44 #include "vm/global.h"
45 #include "vm/builtin.h"
46 #include "vm/stringlocal.h"
48 #include "vm/jit/abi.h"
49 #include "vm/jit/jit.h"
50 #include "vm/jit/show.h"
51 #include "vm/jit/disass.h"
52 #include "vm/jit/stack.h"
53 #include "vm/jit/parse.h"
55 #include "vmcore/options.h"
58 /* global variables ***********************************************************/
60 #if defined(ENABLE_THREADS) && !defined(NDEBUG)
61 static java_objectheader *show_global_lock;
65 /* prototypes *****************************************************************/
68 static void show_variable_intern(jitdata *jd, s4 index, int stage);
72 /* show_init *******************************************************************
74 Initialized the show subsystem (called by jit_init).
76 *******************************************************************************/
81 #if defined(ENABLE_THREADS)
82 /* initialize the show lock */
84 show_global_lock = NEW(java_objectheader);
86 lock_init_object_lock(show_global_lock);
97 char *show_jit_type_names[] = {
108 char show_jit_type_letters[] = {
122 /* show_method *****************************************************************
124 Print the intermediate representation of a method.
126 NOTE: Currently this function may only be called after register allocation!
128 *******************************************************************************/
131 void show_method(jitdata *jd, int stage)
138 basicblock *lastbptr;
142 #if defined(ENABLE_DISASSEMBLER)
146 /* get required compiler data */
153 /* We need to enter a lock here, since the binutils disassembler
154 is not reentrant-able and we could not read functions printed
157 LOCK_MONITOR_ENTER(show_global_lock);
159 #if defined(ENABLE_INTRP)
161 irstage = SHOW_PARSE;
166 /* get the last basic block */
168 for (lastbptr = jd->basicblocks; lastbptr->next != NULL; lastbptr = lastbptr->next);
174 if (jd->isleafmethod)
175 printf("LEAFMETHOD\n");
177 printf("\nBasic blocks: %d\n", jd->basicblockcount);
178 if (stage >= SHOW_CODE) {
179 printf("Code length: %d\n", (lastbptr->mpc - jd->basicblocks[0].mpc));
180 printf("Data length: %d\n", cd->dseglen);
181 printf("Stub length: %d\n", (s4) (code->mcodelength -
182 ((ptrint) cd->dseglen + lastbptr->mpc)));
184 printf("Variables: %d (%d used)\n", jd->varcount, jd->vartop);
185 if (stage >= SHOW_STACK)
186 printf("Max interfaces: %d\n", jd->maxinterfaces);
187 printf("Max locals: %d\n", jd->maxlocals);
188 printf("Max stack: %d\n", m->maxstack);
189 printf("Linenumbers: %d\n", m->linenumbercount);
190 printf("Branch to entry: %s\n", (jd->branchtoentry) ? "yes" : "no");
191 printf("Branch to end: %s\n", (jd->branchtoend) ? "yes" : "no");
192 if (stage >= SHOW_STACK) {
193 printf("Number of RETURNs: %d", jd->returncount);
194 if (jd->returncount == 1)
195 printf(" (block L%03d)", jd->returnblock->nr);
199 if (stage >= SHOW_PARSE) {
200 printf("Exceptions (Number: %d):\n", jd->exceptiontablelength);
201 for (ex = jd->exceptiontable; ex != NULL; ex = ex->down) {
202 printf(" L%03d ... ", ex->start->nr );
203 printf("L%03d = ", ex->end->nr);
204 printf("L%03d", ex->handler->nr);
205 printf(" (catchtype: ");
206 if (ex->catchtype.any)
207 if (IS_CLASSREF(ex->catchtype))
208 class_classref_print(ex->catchtype.ref);
210 class_print(ex->catchtype.cls);
217 if (irstage >= SHOW_PARSE && rd && jd->localcount > 0) {
218 printf("Local Table:\n");
219 for (i = 0; i < jd->localcount; i++) {
222 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
223 # if defined(ENABLE_INTRP)
226 printf(" (%s) ", show_jit_type_names[VAR(i)->type]);
227 if (irstage >= SHOW_REGS)
228 show_allocation(VAR(i)->type, VAR(i)->flags, VAR(i)->vv.regoff);
230 # if defined(ENABLE_INTRP)
233 #endif /* defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER) */
238 if (jd->maxlocals > 0 && jd->local_map != NULL) {
239 printf("Local Map:\n");
241 for (j = 0; j < jd->maxlocals; j++) {
245 for (i = 0; i < 5; i++) {
246 printf(" %5s ",show_jit_type_names[i]);
247 for (j = 0; j < jd->maxlocals; j++) {
248 if (jd->local_map[j*5+i] == UNUSED)
251 printf("%4i ",jd->local_map[j*5+i]);
258 if (jd->maxinterfaces > 0 && jd->interface_map && irstage >= SHOW_STACK) {
260 interface_info *mapptr = jd->interface_map;
262 /* look if there exist any INOUTS */
263 for (i = 0; (i < (5 * jd->maxinterfaces)) && !exist; i++, mapptr++)
264 exist = (mapptr->flags != UNUSED);
267 printf("Interface Table: (In/Outvars)\n");
269 for (j = 0; j < jd->maxinterfaces; j++) {
274 for (i = 0; i < 5; i++) {
275 printf(" %5s ",show_jit_type_names[i]);
276 for (j = 0; j < jd->maxinterfaces; j++) {
277 s4 flags = jd->interface_map[j*5+i].flags;
278 s4 regoff = jd->interface_map[j*5+i].regoff;
284 if (irstage >= SHOW_REGS) {
285 if (flags & SAVEDVAR) {
286 if (flags & INMEMORY)
292 if (flags & INMEMORY)
297 printf("%c%03d(", ch, regoff);
298 show_allocation(i, flags, regoff);
302 if (flags & SAVEDVAR)
315 if (rd->memuse && irstage >= SHOW_REGS) {
319 printf("Stack slots: (memuse=%d", rd->memuse);
320 if (irstage >= SHOW_CODE) {
321 printf(", stackframesize=%d", cd->stackframesize);
322 max = cd->stackframesize;
325 for (i = 0; i < max; ++i) {
326 #if defined(HAS_4BYTE_STACKSLOT)
327 printf(" M%02d = 0x%02x(sp): ", i, i * 4);
329 printf(" M%02d = 0x%02x(sp): ", i, i * 8);
331 for (j = 0; j < jd->vartop; ++j) {
333 if ((v->flags & INMEMORY) && (v->vv.regoff == i)) {
334 show_variable(jd, j, irstage);
345 #if defined(ENABLE_REPLACEMENT)
346 if (code->rplpoints) {
347 printf("Replacement Points:\n");
348 replace_show_replacement_points(code);
351 #endif /* defined(ENABLE_REPLACEMENT) */
353 #if defined(ENABLE_DISASSEMBLER)
354 /* show code before first basic block */
356 if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd)) {
357 pc = (u1 *) ((ptrint) code->mcode + cd->dseglen);
359 for (; pc < (u1 *) ((ptrint) code->mcode + cd->dseglen + jd->basicblocks[0].mpc);)
366 /* show code of all basic blocks */
368 for (bptr = jd->basicblocks; bptr != NULL; bptr = bptr->next)
369 show_basicblock(jd, bptr, stage);
371 #if defined(ENABLE_DISASSEMBLER)
372 /* show stubs code */
374 if (stage >= SHOW_CODE && opt_showdisassemble && opt_showexceptionstubs) {
375 printf("\nStubs code:\n");
376 printf("Length: %d\n\n", (s4) (code->mcodelength -
377 ((ptrint) cd->dseglen + lastbptr->mpc)));
379 pc = (u1 *) ((ptrint) code->mcode + cd->dseglen + lastbptr->mpc);
381 for (; (ptrint) pc < ((ptrint) code->mcode + code->mcodelength);)
388 LOCK_MONITOR_EXIT(show_global_lock);
390 /* finally flush the output */
394 #endif /* !defined(NDEBUG) */
397 #if !defined(NDEBUG) && defined(ENABLE_INLINING)
398 static void show_inline_info(jitdata *jd, insinfo_inline *ii, s4 opcode, s4 stage)
403 printf("(pt %d+%d+%d st ",
404 ii->throughcount - (ii->stackvarscount - ii->paramcount),
405 ii->stackvarscount - ii->paramcount,
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_javalocals_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)
447 methodinfo *m; /* this is only a dummy */
450 s4 currentlinenumber;
453 /* get required compiler data */
458 if (bptr->flags != BBDELETED) {
459 #if defined(ENABLE_INTRP)
462 irstage = SHOW_PARSE;
467 deadcode = (bptr->flags < BBREACHED);
471 printf("======== %sL%03d ======== %s(flags: %d, bitflags: %01x, next: %d, type: ",
472 #if defined(ENABLE_REPLACEMENT)
473 (bptr->bitflags & BBFLAG_REPLACEMENT) ? "<REPLACE> " :
477 (deadcode && stage >= SHOW_STACK) ? "DEADCODE! " : "",
478 bptr->flags, bptr->bitflags,
479 (bptr->next) ? (bptr->next->nr) : -1);
481 switch (bptr->type) {
493 printf(", icount: %d", bptr->icount);
495 if (irstage >= SHOW_CFG) {
496 printf(", preds: %d [ ", bptr->predecessorcount);
498 for (i = 0; i < bptr->predecessorcount; i++)
499 printf("%d ", bptr->predecessors[i]->nr);
507 printf(" (clone of L%03d)", bptr->original->nr);
509 basicblock *b = bptr->copied_to;
511 printf(" (copied to ");
512 for (; b; b = b->copied_to)
513 printf("L%03d ", b->nr);
520 if (irstage >= SHOW_STACK) {
522 show_variable_array(jd, bptr->invars, bptr->indepth, irstage);
523 printf(" javalocals: ");
524 show_javalocals_array(jd, bptr->javalocals, bptr->method->maxlocals, irstage);
528 #if defined(ENABLE_INLINING)
529 if (bptr->inlineinfo) {
530 printf("inlineinfo: ");
531 show_inline_info(jd, bptr->inlineinfo, -1, irstage);
534 #endif /* defined(ENABLE_INLINING) */
538 for (i = 0; i < bptr->icount; i++, iptr++) {
539 printf("%4d:%4d: ", iptr->line, iptr->flags.bits >> INS_FLAG_ID_SHIFT);
541 show_icmd(jd, iptr, deadcode, irstage);
545 if (irstage >= SHOW_STACK) {
547 show_variable_array(jd, bptr->outvars, bptr->outdepth, irstage);
551 #if defined(ENABLE_DISASSEMBLER)
552 if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd) &&
556 pc = (u1 *) (code->mcode + cd->dseglen + bptr->mpc);
559 if (bptr->next != NULL) {
560 for (; pc < (u1 *) (code->mcode + cd->dseglen + bptr->next->mpc);) {
562 dseg_get_linenumber_from_pc(&m, code->entrypoint, pc);
564 if (currentlinenumber != linenumber) {
565 linenumber = currentlinenumber;
566 printf("%4d:\n", linenumber);
573 for (; pc < (u1 *) (code->mcode + code->mcodelength);) {
575 dseg_get_linenumber_from_pc(&m, code->entrypoint, pc);
577 if (currentlinenumber != linenumber) {
578 linenumber = currentlinenumber;
579 printf("%4d:\n", linenumber);
590 #endif /* !defined(NDEBUG) */
593 /* show_icmd *******************************************************************
595 Print the intermediate representation of an instruction.
597 NOTE: Currently this function may only be called after register allocation!
599 *******************************************************************************/
603 #define SHOW_TARGET(target) \
604 if (stage >= SHOW_STACK) { \
605 printf("--> L%03d ", (target).block->nr); \
607 else if (stage >= SHOW_PARSE) { \
608 printf("--> insindex %d (L%03d) ", (target).insindex, \
609 jd->basicblocks[jd->basicblockindex[ \
610 (target).insindex]].nr); \
613 printf("--> insindex %d ", (target).insindex); \
616 #define SHOW_INT_CONST(val) \
617 if (stage >= SHOW_PARSE) { \
618 printf("%d (0x%08x) ", (val), (val)); \
624 #if SIZEOF_VOID_P == 4
625 #define SHOW_LNG_CONST(val) \
626 if (stage >= SHOW_PARSE) \
627 printf("%lld (0x%016llx) ", (val), (val)); \
631 #define SHOW_LNG_CONST(val) \
632 if (stage >= SHOW_PARSE) \
633 printf("%ld (0x%016lx) ", (val), (val)); \
638 #if SIZEOF_VOID_P == 4
639 #define SHOW_ADR_CONST(val) \
640 if (stage >= SHOW_PARSE) \
641 printf("0x%08x ", (ptrint) (val)); \
645 #define SHOW_ADR_CONST(val) \
646 if (stage >= SHOW_PARSE) \
647 printf("0x%016lx ", (ptrint) (val)); \
652 #define SHOW_FLT_CONST(val) \
653 if (stage >= SHOW_PARSE) { \
656 printf("%g (0x%08x) ", (val), v.i); \
662 #if SIZEOF_VOID_P == 4
663 #define SHOW_DBL_CONST(val) \
664 if (stage >= SHOW_PARSE) { \
667 printf("%g (0x%016llx) ", (val), v.l); \
672 #define SHOW_DBL_CONST(val) \
673 if (stage >= SHOW_PARSE) { \
676 printf("%g (0x%016lx) ", (val), v.l); \
682 #define SHOW_INDEX(index) \
683 if (stage >= SHOW_PARSE) { \
684 printf("%d ", index); \
690 #define SHOW_STRING(val) \
691 if (stage >= SHOW_PARSE) { \
693 utf_display_printable_ascii( \
694 javastring_toutf((java_objectheader *)(val), false)); \
701 #define SHOW_CLASSREF_OR_CLASSINFO(c) \
702 if (stage >= SHOW_PARSE) { \
703 if (IS_CLASSREF(c)) \
704 class_classref_print(c.ref); \
706 class_print(c.cls); \
713 #define SHOW_FIELD(fmiref) \
714 if (stage >= SHOW_PARSE) { \
715 field_fieldref_print(fmiref); \
722 #define SHOW_VARIABLE(v) \
723 show_variable(jd, (v), stage)
725 #define SHOW_S1(iptr) \
726 if (stage >= SHOW_STACK) { \
727 SHOW_VARIABLE(iptr->s1.varindex); \
730 #define SHOW_S2(iptr) \
731 if (stage >= SHOW_STACK) { \
732 SHOW_VARIABLE(iptr->sx.s23.s2.varindex); \
735 #define SHOW_S3(iptr) \
736 if (stage >= SHOW_STACK) { \
737 SHOW_VARIABLE(iptr->sx.s23.s3.varindex); \
740 #define SHOW_DST(iptr) \
741 if (stage >= SHOW_STACK) { \
743 SHOW_VARIABLE(iptr->dst.varindex); \
746 #define SHOW_S1_LOCAL(iptr) \
747 if (stage >= SHOW_STACK) { \
748 printf("L%d ", iptr->s1.varindex); \
751 printf("JavaL%d ", iptr->s1.varindex); \
754 #define SHOW_DST_LOCAL(iptr) \
755 if (stage >= SHOW_STACK) { \
756 printf("=> L%d ", iptr->dst.varindex); \
759 printf("=> JavaL%d ", iptr->dst.varindex); \
762 void show_allocation(s4 type, s4 flags, s4 regoff)
764 if (type == TYPE_RET) {
769 if (flags & INMEMORY) {
770 printf("M%02d", regoff);
774 #ifdef HAS_ADDRESS_REGISTER_FILE
775 if (type == TYPE_ADR) {
776 printf("R%02d", regoff);
781 if (IS_FLT_DBL_TYPE(type)) {
782 printf("F%02d", regoff);
786 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
787 if (IS_2_WORD_TYPE(type)) {
788 # if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
789 # if defined(ENABLE_INTRP)
791 printf("%3d/%3d", GET_LOW_REG(regoff),
792 GET_HIGH_REG(regoff));
795 printf("%3s/%3s", abi_registers_integer_name[GET_LOW_REG(regoff)],
796 abi_registers_integer_name[GET_HIGH_REG(regoff)]);
798 printf("%3d/%3d", GET_LOW_REG(regoff),
799 GET_HIGH_REG(regoff));
803 #endif /* defined(SUPPORT_COMBINE_INTEGER_REGISTERS) */
805 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
806 # if defined(ENABLE_INTRP)
808 printf("%3d", regoff);
811 printf("%3s", abi_registers_integer_name[regoff]);
813 printf("%3d", regoff);
817 void show_variable(jitdata *jd, s4 index, int stage)
819 show_variable_intern(jd, index, stage);
823 static void show_variable_intern(jitdata *jd, s4 index, int stage)
829 if (index < 0 || index >= jd->vartop) {
830 printf("<INVALID INDEX:%d>", index);
837 case TYPE_INT: type = 'i'; break;
838 case TYPE_LNG: type = 'l'; break;
839 case TYPE_FLT: type = 'f'; break;
840 case TYPE_DBL: type = 'd'; break;
841 case TYPE_ADR: type = 'a'; break;
842 case TYPE_RET: type = 'r'; break;
846 if (index < jd->localcount) {
848 if (v->flags & (PREALLOC | INOUT))
849 printf("<INVALID FLAGS!>");
852 if (v->flags & PREALLOC) {
854 if (v->flags & INOUT) {
855 /* PREALLOC is used to avoid allocation of TYPE_RET */
856 if (v->type == TYPE_RET)
859 printf("<INVALID FLAGS!>");
862 else if (v->flags & INOUT)
868 printf("%c%c%d", kind, type, index);
870 if (v->flags & SAVEDVAR)
873 if (stage >= SHOW_REGS || (v->flags & PREALLOC)) {
875 show_allocation(v->type, v->flags, v->vv.regoff);
879 if (v->type == TYPE_RET && (v->flags & PREALLOC)) {
880 printf("(L%03d)", v->vv.retaddr->nr);
884 static void show_variable_array_intern(jitdata *jd, s4 *vars, int n, int stage,
896 for (i=0; i<n; ++i) {
900 if (vars[i] == UNUSED)
902 else if (javalocals) {
903 nr = (UNUSED - vars[i]) - 1;
904 printf("ret(L%03d)", nr);
907 printf("<INVALID INDEX:%d>", vars[i]);
911 show_variable_intern(jd, vars[i], stage);
916 void show_variable_array(jitdata *jd, s4 *vars, int n, int stage)
918 show_variable_array_intern(jd, vars, n, stage, false);
921 void show_javalocals_array(jitdata *jd, s4 *vars, int n, int stage)
923 show_variable_array_intern(jd, vars, n, stage, true);
926 void show_icmd(jitdata *jd, instruction *iptr, bool deadcode, int stage)
929 branch_target_t *table;
930 lookup_target_t *lookup;
931 constant_FMIref *fmiref;
935 /* get the opcode and the condition */
939 printf("%s ", icmd_table[opcode].name);
941 if (stage < SHOW_PARSE)
947 /* Print the condition for conditional instructions. */
949 /* XXX print condition from flags */
951 if (iptr->flags.bits & INS_FLAG_UNRESOLVED)
952 printf("(UNRESOLVED) ");
962 case ICMD_ARRAYLENGTH:
1029 /* binary/const INT */
1030 case ICMD_IADDCONST:
1031 case ICMD_ISUBCONST:
1032 case ICMD_IMULCONST:
1036 case ICMD_IANDCONST:
1038 case ICMD_IXORCONST:
1039 case ICMD_ISHLCONST:
1040 case ICMD_ISHRCONST:
1041 case ICMD_IUSHRCONST:
1042 case ICMD_LSHLCONST:
1043 case ICMD_LSHRCONST:
1044 case ICMD_LUSHRCONST:
1046 SHOW_INT_CONST(iptr->sx.val.i);
1050 /* ?ASTORECONST (trinary/const INT) */
1051 case ICMD_IASTORECONST:
1052 case ICMD_BASTORECONST:
1053 case ICMD_CASTORECONST:
1054 case ICMD_SASTORECONST:
1057 SHOW_INT_CONST(iptr->sx.s23.s3.constval);
1062 SHOW_INT_CONST(iptr->sx.val.i);
1066 /* binary/const LNG */
1067 case ICMD_LADDCONST:
1068 case ICMD_LSUBCONST:
1069 case ICMD_LMULCONST:
1073 case ICMD_LANDCONST:
1075 case ICMD_LXORCONST:
1077 SHOW_LNG_CONST(iptr->sx.val.l);
1081 /* trinary/const LNG (<= pointer size) */
1082 case ICMD_LASTORECONST:
1085 SHOW_ADR_CONST(iptr->sx.s23.s3.constval);
1090 SHOW_LNG_CONST(iptr->sx.val.l);
1096 SHOW_FLT_CONST(iptr->sx.val.f);
1102 SHOW_DBL_CONST(iptr->sx.val.d);
1108 if (iptr->flags.bits & INS_FLAG_CLASS) {
1109 SHOW_ADR_CONST(iptr->sx.val.anyptr);
1110 SHOW_CLASSREF_OR_CLASSINFO(iptr->sx.val.c);
1112 else if (iptr->sx.val.anyptr == NULL) {
1116 SHOW_ADR_CONST(iptr->sx.val.anyptr);
1117 SHOW_STRING(iptr->sx.val.stringconst);
1122 case ICMD_AASTORECONST:
1125 printf("%p ", (void*) iptr->sx.s23.s3.constval);
1128 case ICMD_GETFIELD: /* 1 -> 1 */
1129 case ICMD_PUTFIELD: /* 2 -> 0 */
1130 case ICMD_PUTSTATIC: /* 1 -> 0 */
1131 case ICMD_GETSTATIC: /* 0 -> 1 */
1132 case ICMD_PUTSTATICCONST: /* 0 -> 0 */
1133 case ICMD_PUTFIELDCONST: /* 1 -> 0 */
1134 if (opcode != ICMD_GETSTATIC && opcode != ICMD_PUTSTATICCONST) {
1136 if (opcode == ICMD_PUTFIELD) {
1140 INSTRUCTION_GET_FIELDREF(iptr, fmiref);
1143 if (opcode == ICMD_GETSTATIC || opcode == ICMD_GETFIELD) {
1149 SHOW_S1_LOCAL(iptr);
1150 SHOW_INT_CONST(iptr->sx.val.i);
1151 SHOW_DST_LOCAL(iptr);
1181 SHOW_S1_LOCAL(iptr);
1182 if (stage >= SHOW_STACK) {
1183 printf(" ---> L%03d", iptr->dst.block->nr);
1192 SHOW_S1_LOCAL(iptr);
1202 SHOW_DST_LOCAL(iptr);
1203 if (stage >= SHOW_STACK && iptr->sx.s23.s3.javaindex != UNUSED)
1204 printf(" (javaindex %d)", iptr->sx.s23.s3.javaindex);
1205 if (iptr->flags.bits & INS_FLAG_RETADDR) {
1206 printf(" (retaddr L%03d)", (UNUSED - iptr->sx.s23.s2.retaddrnr) - 1);
1218 case ICMD_ANEWARRAY:
1222 case ICMD_MULTIANEWARRAY:
1223 if (stage >= SHOW_STACK) {
1224 argp = iptr->sx.s23.s2.args;
1225 i = iptr->s1.argcount;
1227 SHOW_VARIABLE(*(argp++));
1231 printf("argcount=%d ", iptr->s1.argcount);
1236 case ICMD_CHECKCAST:
1239 class_classref_or_classinfo_print(iptr->sx.s23.s3.c);
1243 case ICMD_INSTANCEOF:
1248 case ICMD_INLINE_START:
1249 case ICMD_INLINE_END:
1250 case ICMD_INLINE_BODY:
1251 #if defined(ENABLE_INLINING)
1253 insinfo_inline *ii = iptr->sx.s23.s3.inlineinfo;
1254 show_inline_info(jd, ii, opcode, stage);
1260 if (stage >= SHOW_STACK) {
1261 argp = iptr->sx.s23.s2.args;
1262 i = iptr->s1.argcount;
1264 if ((iptr->s1.argcount - 1 - i) == iptr->sx.s23.s3.bte->md->paramcount)
1265 printf(" pass-through: ");
1266 SHOW_VARIABLE(*(argp++));
1269 printf("%s ", iptr->sx.s23.s3.bte->cname);
1270 if (iptr->sx.s23.s3.bte->md->returntype.type != TYPE_VOID) {
1275 case ICMD_INVOKEVIRTUAL:
1276 case ICMD_INVOKESPECIAL:
1277 case ICMD_INVOKESTATIC:
1278 case ICMD_INVOKEINTERFACE:
1279 if (stage >= SHOW_STACK) {
1281 INSTRUCTION_GET_METHODDESC(iptr, md);
1282 argp = iptr->sx.s23.s2.args;
1283 i = iptr->s1.argcount;
1285 if ((iptr->s1.argcount - 1 - i) == md->paramcount)
1286 printf(" pass-through: ");
1287 SHOW_VARIABLE(*(argp++));
1290 INSTRUCTION_GET_METHODREF(iptr, fmiref);
1291 method_methodref_print(fmiref);
1292 if (fmiref->parseddesc.md->returntype.type != TYPE_VOID) {
1305 SHOW_INT_CONST(iptr->sx.val.i);
1306 SHOW_TARGET(iptr->dst);
1316 SHOW_LNG_CONST(iptr->sx.val.l);
1317 SHOW_TARGET(iptr->dst);
1321 SHOW_TARGET(iptr->dst);
1325 SHOW_TARGET(iptr->sx.s23.s3.jsrtarget);
1330 case ICMD_IFNONNULL:
1332 SHOW_TARGET(iptr->dst);
1335 case ICMD_IF_ICMPEQ:
1336 case ICMD_IF_ICMPNE:
1337 case ICMD_IF_ICMPLT:
1338 case ICMD_IF_ICMPGE:
1339 case ICMD_IF_ICMPGT:
1340 case ICMD_IF_ICMPLE:
1342 case ICMD_IF_LCMPEQ:
1343 case ICMD_IF_LCMPNE:
1344 case ICMD_IF_LCMPLT:
1345 case ICMD_IF_LCMPGE:
1346 case ICMD_IF_LCMPGT:
1347 case ICMD_IF_LCMPLE:
1349 case ICMD_IF_FCMPEQ:
1350 case ICMD_IF_FCMPNE:
1352 case ICMD_IF_FCMPL_LT:
1353 case ICMD_IF_FCMPL_GE:
1354 case ICMD_IF_FCMPL_GT:
1355 case ICMD_IF_FCMPL_LE:
1357 case ICMD_IF_FCMPG_LT:
1358 case ICMD_IF_FCMPG_GE:
1359 case ICMD_IF_FCMPG_GT:
1360 case ICMD_IF_FCMPG_LE:
1362 case ICMD_IF_DCMPEQ:
1363 case ICMD_IF_DCMPNE:
1365 case ICMD_IF_DCMPL_LT:
1366 case ICMD_IF_DCMPL_GE:
1367 case ICMD_IF_DCMPL_GT:
1368 case ICMD_IF_DCMPL_LE:
1370 case ICMD_IF_DCMPG_LT:
1371 case ICMD_IF_DCMPG_GE:
1372 case ICMD_IF_DCMPG_GT:
1373 case ICMD_IF_DCMPG_LE:
1375 case ICMD_IF_ACMPEQ:
1376 case ICMD_IF_ACMPNE:
1379 SHOW_TARGET(iptr->dst);
1382 case ICMD_TABLESWITCH:
1384 table = iptr->dst.table;
1386 i = iptr->sx.s23.s3.tablehigh - iptr->sx.s23.s2.tablelow + 1;
1388 printf("high=%d low=%d count=%d\n", iptr->sx.s23.s3.tablehigh, iptr->sx.s23.s2.tablelow, i);
1390 printf("\t\t%d --> ", (int) (table - iptr->dst.table));
1391 if (stage >= SHOW_STACK) {
1392 printf("L%03d\n", table->block->nr);
1395 printf("insindex %d (L%03d)\n", table->insindex, BLOCK_OF(table->insindex)->nr);
1402 case ICMD_LOOKUPSWITCH:
1405 printf("count=%d, default=", iptr->sx.s23.s2.lookupcount);
1406 if (stage >= SHOW_STACK) {
1407 printf("L%03d\n", iptr->sx.s23.s3.lookupdefault.block->nr);
1410 printf("insindex %d (L%03d)\n", iptr->sx.s23.s3.lookupdefault.insindex, BLOCK_OF(iptr->sx.s23.s3.lookupdefault.insindex)->nr);
1413 lookup = iptr->dst.lookup;
1414 i = iptr->sx.s23.s2.lookupcount;
1416 printf("\t\t%d --> ", lookup->value);
1417 if (stage >= SHOW_STACK) {
1418 printf("L%03d\n", lookup->target.block->nr);
1421 printf("insindex %d (L%03d)\n", lookup->target.insindex, BLOCK_OF(lookup->target.insindex)->nr);
1437 if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
1438 /* XXX this needs more work */
1440 unresolved_class_debug_dump(iptr->sx.s23.s2.uc, stdout);
1453 #endif /* !defined(NDEBUG) */
1457 * These are local overrides for various environment variables in Emacs.
1458 * Please do not remove this and leave it at the end of the file, where
1459 * Emacs will automagically detect them.
1460 * ---------------------------------------------------------------------
1463 * indent-tabs-mode: t
1467 * vim:noexpandtab:sw=4:ts=4: