Enable lazy loading for i386.
[cacao.git] / src / vm / jit / stack.c
index 83352522cf2ca7c74d96b6df9e2c7dfd433790a6..231d4ff1b96e967153f6d88b6ede760dfdf3905f 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Edwin Steiner
             Christian Thalinger
 
-   $Id: stack.c 2218 2005-04-05 15:26:35Z christian $
+   $Id: stack.c 2333 2005-04-22 13:26:36Z twisti $
 
 */
 
@@ -46,6 +46,7 @@
 #include "vm/global.h"
 #include "vm/builtin.h"
 #include "vm/options.h"
+#include "vm/resolve.h"
 #include "vm/statistics.h"
 #include "vm/tables.h"
 #include "vm/jit/codegen.inc.h"
@@ -97,10 +98,8 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
        void* *tptr;
        s4 *argren;
 
-#ifdef INVOKE_NEW
        s4 call_argcount;
        s4 call_returntype;
-#endif
 
 #ifdef LSRA
        m->maxlifetimes = 0;
@@ -128,7 +127,7 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                NEWXSTACK;
        }
 
-#ifdef CONDITIONAL_LOADCONST
+#if CONDITIONAL_LOADCONST
        b_count = m->basicblockcount;
        bptr = m->basicblocks;
        while (--b_count >= 0) {
@@ -195,7 +194,7 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                }
                bptr++;
        }
-#endif
+#endif /* CONDITIONAL_LOADCONST */
 
 
        do {
@@ -235,7 +234,8 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                                b_index = bptr - m->basicblocks;
                                while (--len >= 0)  {
                                        opcode = iptr->opc;
-                                       iptr->target = NULL;
+                                        /* XXX TWISTI: why is this set to NULL here? */
+ /*                 iptr->target = NULL; */
 
 /*                                     dolog("p: %04d op: %s stack: %p", iptr - instr, icmd_names[opcode], curstack); */
 
@@ -537,6 +537,7 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                                                                iptr[0].op1 = iptr[1].op1;
                                                                bptr->icount--;
                                                                len--;
+#if 1
                                                                /* iptr[1].opc = ICMD_NOP; */
                                                                OP1_0(TYPE_INT);
                                                                tbptr = m->basicblocks + m->basicblockindex[iptr->op1];
@@ -545,6 +546,9 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
 
                                                                MARKREACHED(tbptr, copy);
                                                                COUNT(count_pcmd_bra);
+#else
+                                                               goto icmd_if;
+#endif
                                                                break;
                                                        case ICMD_IF_ICMPLT:
                                                                iptr[0].opc = ICMD_IFLT;
@@ -1172,64 +1176,77 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                                        case ICMD_IFGE:
                                        case ICMD_IFGT:
                                        case ICMD_IFLE:
+#if 0
+                                       icmd_if:
+#endif
                                                COUNT(count_pcmd_bra);
-#ifdef CONDITIONAL_LOADCONST
-                                               {
-                                                       tbptr = m->basicblocks + b_index;
-                                                       if ((b_count >= 3) &&
-                                                           ((b_index + 2) == m->basicblockindex[iptr[0].op1]) &&
-                                                           (tbptr[1].pre_count == 1) &&
-                                                           (iptr[1].opc == ICMD_ICONST) &&
-                                                           (iptr[2].opc == ICMD_GOTO)   &&
-                                                           ((b_index + 3) == m->basicblockindex[iptr[2].op1]) &&
-                                                           (tbptr[2].pre_count == 1) &&
-                                                           (iptr[3].opc == ICMD_ICONST)) {
-                                                               OP1_1(TYPE_INT, TYPE_INT);
-                                                               switch (iptr[0].opc) {
-                                                               case ICMD_IFEQ:
-                                                                       iptr[0].opc = ICMD_IFNE_ICONST;
-                                                                       break;
-                                                               case ICMD_IFNE:
-                                                                       iptr[0].opc = ICMD_IFEQ_ICONST;
-                                                                       break;
-                                                               case ICMD_IFLT:
-                                                                       iptr[0].opc = ICMD_IFGE_ICONST;
-                                                                       break;
-                                                               case ICMD_IFGE:
-                                                                       iptr[0].opc = ICMD_IFLT_ICONST;
-                                                                       break;
-                                                               case ICMD_IFGT:
-                                                                       iptr[0].opc = ICMD_IFLE_ICONST;
-                                                                       break;
-                                                               case ICMD_IFLE:
-                                                                       iptr[0].opc = ICMD_IFGT_ICONST;
-                                                                       break;
-                                                               }
-                                                               iptr[0].val.i = iptr[1].val.i;
-                                                               iptr[1].opc = ICMD_ELSE_ICONST;
-                                                               iptr[1].val.i = iptr[3].val.i;
-                                                               iptr[2].opc = ICMD_NOP;
-                                                               iptr[3].opc = ICMD_NOP;
-                                                               tbptr[1].flags = BBDELETED;
-                                                               tbptr[2].flags = BBDELETED;
-                                                               tbptr[1].icount = 0;
-                                                               tbptr[2].icount = 0;
-                                                               if (tbptr[3].pre_count == 2) {
-                                                                       len += tbptr[3].icount + 3;
-                                                                       bptr->icount += tbptr[3].icount + 3;
-                                                                       tbptr[3].flags = BBDELETED;
-                                                                       tbptr[3].icount = 0;
-                                                                       b_index++;
-                                                               }
-                                                               else {
-                                                                       bptr->icount++;
-                                                                       len ++;
-                                                               }
-                                                               b_index += 2;
+#if CONDITIONAL_LOADCONST
+                                               tbptr = m->basicblocks + b_index;
+                                               if ((b_count >= 3) &&
+                                                       ((b_index + 2) == m->basicblockindex[iptr[0].op1]) &&
+                                                       (tbptr[1].pre_count == 1) &&
+                                                       (tbptr[1].iinstr[0].opc == ICMD_ICONST) &&
+                                                       (tbptr[1].iinstr[1].opc == ICMD_GOTO)   &&
+                                                       ((b_index + 3) == m->basicblockindex[tbptr[1].iinstr[1].op1]) &&
+                                                       (tbptr[2].pre_count == 1) &&
+                                                       (tbptr[2].iinstr[0].opc == ICMD_ICONST)) {
+                                                       OP1_1(TYPE_INT, TYPE_INT);
+                                                       switch (iptr[0].opc) {
+                                                       case ICMD_IFEQ:
+                                                               iptr[0].opc = ICMD_IFNE_ICONST;
+                                                               break;
+                                                       case ICMD_IFNE:
+                                                               iptr[0].opc = ICMD_IFEQ_ICONST;
+                                                               break;
+                                                       case ICMD_IFLT:
+                                                               iptr[0].opc = ICMD_IFGE_ICONST;
+                                                               break;
+                                                       case ICMD_IFGE:
+                                                               iptr[0].opc = ICMD_IFLT_ICONST;
+                                                               break;
+                                                       case ICMD_IFGT:
+                                                               iptr[0].opc = ICMD_IFLE_ICONST;
+                                                               break;
+                                                       case ICMD_IFLE:
+                                                               iptr[0].opc = ICMD_IFGT_ICONST;
                                                                break;
                                                        }
-                                               }
+#if 1
+                                                       iptr[0].val.i = iptr[1].val.i;
+                                                       iptr[1].opc = ICMD_ELSE_ICONST;
+                                                       iptr[1].val.i = iptr[3].val.i;
+                                                       iptr[2].opc = ICMD_NOP;
+                                                       iptr[3].opc = ICMD_NOP;
+#else
+                                                       /* HACK: save compare value in iptr[1].op1 */    
+                                                       iptr[1].op1 = iptr[0].val.i;     
+                                                       iptr[0].val.i = tbptr[1].iinstr[0].val.i;        
+                                                       iptr[1].opc = ICMD_ELSE_ICONST;          
+                                                       iptr[1].val.i = tbptr[2].iinstr[0].val.i;        
+                                                       tbptr[1].iinstr[0].opc = ICMD_NOP;       
+                                                       tbptr[1].iinstr[1].opc = ICMD_NOP;       
+                                                       tbptr[2].iinstr[0].opc = ICMD_NOP;       
 #endif
+                                                       tbptr[1].flags = BBDELETED;
+                                                       tbptr[2].flags = BBDELETED;
+                                                       tbptr[1].icount = 0;
+                                                       tbptr[2].icount = 0;
+                                                       if (tbptr[3].pre_count == 2) {
+                                                               len += tbptr[3].icount + 3;
+                                                               bptr->icount += tbptr[3].icount + 3;
+                                                               tbptr[3].flags = BBDELETED;
+                                                               tbptr[3].icount = 0;
+                                                               b_index++;
+                                                       }
+                                                       else {
+                                                               bptr->icount++;
+                                                               len ++;
+                                                       }
+                                                       b_index += 2;
+                                                       break;
+                                               }
+#endif /* CONDITIONAL_LOADCONST */
+
                                                OP1_0(TYPE_INT);
                                                tbptr = m->basicblocks + m->basicblockindex[iptr->op1];
 
@@ -1835,7 +1852,6 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                                                break;
 
                                                /* pop many push any */
-#ifdef INVOKE_NEW
                                case ICMD_BUILTIN3:
                                                call_argcount = 3;
                                                call_returntype = iptr->op1;
@@ -1857,180 +1873,65 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                                                call_returntype = iptr->op1;
                                                goto _callhandling;
 
-#endif
                                        case ICMD_INVOKEVIRTUAL:
                                        case ICMD_INVOKESPECIAL:
                                        case ICMD_INVOKEINTERFACE:
                                        case ICMD_INVOKESTATIC:
                                                COUNT(count_pcmd_met);
                                                {
+#if defined(__X86_64__) || defined(__I386__)
+                                                       unresolved_method *um = iptr->target;    
+/*                          if (lm->flags & ACC_STATIC) */
+/*                              {COUNT(count_check_null);} */   
+                                                       call_argcount = iptr->op1;       
+                                                       call_returntype = um->methodref->parseddesc.md->returntype.type;         
+#else
                                                        methodinfo *lm = iptr->val.a;
                                                        if (lm->flags & ACC_STATIC)
                                                                {COUNT(count_check_null);}
-#ifdef INVOKE_NEW
                                                        call_argcount = iptr->op1;
                                                        call_returntype = lm->returntype;
+#endif
 
                                                _callhandling:
                                                        i = call_argcount;
 
-#else
-                                                       i = iptr->op1;
-#endif
-                                                       
                                                        if (i > rd->arguments_num)
                                                                rd->arguments_num = i;
                                                        REQUIRE(i);
-#if defined(INVOKE_NEW)
-                                                       /* Macro in codegen.h */
 
+                                                       /* Macro in codegen.h */
                                                        SET_ARG_STACKSLOTS;
 
-#else
-#if defined(__X86_64__)
-                                                       {
-                                                               s4 iarg = 0;
-                                                               s4 farg = 0;
-                                                               s4 stackargs = 0;
-
-                                                               /* count integer and float arguments */
-
-                                                               copy = curstack;
-                                                               while (--i >= 0) {
-                                                                       (IS_FLT_DBL_TYPE(copy->type)) ? farg++ : iarg++;
-                                                                       copy = copy->prev;
-                                                               }
-
-                                                               /* calculate stack space required */
-
-                                                               stackargs += (iarg < INT_ARG_CNT) ?
-                                                                       0 : (iarg - INT_ARG_CNT);
-                                                               stackargs += (farg < FLT_ARG_CNT) ?
-                                                                       0 : (farg - FLT_ARG_CNT);
-
-                                                               i = iptr->op1;
-                                                               copy = curstack;
-                                                               while (--i >= 0) {
-                                                                       if (!(copy->flags & SAVEDVAR)) {
-                                                                               copy->varkind = ARGVAR;
-
-                                                                               if (IS_FLT_DBL_TYPE(copy->type)) {
-                                                                                       if (--farg < FLT_ARG_CNT)
-                                                                                               copy->varnum = farg;
-                                                                                       else
-                                                                                               copy->varnum = --stackargs + FLT_ARG_CNT;
-
-                                                                               } else {
-                                                                                       if (--iarg < INT_ARG_CNT)
-                                                                                               copy->varnum = iarg;
-                                                                                       else
-                                                                                               copy->varnum = --stackargs + INT_ARG_CNT;
-                                                                               }
-
-                                                                       } else {
-                                                                               (IS_FLT_DBL_TYPE(copy->type)) ? --farg : --iarg;
-                                                                       }
-                                                                       copy = copy->prev;
-                                                               }
-                                                       }
-#else /* defined(__X86_64__) */
-                                                       copy = curstack;
-                                                       while (--i >= 0) {
-                                                               if (!(copy->flags & SAVEDVAR)) {
-                                                                       copy->varkind = ARGVAR;
-                                                                       copy->varnum = i;
-                                                               }
-                                                               copy = copy->prev;
-                                                       }
-#endif /* defined(__X86_64__) */
-#endif /* defined(INVOKE_NEW) */
                                                        while (copy) {
                                                                copy->flags |= SAVEDVAR;
                                                                copy = copy->prev;
                                                        }
-#ifdef INVOKE_NEW
                                                        i = call_argcount;
-#else
-                                                       i = iptr->op1;
-#endif
+
                                                        POPMANY(i);
-#ifdef INVOKE_NEW
                                                        if (call_returntype != TYPE_VOID)
                                                                OP0_1(call_returntype);
-#else
-                                                       if (lm->returntype != TYPE_VOID)
-                                                               OP0_1(lm->returntype);
-#endif
                                                        break;
                                                }
+
                                        case ICMD_INLINE_START:
                                        case ICMD_INLINE_END:
                                                SETDST;
                                                break;
-#ifndef INVOKE_NEW
-                                       case ICMD_BUILTIN3:
-                                               /* DEBUG */ /*dolog("builtin3");*/
-                                               REQUIRE_3;
-                                               if (!(curstack->flags & SAVEDVAR)) {
-                                                       curstack->varkind = ARGVAR;
-                                                       curstack->varnum = 2;
-                                               }
-                                               if (3 > rd->arguments_num) {
-                                                       rd->arguments_num = 3;
-                                               }
-                                               OP1_0ANY;
 
-                                       case ICMD_BUILTIN2:
-#if defined(USEBUILTINTABLE) || !SUPPORT_DIVISION
-                                       /* Just prevent a compiler warning... */
-                                       builtin2:
-#endif
-                                               REQUIRE_2;
-                                               /* DEBUG */ /*dolog("builtin2");*/
-                                       if (!(curstack->flags & SAVEDVAR)) {
-                                               curstack->varkind = ARGVAR;
-                                               curstack->varnum = 1;
-                                       }
-                                       if (2 > rd->arguments_num) {
-                                               rd->arguments_num = 2;
-                                       }
-                                       OP1_0ANY;
-
-                                       case ICMD_BUILTIN1:
-#if defined(USEBUILTINTABLE)
-                                       /* Just prevent a compiler warning... */
-                                       builtin1:
-#endif
-                                               REQUIRE_1;
-                                               /* DEBUG */ /*dolog("builtin1");*/
-                                       if (!(curstack->flags & SAVEDVAR)) {
-                                               curstack->varkind = ARGVAR;
-                                               curstack->varnum = 0;
-                                       }
-                                       if (1 > rd->arguments_num) {
-                                               rd->arguments_num = 1;
-                                       }
-                                       OP1_0ANY;
-                                       copy = curstack;
-                                       while (copy) {
-                                               copy->flags |= SAVEDVAR;
-                                               copy = copy->prev;
-                                       }
-                                       if (iptr->op1 != TYPE_VOID)
-                                               OP0_1(iptr->op1);
-                                       break;
-#endif /* ifndef INVOKE_NEW */
                                        case ICMD_MULTIANEWARRAY:
+                                               if (rd->argintreguse < 3)                                   
+                                                       rd->argintreguse = 3;   
+
                                                i = iptr->op1;
                                                REQUIRE(i);
-#ifdef INVOKE_NEW
 #ifdef SPECIALMEMUSE
                                                if (rd->ifmemuse < (i + rd->intreg_argnum + 6))
                                                        rd->ifmemuse = i + rd->intreg_argnum + 6; 
 #else
                                                if (rd->ifmemuse < i)
                                                        rd->ifmemuse = i; /* n integer args spilled on stack */
-#endif
 #endif
                                                if ((i + INT_ARG_CNT) > rd->arguments_num)
                                                        rd->arguments_num = i + INT_ARG_CNT;
@@ -2040,13 +1941,11 @@ methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd)
                                                        if (!(copy->flags & SAVEDVAR)) {
                                                                copy->varkind = ARGVAR;
                                                                copy->varnum = i + INT_ARG_CNT;
-#ifdef INVOKE_NEW
                                                                copy->flags|=INMEMORY;
 #ifdef SPECIALMEMUSE
                                                                copy->regoff = i + rd->intreg_argnum + 6;
 #else
                                                                copy->regoff = i;
-#endif
 #endif
                                                        }
                                                        copy = copy->prev;
@@ -2626,17 +2525,20 @@ void show_icmd(instruction *iptr, bool deadcode)
        case ICMD_LUSHRCONST:
        case ICMD_ICONST:
        case ICMD_ELSE_ICONST:
+       case ICMD_IASTORECONST:
+       case ICMD_BASTORECONST:
+       case ICMD_CASTORECONST:
+       case ICMD_SASTORECONST:
+               printf(" %d (0x%08x)", iptr->val.i, iptr->val.i);
+               break;
+
        case ICMD_IFEQ_ICONST:
        case ICMD_IFNE_ICONST:
        case ICMD_IFLT_ICONST:
        case ICMD_IFGE_ICONST:
        case ICMD_IFGT_ICONST:
        case ICMD_IFLE_ICONST:
-       case ICMD_IASTORECONST:
-       case ICMD_BASTORECONST:
-       case ICMD_CASTORECONST:
-       case ICMD_SASTORECONST:
-               printf(" %d", iptr->val.i);
+               printf("(%d) %d", iptr[1].op1, iptr->val.i);
                break;
 
        case ICMD_LADDCONST:
@@ -2651,9 +2553,9 @@ void show_icmd(instruction *iptr, bool deadcode)
        case ICMD_LCONST:
        case ICMD_LASTORECONST:
 #if defined(__I386__) || defined(__POWERPC__)
-               printf(" %lld", iptr->val.l);
+               printf(" %lld (0x%016llx)", iptr->val.l, iptr->val.l);
 #else
-               printf(" %ld", iptr->val.l);
+               printf(" %ld (0x%016lx)", iptr->val.l, iptr->val.l);
 #endif
                break;
 
@@ -2672,16 +2574,41 @@ void show_icmd(instruction *iptr, bool deadcode)
 
        case ICMD_GETFIELD:
        case ICMD_PUTFIELD:
-               printf(" %d,", ((fieldinfo *) iptr->val.a)->offset);
-       case ICMD_PUTSTATIC:
+#if defined(__X86_64__) || defined(__I386__)
+               if (iptr->val.a)         
+                       printf(" %d,", ((fieldinfo *) iptr->val.a)->offset);
+               else     
+                       printf(" NOT RESOLVED,");        
+#else   
+               printf(" %d,", ((fieldinfo *) iptr->val.a)->offset);     
+               printf(" ");
+               utf_display_classname(((fieldinfo *) iptr->val.a)->class->name);
+               printf(".");
+               utf_display(((fieldinfo *) iptr->val.a)->name);
+               printf(" (type ");
+               utf_display(((fieldinfo *) iptr->val.a)->descriptor);
+               printf(")");
+               break;
+#endif          
+       case ICMD_PUTSTATIC:
        case ICMD_GETSTATIC:
+#if defined(__X86_64__) || defined(__I386__)
+               printf(" ");     
+               utf_display_classname(((unresolved_field *) iptr->target)->fieldref->classref->name);    
+               printf(".");     
+               utf_display(((unresolved_field *) iptr->target)->fieldref->name);        
+               printf(" (type ");       
+               utf_display(((unresolved_field *) iptr->target)->fieldref->descriptor);          
+               printf(")");     
+#else   
                printf(" ");
-               utf_fprint(stdout, ((fieldinfo *) iptr->val.a)->class->name);
+               utf_display_classname(((fieldinfo *) iptr->val.a)->class->name);
                printf(".");
-               utf_fprint(stdout, ((fieldinfo *) iptr->val.a)->name);
+               utf_display(((fieldinfo *) iptr->val.a)->name);
                printf(" (type ");
-               utf_fprint(stdout, ((fieldinfo *) iptr->val.a)->descriptor);
+               utf_display(((fieldinfo *) iptr->val.a)->descriptor);
                printf(")");
+#endif
                break;
 
        case ICMD_PUTSTATICCONST:
@@ -2707,15 +2634,27 @@ void show_icmd(instruction *iptr, bool deadcode)
                        printf(" %g,", iptr->val.d);
                        break;
                }
+#if defined(__X86_64__)
+               if (iptr->opc == ICMD_PUTFIELDCONST)     
+                       printf(" NOT RESOLVED,");        
+               printf(" ");     
+               utf_display_classname(((unresolved_field *) iptr[1].target)->fieldref->classref->name);          
+               printf(".");     
+               utf_display(((unresolved_field *) iptr[1].target)->fieldref->name);      
+               printf(" (type ");       
+               utf_display(((unresolved_field *) iptr[1].target)->fieldref->descriptor);        
+               printf(")");     
+#else   
                if (iptr->opc == ICMD_PUTFIELDCONST)
                        printf(" %d,", ((fieldinfo *) iptr[1].val.a)->offset);
                printf(" ");
-               utf_fprint(stdout, ((fieldinfo *) iptr[1].val.a)->class->name);
+               utf_display_classname(((fieldinfo *) iptr[1].val.a)->class->name);
                printf(".");
-               utf_fprint(stdout, ((fieldinfo *) iptr[1].val.a)->name);
+               utf_display(((fieldinfo *) iptr[1].val.a)->name);
                printf(" (type ");
-               utf_fprint(stdout, ((fieldinfo *) iptr[1].val.a)->descriptor);
+               utf_display(((fieldinfo *) iptr[1].val.a)->descriptor);
                printf(")");
+#endif
                break;
 
        case ICMD_IINC:
@@ -2759,8 +2698,7 @@ void show_icmd(instruction *iptr, bool deadcode)
 
        case ICMD_NEW:
                printf(" ");
-               utf_fprint(stdout,
-                                  ((classinfo *) iptr->val.a)->name);
+               utf_display_classname(((classinfo *) iptr->val.a)->name);
                break;
 
        case ICMD_NEWARRAY:
@@ -2795,8 +2733,7 @@ void show_icmd(instruction *iptr, bool deadcode)
        case ICMD_ANEWARRAY:
                if (iptr->op1) {
                        printf(" ");
-                       utf_fprint(stdout,
-                                          ((classinfo *) iptr->val.a)->name);
+                       utf_display_classname(((classinfo *) iptr->val.a)->name);
                }
                break;
 
@@ -2806,7 +2743,7 @@ void show_icmd(instruction *iptr, bool deadcode)
                        printf(" %d ",iptr->op1);
                        vft = (vftbl_t *)iptr->val.a;
                        if (vft)
-                               utf_fprint(stdout,vft->class->name);
+                               utf_display_classname(vft->class->name);
                        else
                                printf("<null>");
                }
@@ -2814,13 +2751,28 @@ void show_icmd(instruction *iptr, bool deadcode)
 
        case ICMD_CHECKCAST:
        case ICMD_INSTANCEOF:
+#if defined(__X86_64__) || defined(__I386__)
+               if (iptr->op1) {         
+                       classinfo *c = iptr->val.a;      
+                       if (c) {         
+                               if (c->flags & ACC_INTERFACE)    
+                                       printf(" (INTERFACE) ");         
+                               else     
+                                       printf(" (CLASS,%3d) ", c->vftbl->diffval);      
+                       } else {         
+                               printf(" (NOT RESOLVED) ");      
+                       }        
+                       utf_display_classname(((constant_classref *) iptr->target)->name);       
+               }        
+               break;   
+#endif
                if (iptr->op1) {
                        classinfo *c = iptr->val.a;
                        if (c->flags & ACC_INTERFACE)
                                printf(" (INTERFACE) ");
                        else
                                printf(" (CLASS,%3d) ", c->vftbl->diffval);
-                       utf_fprint(stdout, c->name);
+                       utf_display_classname(c->name);
                }
                break;
 
@@ -2840,12 +2792,19 @@ void show_icmd(instruction *iptr, bool deadcode)
        case ICMD_INVOKESPECIAL:
        case ICMD_INVOKESTATIC:
        case ICMD_INVOKEINTERFACE:
+#if defined(__X86_64__) || defined(__I386__)
                printf(" ");
-               utf_fprint(stdout,
-                                  ((methodinfo *) iptr->val.a)->class->name);
+               utf_display_classname(((unresolved_method *) iptr->target)->methodref->classref->name);
                printf(".");
-               utf_fprint(stdout,
-                                  ((methodinfo *) iptr->val.a)->name);
+               utf_display(((unresolved_method *) iptr->target)->methodref->name);
+               utf_display(((unresolved_method *) iptr->target)->methodref->descriptor);
+#else
+               printf(" ");
+               utf_display_classname(((methodinfo *) iptr->val.a)->class->name);
+               printf(".");
+               utf_display(((methodinfo *) iptr->val.a)->name);
+               utf_display(((methodinfo *) iptr->val.a)->descriptor);
+#endif
                break;
 
        case ICMD_IFEQ: