Merged revisions 7797-7917 via svnmerge from
[cacao.git] / src / vm / jit / show.c
1 /* src/vm/jit/show.c - showing the intermediate representation
2
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
7
8    This file is part of CACAO.
9
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.
14
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.
19
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
23    02110-1301, USA.
24
25    $Id$
26
27 */
28
29
30 #include "config.h"
31
32 #include <assert.h>
33
34 #include "vm/types.h"
35
36 #include "mm/memory.h"
37
38 #include "threads/lock-common.h"
39
40 #include "vm/global.h"
41 #include "vm/builtin.h"
42 #include "vm/stringlocal.h"
43
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"
50
51 #include "vmcore/options.h"
52
53
54 /* global variables ***********************************************************/
55
56 #if defined(ENABLE_THREADS) && !defined(NDEBUG)
57 static java_objectheader *show_global_lock;
58 #endif
59
60
61 /* prototypes *****************************************************************/
62
63 #if !defined(NDEBUG)
64 static void show_variable_intern(jitdata *jd, s4 index, int stage);
65 #endif
66
67
68 /* show_init *******************************************************************
69
70    Initialized the show subsystem (called by jit_init).
71
72 *******************************************************************************/
73
74 #if !defined(NDEBUG)
75 bool show_init(void)
76 {
77 #if defined(ENABLE_THREADS)
78         /* initialize the show lock */
79
80         show_global_lock = NEW(java_objectheader);
81
82         LOCK_INIT_OBJECT_LOCK(show_global_lock);
83 #endif
84
85         /* everything's ok */
86
87         return true;
88 }
89 #endif
90
91
92 #if !defined(NDEBUG)
93 char *show_jit_type_names[] = {
94         "INT",
95         "LNG",
96         "FLT",
97         "DBL",
98         "ADR",
99         "??5",
100         "??6",
101         "??7",
102         "RET"
103 };
104 char show_jit_type_letters[] = {
105         'I',
106         'L',
107         'F',
108         'D',
109         'A',
110         '5',
111         '6',
112         '7',
113         'R'
114 };
115 #endif
116
117
118 /* show_method *****************************************************************
119
120    Print the intermediate representation of a method.
121
122    NOTE: Currently this function may only be called after register allocation!
123
124 *******************************************************************************/
125
126 #if !defined(NDEBUG)
127 void show_method(jitdata *jd, int stage)
128 {
129         methodinfo     *m;
130         codeinfo       *code;
131         codegendata    *cd;
132         registerdata   *rd;
133         basicblock     *bptr;
134         basicblock     *lastbptr;
135         exception_entry *ex;
136         s4              i, j;
137         int             irstage;
138 #if defined(ENABLE_DISASSEMBLER)
139         u1             *pc;
140 #endif
141
142         /* get required compiler data */
143
144         m    = jd->m;
145         code = jd->code;
146         cd   = jd->cd;
147         rd   = jd->rd;
148
149         /* We need to enter a lock here, since the binutils disassembler
150            is not reentrant-able and we could not read functions printed
151            at the same time. */
152
153         LOCK_MONITOR_ENTER(show_global_lock);
154
155 #if defined(ENABLE_INTRP)
156         if (opt_intrp)
157                 irstage = SHOW_PARSE;
158         else
159 #endif
160                 irstage = stage;
161
162         /* get the last basic block */
163
164         for (lastbptr = jd->basicblocks; lastbptr->next != NULL; lastbptr = lastbptr->next);
165
166         printf("\n");
167
168         method_println(m);
169
170         if (jd->isleafmethod)
171                 printf("LEAFMETHOD\n");
172
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)));
179         }
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);
192                 printf("\n");
193         }
194
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);
205                                 else
206                                         class_print(ex->catchtype.cls);
207                         else
208                                 printf("ANY");
209                         printf(")\n");
210                 }
211         }
212         
213         if (irstage >= SHOW_PARSE && rd && jd->localcount > 0) {
214                 printf("Local Table:\n");
215                 for (i = 0; i < jd->localcount; i++) {
216                         printf("   %3d: ", i);
217
218 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
219 # if defined(ENABLE_INTRP)
220                         if (!opt_intrp) {
221 # endif
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);
225                                 printf("\n");
226 # if defined(ENABLE_INTRP)
227                         }
228 # endif
229 #endif /* defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER) */
230                 }
231                 printf("\n");
232         }
233
234         if (jd->maxlocals > 0 && jd->local_map != NULL) {
235                 printf("Local Map:\n");
236                 printf("    index ");
237                 for (j = 0; j < jd->maxlocals; j++) {
238                         printf(" [%2d]", j);
239                 }
240                 printf("\n");
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)
245                                         printf("  -- ");
246                                 else
247                                         printf("%4i ",jd->local_map[j*5+i]);
248                         }
249                         printf("\n");
250                 }
251                 printf("\n");
252         }
253
254         if (jd->maxinterfaces > 0 && jd->interface_map && irstage >= SHOW_STACK) {
255                 bool exist = false;
256                 interface_info *mapptr = jd->interface_map;
257                 
258                 /* look if there exist any INOUTS */
259                 for (i = 0; (i < (5 * jd->maxinterfaces)) && !exist; i++, mapptr++)
260                         exist = (mapptr->flags != UNUSED);
261
262                 if (exist) {
263                         printf("Interface Table: (In/Outvars)\n");
264                         printf("    depth ");
265                         for (j = 0; j < jd->maxinterfaces; j++) {
266                                 printf("      [%2d]", j);
267                         }
268                         printf("\n");
269
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;
275                                         if (flags == UNUSED)
276                                                 printf("  --      ");
277                                         else {
278                                                 int ch;
279
280                                                 if (irstage >= SHOW_REGS) {
281                                                         if (flags & SAVEDVAR) {
282                                                                 if (flags & INMEMORY)
283                                                                         ch = 'M';
284                                                                 else
285                                                                         ch = 'R';
286                                                         }
287                                                         else {
288                                                                 if (flags & INMEMORY)
289                                                                         ch = 'm';
290                                                                 else
291                                                                         ch = 'r';
292                                                         }
293                                                         printf("%c%03d(", ch, regoff);
294                                                         show_allocation(i, flags, regoff);
295                                                         printf(") ");
296                                                 }
297                                                 else {
298                                                         if (flags & SAVEDVAR)
299                                                                 printf("  I       ");
300                                                         else
301                                                                 printf("  i       ");
302                                                 }
303                                         }
304                                 }
305                                 printf("\n");
306                         }
307                         printf("\n");
308                 }
309         }
310
311         if (rd->memuse && irstage >= SHOW_REGS) {
312                 int max;
313
314                 max = rd->memuse;
315                 printf("Stack slots: (memuse=%d", rd->memuse);
316                 if (irstage >= SHOW_CODE) {
317                         printf(", stackframesize=%d", cd->stackframesize);
318                         max = cd->stackframesize;
319                 }
320                 printf(")\n");
321                 for (i = 0; i < max; ++i) {
322 #if defined(HAS_4BYTE_STACKSLOT)
323                         printf("    M%02d = 0x%02x(sp): ", i, i * 4);
324 #else
325                         printf("    M%02d = 0x%02x(sp): ", i, i * 8);
326 #endif
327                         for (j = 0; j < jd->vartop; ++j) {
328                                 varinfo *v = VAR(j);
329                                 if ((v->flags & INMEMORY) && (v->vv.regoff == i)) {
330                                         show_variable(jd, j, irstage);
331                                         putchar(' ');
332                                 }
333                         }
334
335                         printf("\n");
336
337                 }
338                 printf("\n");
339         }
340
341 #if defined(ENABLE_REPLACEMENT)
342         if (code->rplpoints) {
343                 printf("Replacement Points:\n");
344                 replace_show_replacement_points(code);
345                 printf("\n");
346         }
347 #endif /* defined(ENABLE_REPLACEMENT) */
348
349 #if defined(ENABLE_DISASSEMBLER)
350         /* show code before first basic block */
351
352         if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd)) {
353                 pc = (u1 *) ((ptrint) code->mcode + cd->dseglen);
354
355                 for (; pc < (u1 *) ((ptrint) code->mcode + cd->dseglen + jd->basicblocks[0].mpc);)
356                         DISASSINSTR(pc);
357
358                 printf("\n");
359         }
360 #endif
361
362         /* show code of all basic blocks */
363
364         for (bptr = jd->basicblocks; bptr != NULL; bptr = bptr->next)
365                 show_basicblock(jd, bptr, stage);
366
367 #if defined(ENABLE_DISASSEMBLER)
368         /* show stubs code */
369
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)));
374
375                 pc = (u1 *) ((ptrint) code->mcode + cd->dseglen + lastbptr->mpc);
376
377                 for (; (ptrint) pc < ((ptrint) code->mcode + code->mcodelength);)
378                         DISASSINSTR(pc);
379
380                 printf("\n");
381         }
382 #endif
383
384         LOCK_MONITOR_EXIT(show_global_lock);
385
386         /* finally flush the output */
387
388         fflush(stdout);
389 }
390 #endif /* !defined(NDEBUG) */
391
392
393 #if !defined(NDEBUG) && defined(ENABLE_INLINING)
394 static void show_inline_info(jitdata *jd, insinfo_inline *ii, s4 opcode, s4 stage)
395 {
396         s4 *jl;
397         s4 n;
398
399         printf("(pt %d+%d+%d st ", 
400                         ii->throughcount - (ii->stackvarscount - ii->paramcount),
401                         ii->stackvarscount - ii->paramcount,
402                         ii->paramcount);
403         show_variable_array(jd, ii->stackvars, ii->stackvarscount, stage);
404
405         if (opcode == ICMD_INLINE_START || opcode == ICMD_INLINE_END) {
406                 printf(" jl ");
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);
410         }
411
412         printf(") ");
413
414 #if 0
415         printf("(");
416         method_print(ii->outer);
417         printf(" ==> ");
418 #endif
419
420         method_print(ii->method);
421 }
422 #endif /* !defined(NDEBUG) && defined(ENABLE_INLINING) */
423
424
425 /* show_basicblock *************************************************************
426
427    Print the intermediate representation of a basic block.
428
429    NOTE: Currently this function may only be called after register allocation!
430
431 *******************************************************************************/
432
433 #if !defined(NDEBUG)
434 void show_basicblock(jitdata *jd, basicblock *bptr, int stage)
435 {
436         codeinfo    *code;
437         codegendata *cd;
438         s4           i;
439         bool         deadcode;
440         instruction *iptr;
441         int          irstage;
442 #if defined(ENABLE_DISASSEMBLER)
443         methodinfo  *m;                     /* this is only a dummy               */
444         u1          *pc;
445         s4           linenumber;
446         s4           currentlinenumber;
447 #endif
448
449         /* get required compiler data */
450
451         code = jd->code;
452         cd   = jd->cd;
453
454         if (bptr->flags != BBDELETED) {
455 #if defined(ENABLE_INTRP)
456                 if (opt_intrp) {
457                         deadcode = false;
458                         irstage = SHOW_PARSE;
459                 }
460                 else
461 #endif
462                 {
463                         deadcode = (bptr->flags < BBREACHED);
464                         irstage = stage;
465                 }
466
467                 printf("======== %sL%03d ======== %s(flags: %d, bitflags: %01x, next: %d, type: ",
468 #if defined(ENABLE_REPLACEMENT)
469                                 (bptr->bitflags & BBFLAG_REPLACEMENT) ? "<REPLACE> " : 
470 #endif
471                                                                                                                 "",
472                            bptr->nr, 
473                            (deadcode && stage >= SHOW_STACK) ? "DEADCODE! " : "",
474                            bptr->flags, bptr->bitflags, 
475                            (bptr->next) ? (bptr->next->nr) : -1);
476
477                 switch (bptr->type) {
478                 case BBTYPE_STD:
479                         printf("STD");
480                         break;
481                 case BBTYPE_EXH:
482                         printf("EXH");
483                         break;
484                 case BBTYPE_SBR:
485                         printf("SBR");
486                         break;
487                 }
488
489                 printf(", icount: %d", bptr->icount);
490
491                 if (irstage >= SHOW_CFG) {
492                         printf(", preds: %d [ ", bptr->predecessorcount);
493
494                         for (i = 0; i < bptr->predecessorcount; i++)
495                                 printf("%d ", bptr->predecessors[i]->nr);
496
497                         printf("]");
498                 }
499
500                 printf("):");
501
502                 if (bptr->original)
503                         printf(" (clone of L%03d)", bptr->original->nr);
504                 else {
505                         basicblock *b = bptr->copied_to;
506                         if (b) {
507                                 printf(" (copied to ");
508                                 for (; b; b = b->copied_to)
509                                         printf("L%03d ", b->nr);
510                                 printf(")");
511                         }
512                 }
513
514                 printf("\n");
515
516                 if (irstage >= SHOW_STACK) {
517                         printf("IN:  ");
518                         show_variable_array(jd, bptr->invars, bptr->indepth, irstage);
519                         printf(" javalocals: ");
520                         show_javalocals_array(jd, bptr->javalocals, bptr->method->maxlocals, irstage);
521                         printf("\n");
522                 }
523
524 #if defined(ENABLE_INLINING)
525                 if (bptr->inlineinfo) {
526                         printf("inlineinfo: ");
527                         show_inline_info(jd, bptr->inlineinfo, -1, irstage);
528                         printf("\n");
529                 }
530 #endif /* defined(ENABLE_INLINING) */
531
532                 iptr = bptr->iinstr;
533
534                 for (i = 0; i < bptr->icount; i++, iptr++) {
535                         printf("%4d:%4d:  ", iptr->line, iptr->flags.bits >> INS_FLAG_ID_SHIFT);
536
537                         show_icmd(jd, iptr, deadcode, irstage);
538                         printf("\n");
539                 }
540
541                 if (irstage >= SHOW_STACK) {
542                         printf("OUT: ");
543                         show_variable_array(jd, bptr->outvars, bptr->outdepth, irstage);
544                         printf("\n");
545                 }
546
547 #if defined(ENABLE_DISASSEMBLER)
548                 if ((stage >= SHOW_CODE) && JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd) &&
549                         (!deadcode)) 
550                 {
551                         printf("\n");
552                         pc         = (u1 *) (code->mcode + cd->dseglen + bptr->mpc);
553                         linenumber = 0;
554
555                         if (bptr->next != NULL) {
556                                 for (; pc < (u1 *) (code->mcode + cd->dseglen + bptr->next->mpc);) {
557                                         currentlinenumber =
558                                                 dseg_get_linenumber_from_pc(&m, code->entrypoint, pc);
559
560                                         if (currentlinenumber != linenumber) {
561                                                 linenumber = currentlinenumber;
562                                                 printf("%4d:\n", linenumber);
563                                         }
564
565                                         DISASSINSTR(pc);
566                                 }
567                         }
568                         else {
569                                 for (; pc < (u1 *) (code->mcode + code->mcodelength);) {
570                                         currentlinenumber =
571                                                 dseg_get_linenumber_from_pc(&m, code->entrypoint, pc);
572
573                                         if (currentlinenumber != linenumber) {
574                                                 linenumber = currentlinenumber;
575                                                 printf("%4d:\n", linenumber);
576                                         }
577
578                                         DISASSINSTR(pc);
579                                 }
580                         }
581                         printf("\n");
582                 }
583 #endif
584         }
585 }
586 #endif /* !defined(NDEBUG) */
587
588
589 /* show_icmd *******************************************************************
590
591    Print the intermediate representation of an instruction.
592
593    NOTE: Currently this function may only be called after register allocation!
594
595 *******************************************************************************/
596
597 #if !defined(NDEBUG)
598
599 #define SHOW_TARGET(target)                                          \
600         if (stage >= SHOW_PARSE) {                                   \
601             printf("--> L%03d ", (target).block->nr);                \
602         }                                                            \
603         else {                                                       \
604             printf("--> insindex %d ", (target).insindex);           \
605         }
606
607 #define SHOW_INT_CONST(val)                                          \
608         if (stage >= SHOW_PARSE) {                                   \
609             printf("%d (0x%08x) ", (val), (val));                    \
610         }                                                            \
611         else {                                                       \
612             printf("iconst ");                                       \
613         }
614
615 #if SIZEOF_VOID_P == 4
616 #define SHOW_LNG_CONST(val)                                          \
617         if (stage >= SHOW_PARSE)                                     \
618             printf("%lld (0x%016llx) ", (val), (val));               \
619         else                                                         \
620             printf("lconst ");
621 #else
622 #define SHOW_LNG_CONST(val)                                          \
623         if (stage >= SHOW_PARSE)                                     \
624             printf("%ld (0x%016lx) ", (val), (val));                 \
625         else                                                         \
626             printf("lconst ");
627 #endif
628
629 #if SIZEOF_VOID_P == 4
630 #define SHOW_ADR_CONST(val)                                          \
631         if (stage >= SHOW_PARSE)                                     \
632             printf("0x%08x ", (ptrint) (val));                       \
633         else                                                         \
634             printf("aconst ");
635 #else
636 #define SHOW_ADR_CONST(val)                                          \
637         if (stage >= SHOW_PARSE)                                     \
638             printf("0x%016lx ", (ptrint) (val));                     \
639         else                                                         \
640             printf("aconst ");
641 #endif
642
643 #define SHOW_FLT_CONST(val)                                          \
644         if (stage >= SHOW_PARSE) {                                   \
645             imm_union v;                                             \
646             v.f = (val);                                             \
647             printf("%g (0x%08x) ", (val), v.i);                      \
648         }                                                            \
649         else {                                                       \
650             printf("fconst ");                                       \
651         }
652
653 #if SIZEOF_VOID_P == 4
654 #define SHOW_DBL_CONST(val)                                          \
655         if (stage >= SHOW_PARSE) {                                   \
656             imm_union v;                                             \
657             v.d = (val);                                             \
658             printf("%g (0x%016llx) ", (val), v.l);                   \
659         }                                                            \
660         else                                                         \
661             printf("dconst ");
662 #else
663 #define SHOW_DBL_CONST(val)                                          \
664         if (stage >= SHOW_PARSE) {                                   \
665             imm_union v;                                             \
666             v.d = (val);                                             \
667             printf("%g (0x%016lx) ", (val), v.l);                    \
668         }                                                            \
669         else                                                         \
670             printf("dconst ");
671 #endif
672
673 #define SHOW_INDEX(index)                                            \
674         if (stage >= SHOW_PARSE) {                                   \
675             printf("%d ", index);                                    \
676         }                                                            \
677         else {                                                       \
678             printf("index");                                         \
679         }
680
681 #define SHOW_STRING(val)                                             \
682         if (stage >= SHOW_PARSE) {                                   \
683             putchar('"');                                            \
684             utf_display_printable_ascii(                             \
685                javastring_toutf((java_objectheader *)(val), false)); \
686             printf("\" ");                                           \
687         }                                                            \
688         else {                                                       \
689             printf("string ");                                       \
690         }
691
692 #define SHOW_CLASSREF_OR_CLASSINFO(c)                                \
693         if (stage >= SHOW_PARSE) {                                   \
694             if (IS_CLASSREF(c))                                      \
695                 class_classref_print(c.ref);                         \
696             else                                                     \
697                 class_print(c.cls);                                  \
698             putchar(' ');                                            \
699         }                                                            \
700         else {                                                       \
701             printf("class ");                                        \
702         }
703
704 #define SHOW_FIELD(fmiref)                                           \
705         if (stage >= SHOW_PARSE) {                                   \
706             field_fieldref_print(fmiref);                            \
707             putchar(' ');                                            \
708         }                                                            \
709         else {                                                       \
710             printf("field ");                                        \
711         }
712
713 #define SHOW_VARIABLE(v)                                             \
714     show_variable(jd, (v), stage)
715
716 #define SHOW_S1(iptr)                                                \
717         if (stage >= SHOW_STACK) {                                   \
718             SHOW_VARIABLE(iptr->s1.varindex);                        \
719         }
720
721 #define SHOW_S2(iptr)                                                \
722         if (stage >= SHOW_STACK) {                                   \
723             SHOW_VARIABLE(iptr->sx.s23.s2.varindex);                 \
724         }
725
726 #define SHOW_S3(iptr)                                                \
727     if (stage >= SHOW_STACK) {                                       \
728         SHOW_VARIABLE(iptr->sx.s23.s3.varindex);                     \
729     }
730
731 #define SHOW_DST(iptr)                                               \
732     if (stage >= SHOW_STACK) {                                       \
733         printf("=> ");                                               \
734         SHOW_VARIABLE(iptr->dst.varindex);                           \
735     }
736
737 #define SHOW_S1_LOCAL(iptr)                                          \
738     if (stage >= SHOW_STACK) {                                       \
739         printf("L%d ", iptr->s1.varindex);                           \
740     }                                                                \
741     else {                                                           \
742         printf("JavaL%d ", iptr->s1.varindex);                       \
743     }
744
745 #define SHOW_DST_LOCAL(iptr)                                         \
746     if (stage >= SHOW_STACK) {                                       \
747         printf("=> L%d ", iptr->dst.varindex);                       \
748     }                                                                \
749     else {                                                           \
750         printf("=> JavaL%d ", iptr->dst.varindex);                   \
751     }
752
753 void show_allocation(s4 type, s4 flags, s4 regoff)
754 {
755         if (type == TYPE_RET) {
756                 printf("N/A");
757                 return;
758         }
759
760         if (flags & INMEMORY) {
761                 printf("M%02d", regoff);
762                 return;
763         }
764
765 #ifdef HAS_ADDRESS_REGISTER_FILE
766         if (type == TYPE_ADR) {
767                 printf("R%02d", regoff);
768                 return;
769         }
770 #endif
771
772         if (IS_FLT_DBL_TYPE(type)) {
773                 printf("F%02d", regoff);
774                 return;
775         }
776
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)
781                 if (opt_intrp)
782                         printf("%3d/%3d", GET_LOW_REG(regoff),
783                                         GET_HIGH_REG(regoff));
784                 else
785 #  endif
786                         printf("%3s/%3s", abi_registers_integer_name[GET_LOW_REG(regoff)],
787                                    abi_registers_integer_name[GET_HIGH_REG(regoff)]);
788 # else
789                 printf("%3d/%3d", GET_LOW_REG(regoff),
790                            GET_HIGH_REG(regoff));
791 # endif
792                 return;
793         } 
794 #endif /* defined(SUPPORT_COMBINE_INTEGER_REGISTERS) */
795
796 #if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
797 # if defined(ENABLE_INTRP)
798         if (opt_intrp)
799                 printf("%3d", regoff);
800         else
801 # endif
802                 printf("%3s", abi_registers_integer_name[regoff]);
803 #else
804         printf("%3d", regoff);
805 #endif
806 }
807
808 void show_variable(jitdata *jd, s4 index, int stage)
809 {
810         show_variable_intern(jd, index, stage);
811         putchar(' ');
812 }
813
814 static void show_variable_intern(jitdata *jd, s4 index, int stage)
815 {
816         char type;
817         char kind;
818         varinfo *v;
819
820         if (index < 0 || index >= jd->vartop) {
821                 printf("<INVALID INDEX:%d>", index);
822                 return;
823         }
824
825         v = VAR(index);
826
827         switch (v->type) {
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;
834                 default:       type = '?';
835         }
836
837         if (index < jd->localcount) {
838                 kind = 'L';
839                 if (v->flags & (PREALLOC | INOUT))
840                                 printf("<INVALID FLAGS!>");
841         }
842         else {
843                 if (v->flags & PREALLOC) {
844                         kind = 'A';
845                         if (v->flags & INOUT) {
846                                 /* PREALLOC is used to avoid allocation of TYPE_RET */
847                                 if (v->type == TYPE_RET)
848                                         kind = 'i';
849                                 else
850                                         printf("<INVALID FLAGS!>");
851                         }
852                 }
853                 else if (v->flags & INOUT)
854                         kind = 'I';
855                 else
856                         kind = 'T';
857         }
858
859         printf("%c%c%d", kind, type, index);
860
861         if (v->flags & SAVEDVAR)
862                 putchar('!');
863
864         if (stage >= SHOW_REGS || (v->flags & PREALLOC)) {
865                 putchar('(');
866                 show_allocation(v->type, v->flags, v->vv.regoff);
867                 putchar(')');
868         }
869
870         if (v->type == TYPE_RET && (v->flags & PREALLOC)) {
871                 printf("(L%03d)", v->vv.retaddr->nr);
872         }
873 }
874
875 static void show_variable_array_intern(jitdata *jd, s4 *vars, int n, int stage,
876                                                                            bool javalocals)
877 {
878         int i;
879         int nr;
880
881         if (vars == NULL) {
882                 printf("<null>");
883                 return;
884         }
885
886         printf("[");
887         for (i=0; i<n; ++i) {
888                 if (i)
889                         putchar(' ');
890                 if (vars[i] < 0) {
891                         if (vars[i] == UNUSED)
892                                 putchar('-');
893                         else if (javalocals) {
894                                 nr = RETADDR_FROM_JAVALOCAL(vars[i]);
895                                 printf("ret(L%03d)", nr);
896                         }
897                         else {
898                                 printf("<INVALID INDEX:%d>", vars[i]);
899                         }
900                 }
901                 else
902                         show_variable_intern(jd, vars[i], stage);
903         }
904         printf("]");
905 }
906
907 void show_variable_array(jitdata *jd, s4 *vars, int n, int stage)
908 {
909         show_variable_array_intern(jd, vars, n, stage, false);
910 }
911
912 void show_javalocals_array(jitdata *jd, s4 *vars, int n, int stage)
913 {
914         show_variable_array_intern(jd, vars, n, stage, true);
915 }
916
917 void show_icmd(jitdata *jd, instruction *iptr, bool deadcode, int stage)
918 {
919         u2                 opcode;
920         branch_target_t   *table;
921         lookup_target_t   *lookup;
922         constant_FMIref   *fmiref;
923         s4                *argp;
924         s4                 i;
925
926         /* get the opcode and the condition */
927
928         opcode    =  iptr->opc;
929
930         printf("%s ", icmd_table[opcode].name);
931
932         if (stage < SHOW_PARSE)
933                 return;
934
935         if (deadcode)
936                 stage = SHOW_PARSE;
937
938         /* Print the condition for conditional instructions. */
939
940         /* XXX print condition from flags */
941
942         if (iptr->flags.bits & INS_FLAG_UNRESOLVED)
943                 printf("(UNRESOLVED) ");
944
945         switch (opcode) {
946
947         case ICMD_POP:
948         case ICMD_CHECKNULL:
949                 SHOW_S1(iptr);
950                 break;
951
952                 /* unary */
953         case ICMD_ARRAYLENGTH:
954         case ICMD_INEG:
955         case ICMD_LNEG:
956         case ICMD_FNEG:
957         case ICMD_DNEG:
958         case ICMD_I2L:
959         case ICMD_I2F:
960         case ICMD_I2D:
961         case ICMD_L2I:
962         case ICMD_L2F:
963         case ICMD_L2D:
964         case ICMD_F2I:
965         case ICMD_F2L:
966         case ICMD_F2D:
967         case ICMD_D2I:
968         case ICMD_D2L:
969         case ICMD_D2F:
970         case ICMD_INT2BYTE:
971         case ICMD_INT2CHAR:
972         case ICMD_INT2SHORT:
973                 SHOW_S1(iptr);
974                 SHOW_DST(iptr);
975                 break;
976
977                 /* binary */
978         case ICMD_IADD:
979         case ICMD_LADD:
980         case ICMD_FADD:
981         case ICMD_DADD:
982         case ICMD_ISUB:
983         case ICMD_LSUB:
984         case ICMD_FSUB:
985         case ICMD_DSUB:
986         case ICMD_IMUL:
987         case ICMD_LMUL:
988         case ICMD_FMUL:
989         case ICMD_DMUL:
990         case ICMD_IDIV:
991         case ICMD_LDIV:
992         case ICMD_FDIV:
993         case ICMD_DDIV:
994         case ICMD_IREM:
995         case ICMD_LREM:
996         case ICMD_FREM:
997         case ICMD_DREM:
998         case ICMD_ISHL:
999         case ICMD_LSHL:
1000         case ICMD_ISHR:
1001         case ICMD_LSHR:
1002         case ICMD_IUSHR:
1003         case ICMD_LUSHR:
1004         case ICMD_IAND:
1005         case ICMD_LAND:
1006         case ICMD_IOR:
1007         case ICMD_LOR:
1008         case ICMD_IXOR:
1009         case ICMD_LXOR:
1010         case ICMD_LCMP:
1011         case ICMD_FCMPL:
1012         case ICMD_FCMPG:
1013         case ICMD_DCMPL:
1014         case ICMD_DCMPG:
1015                 SHOW_S1(iptr);
1016                 SHOW_S2(iptr);
1017                 SHOW_DST(iptr);
1018                 break;
1019
1020                 /* binary/const INT */
1021         case ICMD_IADDCONST:
1022         case ICMD_ISUBCONST:
1023         case ICMD_IMULCONST:
1024         case ICMD_IMULPOW2:
1025         case ICMD_IDIVPOW2:
1026         case ICMD_IREMPOW2:
1027         case ICMD_IANDCONST:
1028         case ICMD_IORCONST:
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:
1036                 SHOW_S1(iptr);
1037                 SHOW_INT_CONST(iptr->sx.val.i); 
1038                 SHOW_DST(iptr);
1039                 break;
1040
1041                 /* ?ASTORECONST (trinary/const INT) */
1042         case ICMD_IASTORECONST:
1043         case ICMD_BASTORECONST:
1044         case ICMD_CASTORECONST:
1045         case ICMD_SASTORECONST:
1046                 SHOW_S1(iptr);
1047                 SHOW_S2(iptr);
1048                 SHOW_INT_CONST(iptr->sx.s23.s3.constval);
1049                 break;
1050
1051                 /* const INT */
1052         case ICMD_ICONST:
1053                 SHOW_INT_CONST(iptr->sx.val.i); 
1054                 SHOW_DST(iptr);
1055                 break;
1056
1057                 /* binary/const LNG */
1058         case ICMD_LADDCONST:
1059         case ICMD_LSUBCONST:
1060         case ICMD_LMULCONST:
1061         case ICMD_LMULPOW2:
1062         case ICMD_LDIVPOW2:
1063         case ICMD_LREMPOW2:
1064         case ICMD_LANDCONST:
1065         case ICMD_LORCONST:
1066         case ICMD_LXORCONST:
1067                 SHOW_S1(iptr);
1068                 SHOW_LNG_CONST(iptr->sx.val.l);
1069                 SHOW_DST(iptr);
1070                 break;
1071
1072                 /* trinary/const LNG (<= pointer size) */
1073         case ICMD_LASTORECONST:
1074                 SHOW_S1(iptr);
1075                 SHOW_S2(iptr);
1076                 SHOW_ADR_CONST(iptr->sx.s23.s3.constval);
1077                 break;
1078
1079                 /* const LNG */
1080         case ICMD_LCONST:
1081                 SHOW_LNG_CONST(iptr->sx.val.l); 
1082                 SHOW_DST(iptr);
1083                 break;
1084
1085                 /* const FLT */
1086         case ICMD_FCONST:
1087                 SHOW_FLT_CONST(iptr->sx.val.f); 
1088                 SHOW_DST(iptr);
1089                 break;
1090
1091                 /* const DBL */
1092         case ICMD_DCONST:
1093                 SHOW_DBL_CONST(iptr->sx.val.d); 
1094                 SHOW_DST(iptr);
1095                 break;
1096
1097                 /* const ADR */
1098         case ICMD_ACONST:
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);
1102                 }
1103                 else if (iptr->sx.val.anyptr == NULL) {
1104                         printf("NULL ");
1105                 }
1106                 else {
1107                         SHOW_ADR_CONST(iptr->sx.val.anyptr);
1108                         SHOW_STRING(iptr->sx.val.stringconst);
1109                 }
1110                 SHOW_DST(iptr);
1111                 break;
1112
1113         case ICMD_AASTORECONST:
1114                 SHOW_S1(iptr);
1115                 SHOW_S2(iptr);
1116                 printf("%p ", (void*) iptr->sx.s23.s3.constval);
1117                 break;
1118
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) {
1126                         SHOW_S1(iptr);
1127                         if (opcode == ICMD_PUTFIELD) {
1128                                 SHOW_S2(iptr);
1129                         }
1130                 }
1131                 INSTRUCTION_GET_FIELDREF(iptr, fmiref);
1132                 SHOW_FIELD(fmiref);
1133
1134                 if (opcode == ICMD_GETSTATIC || opcode == ICMD_GETFIELD) {
1135                         SHOW_DST(iptr);
1136                 }
1137                 break;
1138
1139         case ICMD_IINC:
1140                 SHOW_S1_LOCAL(iptr);
1141                 SHOW_INT_CONST(iptr->sx.val.i);
1142                 SHOW_DST_LOCAL(iptr);
1143                 break;
1144
1145         case ICMD_IASTORE:
1146         case ICMD_SASTORE:
1147         case ICMD_BASTORE:
1148         case ICMD_CASTORE:
1149         case ICMD_LASTORE:
1150         case ICMD_DASTORE:
1151         case ICMD_FASTORE:
1152         case ICMD_AASTORE:
1153                 SHOW_S1(iptr);
1154                 SHOW_S2(iptr);
1155                 SHOW_S3(iptr);
1156                 break;
1157
1158         case ICMD_IALOAD:
1159         case ICMD_SALOAD:
1160         case ICMD_BALOAD:
1161         case ICMD_CALOAD:
1162         case ICMD_LALOAD:
1163         case ICMD_DALOAD:
1164         case ICMD_FALOAD:
1165         case ICMD_AALOAD:
1166                 SHOW_S1(iptr);
1167                 SHOW_S2(iptr);
1168                 SHOW_DST(iptr);
1169                 break;
1170
1171         case ICMD_RET:
1172                 SHOW_S1_LOCAL(iptr);
1173                 if (stage >= SHOW_STACK) {
1174                         printf(" ---> L%03d", iptr->dst.block->nr);
1175                 }
1176                 break;
1177
1178         case ICMD_ILOAD:
1179         case ICMD_LLOAD:
1180         case ICMD_FLOAD:
1181         case ICMD_DLOAD:
1182         case ICMD_ALOAD:
1183                 SHOW_S1_LOCAL(iptr);
1184                 SHOW_DST(iptr);
1185                 break;
1186
1187         case ICMD_ISTORE:
1188         case ICMD_LSTORE:
1189         case ICMD_FSTORE:
1190         case ICMD_DSTORE:
1191         case ICMD_ASTORE:
1192                 SHOW_S1(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));
1198                 }
1199                 break;
1200
1201         case ICMD_NEW:
1202                 SHOW_DST(iptr);
1203                 break;
1204
1205         case ICMD_NEWARRAY:
1206                 SHOW_DST(iptr);
1207                 break;
1208
1209         case ICMD_ANEWARRAY:
1210                 SHOW_DST(iptr);
1211                 break;
1212
1213         case ICMD_MULTIANEWARRAY:
1214                 if (stage >= SHOW_STACK) {
1215                         argp = iptr->sx.s23.s2.args;
1216                         i = iptr->s1.argcount;
1217                         while (i--) {
1218                                 SHOW_VARIABLE(*(argp++));
1219                         }
1220                 }
1221                 else {
1222                         printf("argcount=%d ", iptr->s1.argcount);
1223                 }
1224                 SHOW_DST(iptr);
1225                 break;
1226
1227         case ICMD_CHECKCAST:
1228                 SHOW_S1(iptr);
1229                 putchar(' ');
1230                 class_classref_or_classinfo_print(iptr->sx.s23.s3.c);
1231                 SHOW_DST(iptr);
1232                 break;
1233
1234         case ICMD_INSTANCEOF:
1235                 SHOW_S1(iptr);
1236                 SHOW_DST(iptr);
1237                 break;
1238
1239         case ICMD_INLINE_START:
1240         case ICMD_INLINE_END:
1241         case ICMD_INLINE_BODY:
1242 #if defined(ENABLE_INLINING)
1243                 {
1244                         insinfo_inline *ii = iptr->sx.s23.s3.inlineinfo;
1245                         show_inline_info(jd, ii, opcode, stage);
1246                 }
1247 #endif
1248                 break;
1249
1250         case ICMD_BUILTIN:
1251                 if (stage >= SHOW_STACK) {
1252                         argp = iptr->sx.s23.s2.args;
1253                         i = iptr->s1.argcount;
1254                         while (i--) {
1255                                 if ((iptr->s1.argcount - 1 - i) == iptr->sx.s23.s3.bte->md->paramcount)
1256                                         printf(" pass-through: ");
1257                                 SHOW_VARIABLE(*(argp++));
1258                         }
1259                 }
1260                 printf("%s ", iptr->sx.s23.s3.bte->cname);
1261                 if (iptr->sx.s23.s3.bte->md->returntype.type != TYPE_VOID) {
1262                         SHOW_DST(iptr);
1263                 }
1264                 break;
1265
1266         case ICMD_INVOKEVIRTUAL:
1267         case ICMD_INVOKESPECIAL:
1268         case ICMD_INVOKESTATIC:
1269         case ICMD_INVOKEINTERFACE:
1270                 if (stage >= SHOW_STACK) {
1271                         methoddesc *md;
1272                         INSTRUCTION_GET_METHODDESC(iptr, md);
1273                         argp = iptr->sx.s23.s2.args;
1274                         i = iptr->s1.argcount;
1275                         while (i--) {
1276                                 if ((iptr->s1.argcount - 1 - i) == md->paramcount)
1277                                         printf(" pass-through: ");
1278                                 SHOW_VARIABLE(*(argp++));
1279                         }
1280                 }
1281                 INSTRUCTION_GET_METHODREF(iptr, fmiref);
1282                 method_methodref_print(fmiref);
1283                 if (fmiref->parseddesc.md->returntype.type != TYPE_VOID) {
1284                         putchar(' ');
1285                         SHOW_DST(iptr);
1286                 }
1287                 break;
1288
1289         case ICMD_IFEQ:
1290         case ICMD_IFNE:
1291         case ICMD_IFLT:
1292         case ICMD_IFGE:
1293         case ICMD_IFGT:
1294         case ICMD_IFLE:
1295                 SHOW_S1(iptr);
1296                 SHOW_INT_CONST(iptr->sx.val.i); 
1297                 SHOW_TARGET(iptr->dst);
1298                 break;
1299
1300         case ICMD_IF_LEQ:
1301         case ICMD_IF_LNE:
1302         case ICMD_IF_LLT:
1303         case ICMD_IF_LGE:
1304         case ICMD_IF_LGT:
1305         case ICMD_IF_LLE:
1306                 SHOW_S1(iptr);
1307                 SHOW_LNG_CONST(iptr->sx.val.l); 
1308                 SHOW_TARGET(iptr->dst);
1309                 break;
1310
1311         case ICMD_GOTO:
1312                 SHOW_TARGET(iptr->dst);
1313                 break;
1314
1315         case ICMD_JSR:
1316                 SHOW_TARGET(iptr->sx.s23.s3.jsrtarget);
1317                 SHOW_DST(iptr);
1318                 break;
1319
1320         case ICMD_IFNULL:
1321         case ICMD_IFNONNULL:
1322                 SHOW_S1(iptr);
1323                 SHOW_TARGET(iptr->dst);
1324                 break;
1325
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:
1332
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:
1339
1340         case ICMD_IF_FCMPEQ:
1341         case ICMD_IF_FCMPNE:
1342
1343         case ICMD_IF_FCMPL_LT:
1344         case ICMD_IF_FCMPL_GE:
1345         case ICMD_IF_FCMPL_GT:
1346         case ICMD_IF_FCMPL_LE:
1347
1348         case ICMD_IF_FCMPG_LT:
1349         case ICMD_IF_FCMPG_GE:
1350         case ICMD_IF_FCMPG_GT:
1351         case ICMD_IF_FCMPG_LE:
1352
1353         case ICMD_IF_DCMPEQ:
1354         case ICMD_IF_DCMPNE:
1355
1356         case ICMD_IF_DCMPL_LT:
1357         case ICMD_IF_DCMPL_GE:
1358         case ICMD_IF_DCMPL_GT:
1359         case ICMD_IF_DCMPL_LE:
1360
1361         case ICMD_IF_DCMPG_LT:
1362         case ICMD_IF_DCMPG_GE:
1363         case ICMD_IF_DCMPG_GT:
1364         case ICMD_IF_DCMPG_LE:
1365
1366         case ICMD_IF_ACMPEQ:
1367         case ICMD_IF_ACMPNE:
1368                 SHOW_S1(iptr);
1369                 SHOW_S2(iptr);
1370                 SHOW_TARGET(iptr->dst);
1371                 break;
1372
1373         case ICMD_TABLESWITCH:
1374                 SHOW_S1(iptr);
1375                 table = iptr->dst.table;
1376
1377                 i = iptr->sx.s23.s3.tablehigh - iptr->sx.s23.s2.tablelow + 1;
1378
1379                 printf("high=%d low=%d count=%d\n", iptr->sx.s23.s3.tablehigh, iptr->sx.s23.s2.tablelow, i);
1380                 while (--i >= 0) {
1381                         printf("\t\t%d --> ", (int) (table - iptr->dst.table));
1382                         printf("L%03d\n", table->block->nr);
1383                         table++;
1384                 }
1385
1386                 break;
1387
1388         case ICMD_LOOKUPSWITCH:
1389                 SHOW_S1(iptr);
1390
1391                 printf("count=%d, default=L%03d\n",
1392                            iptr->sx.s23.s2.lookupcount,
1393                            iptr->sx.s23.s3.lookupdefault.block->nr);
1394
1395                 lookup = iptr->dst.lookup;
1396                 i = iptr->sx.s23.s2.lookupcount;
1397
1398                 while (--i >= 0) {
1399                         printf("\t\t%d --> L%03d\n",
1400                                    lookup->value,
1401                                    lookup->target.block->nr);
1402                         lookup++;
1403                 }
1404                 break;
1405
1406         case ICMD_FRETURN:
1407         case ICMD_IRETURN:
1408         case ICMD_DRETURN:
1409         case ICMD_LRETURN:
1410                 SHOW_S1(iptr);
1411                 break;
1412
1413         case ICMD_ARETURN:
1414         case ICMD_ATHROW:
1415                 SHOW_S1(iptr);
1416                 if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
1417                         /* XXX this needs more work */
1418 #if 0
1419                         unresolved_class_debug_dump(iptr->sx.s23.s2.uc, stdout);
1420 #endif
1421                 }
1422                 break;
1423
1424         case ICMD_COPY:
1425         case ICMD_MOVE:
1426                 SHOW_S1(iptr);
1427                 SHOW_DST(iptr);
1428                 break;
1429         }
1430         fflush(stdout);
1431 }
1432 #endif /* !defined(NDEBUG) */
1433
1434
1435 /*
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  * ---------------------------------------------------------------------
1440  * Local variables:
1441  * mode: c
1442  * indent-tabs-mode: t
1443  * c-basic-offset: 4
1444  * tab-width: 4
1445  * End:
1446  * vim:noexpandtab:sw=4:ts=4:
1447  */