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