+
+void show_icmd(instruction *iptr, bool deadcode)
+{
+ int j;
+ s4 *s4ptr;
+ void **tptr = NULL;
+
+ printf("%s", icmd_names[iptr->opc]);
+
+ switch (iptr->opc) {
+ case ICMD_IADDCONST:
+ case ICMD_ISUBCONST:
+ case ICMD_IMULCONST:
+ case ICMD_IMULPOW2:
+ case ICMD_IDIVPOW2:
+ case ICMD_IREMPOW2:
+ case ICMD_IANDCONST:
+ case ICMD_IORCONST:
+ case ICMD_IXORCONST:
+ case ICMD_ISHLCONST:
+ case ICMD_ISHRCONST:
+ case ICMD_IUSHRCONST:
+ case ICMD_LSHLCONST:
+ case ICMD_LSHRCONST:
+ 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:
+ printf("(%d) %d", iptr[1].op1, iptr->val.i);
+ break;
+
+ case ICMD_LADDCONST:
+ case ICMD_LSUBCONST:
+ case ICMD_LMULCONST:
+ case ICMD_LMULPOW2:
+ case ICMD_LDIVPOW2:
+ case ICMD_LREMPOW2:
+ case ICMD_LANDCONST:
+ case ICMD_LORCONST:
+ case ICMD_LXORCONST:
+ case ICMD_LCONST:
+ case ICMD_LASTORECONST:
+#if defined(__I386__) || defined(__POWERPC__)
+ printf(" %lld (0x%016llx)", iptr->val.l, iptr->val.l);
+#else
+ printf(" %ld (0x%016lx)", iptr->val.l, iptr->val.l);
+#endif
+ break;
+
+ case ICMD_FCONST:
+ printf(" %f", iptr->val.f);
+ break;
+
+ case ICMD_DCONST:
+ printf(" %f", iptr->val.d);
+ break;
+
+ case ICMD_ACONST:
+ case ICMD_AASTORECONST:
+ printf(" %p", iptr->val.a);
+ break;
+
+ case ICMD_GETFIELD:
+ case ICMD_PUTFIELD:
+#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_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(")");
+#endif
+ break;
+
+ case ICMD_PUTSTATICCONST:
+ case ICMD_PUTFIELDCONST:
+ switch (iptr[1].op1) {
+ case TYPE_INT:
+ printf(" %d,", iptr->val.i);
+ break;
+ case TYPE_LNG:
+#if defined(__I386__) || defined(__POWERPC__)
+ printf(" %lld,", iptr->val.l);
+#else
+ printf(" %ld,", iptr->val.l);
+#endif
+ break;
+ case TYPE_ADR:
+ printf(" %p,", iptr->val.a);
+ break;
+ case TYPE_FLT:
+ printf(" %g,", iptr->val.f);
+ break;
+ case TYPE_DBL:
+ 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_display_classname(((fieldinfo *) iptr[1].val.a)->class->name);
+ printf(".");
+ utf_display(((fieldinfo *) iptr[1].val.a)->name);
+ printf(" (type ");
+ utf_display(((fieldinfo *) iptr[1].val.a)->descriptor);
+ printf(")");
+#endif
+ break;
+
+ case ICMD_IINC:
+ printf(" %d + %d", iptr->op1, iptr->val.i);
+ break;
+
+ case ICMD_IASTORE:
+ case ICMD_SASTORE:
+ case ICMD_BASTORE:
+ case ICMD_CASTORE:
+ case ICMD_LASTORE:
+ case ICMD_DASTORE:
+ case ICMD_FASTORE:
+ case ICMD_AASTORE:
+
+ case ICMD_IALOAD:
+ case ICMD_SALOAD:
+ case ICMD_BALOAD:
+ case ICMD_CALOAD:
+ case ICMD_LALOAD:
+ case ICMD_DALOAD:
+ case ICMD_FALOAD:
+ case ICMD_AALOAD:
+ if (iptr->op1 != 0)
+ printf("(opt.)");
+ break;
+
+ case ICMD_RET:
+ case ICMD_ILOAD:
+ case ICMD_LLOAD:
+ case ICMD_FLOAD:
+ case ICMD_DLOAD:
+ case ICMD_ALOAD:
+ case ICMD_ISTORE:
+ case ICMD_LSTORE:
+ case ICMD_FSTORE:
+ case ICMD_DSTORE:
+ case ICMD_ASTORE:
+ printf(" %d", iptr->op1);
+ break;
+
+ case ICMD_NEW:
+ printf(" ");
+ utf_display_classname(((classinfo *) iptr->val.a)->name);
+ break;
+
+ case ICMD_NEWARRAY:
+ switch (iptr->op1) {
+ case 4:
+ printf(" boolean");
+ break;
+ case 5:
+ printf(" char");
+ break;
+ case 6:
+ printf(" float");
+ break;
+ case 7:
+ printf(" double");
+ break;
+ case 8:
+ printf(" byte");
+ break;
+ case 9:
+ printf(" short");
+ break;
+ case 10:
+ printf(" int");
+ break;
+ case 11:
+ printf(" long");
+ break;
+ }
+ break;
+
+ case ICMD_ANEWARRAY:
+ if (iptr->op1) {
+ printf(" ");
+ utf_display_classname(((classinfo *) iptr->val.a)->name);
+ }
+ break;
+
+ case ICMD_MULTIANEWARRAY:
+ {
+ vftbl_t *vft;
+ printf(" %d ",iptr->op1);
+ vft = (vftbl_t *)iptr->val.a;
+ if (vft)
+ utf_display_classname(vft->class->name);
+ else
+ printf("<null>");
+ }
+ break;
+
+ 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_display_classname(c->name);
+ }
+ break;
+
+ case ICMD_INLINE_START:
+ printf("\t\t\t%s.%s%s depth=%i",iptr->method->class->name->text,iptr->method->name->text,iptr->method->descriptor->text, iptr->op1);
+ break;
+ case ICMD_INLINE_END:
+ break;
+
+ case ICMD_BUILTIN3:
+ case ICMD_BUILTIN2:
+ case ICMD_BUILTIN1:
+ printf(" %s", icmd_builtin_name((functionptr) iptr->val.fp));
+ break;
+
+ case ICMD_INVOKEVIRTUAL:
+ case ICMD_INVOKESPECIAL:
+ case ICMD_INVOKESTATIC:
+ case ICMD_INVOKEINTERFACE:
+#if defined(__X86_64__) || defined(__I386__)
+ printf(" ");
+ utf_display_classname(((unresolved_method *) iptr->target)->methodref->classref->name);
+ printf(".");
+ 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:
+ case ICMD_IFNE:
+ case ICMD_IFLT:
+ case ICMD_IFGE:
+ case ICMD_IFGT:
+ case ICMD_IFLE:
+ if (deadcode || !iptr->target)
+ printf("(%d) op1=%d", iptr->val.i, iptr->op1);
+ else
+ printf("(%d) L%03d", iptr->val.i, ((basicblock *) iptr->target)->debug_nr);
+ break;
+
+ case ICMD_IF_LEQ:
+ case ICMD_IF_LNE:
+ case ICMD_IF_LLT:
+ case ICMD_IF_LGE:
+ case ICMD_IF_LGT:
+ case ICMD_IF_LLE:
+ if (deadcode || !iptr->target)
+#if defined(__I386__) || defined(__POWERPC__)
+ printf("(%lld) op1=%d", iptr->val.l, iptr->op1);
+#else
+ printf("(%ld) op1=%d", iptr->val.l, iptr->op1);
+#endif
+ else
+#if defined(__I386__) || defined(__POWERPC__)
+ printf("(%lld) L%03d", iptr->val.l, ((basicblock *) iptr->target)->debug_nr);
+#else
+ printf("(%ld) L%03d", iptr->val.l, ((basicblock *) iptr->target)->debug_nr);
+#endif
+ break;
+
+ case ICMD_JSR:
+ case ICMD_GOTO:
+ case ICMD_IFNULL:
+ case ICMD_IFNONNULL:
+ case ICMD_IF_ICMPEQ:
+ case ICMD_IF_ICMPNE:
+ case ICMD_IF_ICMPLT:
+ case ICMD_IF_ICMPGE:
+ case ICMD_IF_ICMPGT:
+ case ICMD_IF_ICMPLE:
+ case ICMD_IF_LCMPEQ:
+ case ICMD_IF_LCMPNE:
+ case ICMD_IF_LCMPLT:
+ case ICMD_IF_LCMPGE:
+ case ICMD_IF_LCMPGT:
+ case ICMD_IF_LCMPLE:
+ case ICMD_IF_ACMPEQ:
+ case ICMD_IF_ACMPNE:
+ if (deadcode || !iptr->target)
+ printf(" op1=%d", iptr->op1);
+ else
+ printf(" L%03d", ((basicblock *) iptr->target)->debug_nr);
+ break;
+
+ case ICMD_TABLESWITCH:
+ s4ptr = (s4*)iptr->val.a;
+
+ if (deadcode || !iptr->target) {
+ printf(" %d;", *s4ptr);
+ }
+ else {
+ tptr = (void **) iptr->target;
+ printf(" L%03d;", ((basicblock *) *tptr)->debug_nr);
+ tptr++;
+ }
+
+ s4ptr++; /* skip default */
+ j = *s4ptr++; /* low */
+ j = *s4ptr++ - j; /* high */
+ while (j >= 0) {
+ if (deadcode || !*tptr)
+ printf(" %d", *s4ptr++);
+ else {
+ printf(" L%03d", ((basicblock *) *tptr)->debug_nr);
+ tptr++;
+ }
+ j--;
+ }
+ break;
+
+ case ICMD_LOOKUPSWITCH:
+ s4ptr = (s4*)iptr->val.a;
+
+ if (deadcode || !iptr->target) {
+ printf(" %d;", *s4ptr);
+ }
+ else {
+ tptr = (void **) iptr->target;
+ printf(" L%03d;", ((basicblock *) *tptr)->debug_nr);
+ tptr++;
+ }
+ s4ptr++; /* default */
+ j = *s4ptr++; /* count */
+
+ while (--j >= 0) {
+ if (deadcode || !*tptr) {
+ s4ptr++; /* skip value */
+ printf(" %d",*s4ptr++);
+ }
+ else {
+ printf(" L%03d", ((basicblock *) *tptr)->debug_nr);
+ tptr++;