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