- SHOW_DBL_CONST(iptr->sx.val.d);
- SHOW_DST(iptr);
- break;
-
- /* const ADR */
- case ICMD_ACONST:
- if (iptr->flags.bits & INS_FLAG_CLASS) {
- SHOW_CLASSREF_OR_CLASSINFO(iptr->sx.val.c);
- }
- else if (iptr->sx.val.anyptr == NULL) {
- printf("NULL ");
- }
- else {
- SHOW_STRING(iptr->sx.val.stringconst);
- }
- SHOW_DST(iptr);
- break;
-
- case ICMD_AASTORECONST:
- SHOW_S1(iptr);
- SHOW_S2(iptr);
- printf("%p ", (void*) iptr->sx.s23.s3.constval);
- break;
-
- case ICMD_GETFIELD: /* 1 -> 1 */
- case ICMD_PUTFIELD: /* 2 -> 0 */
- case ICMD_PUTSTATIC: /* 1 -> 0 */
- case ICMD_GETSTATIC: /* 0 -> 1 */
- case ICMD_PUTSTATICCONST: /* 0 -> 0 */
- case ICMD_PUTFIELDCONST: /* 1 -> 0 */
- if (opcode != ICMD_GETSTATIC && opcode != ICMD_PUTSTATICCONST) {
- SHOW_S1(iptr);
- if (opcode == ICMD_PUTFIELD) {
- SHOW_S2(iptr);
- }
- }
- NEW_INSTRUCTION_GET_FIELDREF(iptr, fmiref);
- SHOW_FIELD(fmiref);
-
- if (opcode == ICMD_GETSTATIC || opcode == ICMD_GETFIELD) {
- SHOW_DST(iptr);
- }
- break;
-
- case ICMD_IINC:
- SHOW_S1_LOCAL(iptr);
- SHOW_INT_CONST(iptr->sx.val.i);
- SHOW_DST_LOCAL(iptr);
- 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:
- SHOW_S1(iptr);
- SHOW_S2(iptr);
- SHOW_S3(iptr);
- break;
-
- case ICMD_IALOAD:
- case ICMD_SALOAD:
- case ICMD_BALOAD:
- case ICMD_CALOAD:
- case ICMD_LALOAD:
- case ICMD_DALOAD:
- case ICMD_FALOAD:
- case ICMD_AALOAD:
- SHOW_S1(iptr);
- SHOW_S2(iptr);
- SHOW_DST(iptr);
- break;
-
- case ICMD_RET:
- SHOW_S1_LOCAL(iptr);
- break;
-
- case ICMD_ILOAD:
- case ICMD_LLOAD:
- case ICMD_FLOAD:
- case ICMD_DLOAD:
- case ICMD_ALOAD:
- SHOW_S1_LOCAL(iptr);
- SHOW_DST(iptr);
- break;
-
- case ICMD_ISTORE:
- case ICMD_LSTORE:
- case ICMD_FSTORE:
- case ICMD_DSTORE:
- case ICMD_ASTORE:
- SHOW_S1(iptr);
- SHOW_DST_LOCAL(iptr);
- break;
-
- case ICMD_NEW:
- SHOW_DST(iptr);
- break;
-
- case ICMD_NEWARRAY:
- SHOW_DST(iptr);
- break;
-
- case ICMD_ANEWARRAY:
- SHOW_DST(iptr);
- break;
-
- case ICMD_MULTIANEWARRAY:
- if (stage >= SHOW_STACK) {
- argp = iptr->sx.s23.s2.args;
- i = iptr->s1.argcount;
- while (i--) {
- SHOW_STACKVAR(*(argp++));
- }
- }
- else {
- printf("argcount=%d ", iptr->s1.argcount);
- }
- SHOW_DST(iptr);
- break;
-
- case ICMD_CHECKCAST:
- SHOW_S1(iptr);
- SHOW_DST(iptr);
- break;
-
- case ICMD_INSTANCEOF:
- SHOW_S1(iptr);
- SHOW_DST(iptr);
- break;
-
- case ICMD_INLINE_START:
- case ICMD_INLINE_END:
- break;
-
- case ICMD_BUILTIN:
- if (stage >= SHOW_STACK) {
- argp = iptr->sx.s23.s2.args;
- i = iptr->s1.argcount;
- while (i--) {
- SHOW_STACKVAR(*(argp++));
- }
- }
- printf("%s ", iptr->sx.s23.s3.bte->name);
- if (iptr->sx.s23.s3.bte->md->returntype.type != TYPE_VOID) {
- SHOW_DST(iptr);
- }
- break;
-
- case ICMD_INVOKEVIRTUAL:
- case ICMD_INVOKESPECIAL:
- case ICMD_INVOKESTATIC:
- case ICMD_INVOKEINTERFACE:
- if (stage >= SHOW_STACK) {
- argp = iptr->sx.s23.s2.args;
- i = iptr->s1.argcount;
- while (i--) {
- SHOW_STACKVAR(*(argp++));
- }
- }
- NEW_INSTRUCTION_GET_METHODREF(iptr, fmiref);
- method_methodref_print(fmiref);
- if (fmiref->parseddesc.md->returntype.type != TYPE_VOID) {
- SHOW_DST(iptr);
- }
- break;
-
- case ICMD_IFEQ:
- case ICMD_IFNE:
- case ICMD_IFLT:
- case ICMD_IFGE:
- case ICMD_IFGT:
- case ICMD_IFLE:
- SHOW_S1(iptr);
- SHOW_TARGET(iptr->dst);
- 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:
- SHOW_S1(iptr);
- SHOW_TARGET(iptr->dst);
- break;
-
- case ICMD_GOTO:
- case ICMD_INLINE_GOTO:
- SHOW_TARGET(iptr->dst);
- break;
-
- case ICMD_JSR:
- SHOW_TARGET(iptr->sx.s23.s3.jsrtarget);
- SHOW_DST(iptr);
- break;
-
- case ICMD_IFNULL:
- case ICMD_IFNONNULL:
- SHOW_S1(iptr);
- SHOW_TARGET(iptr->dst);
- break;
-
- 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_FCMPEQ:
- case ICMD_IF_FCMPNE:
-
- case ICMD_IF_FCMPL_LT:
- case ICMD_IF_FCMPL_GE:
- case ICMD_IF_FCMPL_GT:
- case ICMD_IF_FCMPL_LE:
-
- case ICMD_IF_FCMPG_LT:
- case ICMD_IF_FCMPG_GE:
- case ICMD_IF_FCMPG_GT:
- case ICMD_IF_FCMPG_LE:
-
- case ICMD_IF_DCMPEQ:
- case ICMD_IF_DCMPNE:
-
- case ICMD_IF_DCMPL_LT:
- case ICMD_IF_DCMPL_GE:
- case ICMD_IF_DCMPL_GT:
- case ICMD_IF_DCMPL_LE:
-
- case ICMD_IF_DCMPG_LT:
- case ICMD_IF_DCMPG_GE:
- case ICMD_IF_DCMPG_GT:
- case ICMD_IF_DCMPG_LE:
-
- case ICMD_IF_ACMPEQ:
- case ICMD_IF_ACMPNE:
- SHOW_S1(iptr);
- SHOW_S2(iptr);
- SHOW_TARGET(iptr->dst);
- break;
-
- case ICMD_TABLESWITCH:
- SHOW_S1(iptr);
- break;
-
- case ICMD_LOOKUPSWITCH:
- SHOW_S1(iptr);
- break;
-
- case ICMD_ARETURN:
- SHOW_S1(iptr);
- break;
-
- case ICMD_ATHROW:
- SHOW_S1(iptr);
- break;
-
- case ICMD_DUP:
- SHOW_S1(iptr);
- SHOW_DST(iptr);
- break;
-
- case ICMD_DUP2:
- if (stage >= SHOW_STACK) {
- SHOW_STACKVAR(iptr->dst.dupslots[0]);
- SHOW_STACKVAR(iptr->dst.dupslots[1]);
- printf("=> ");
- SHOW_STACKVAR(iptr->dst.dupslots[2+0]);
- SHOW_STACKVAR(iptr->dst.dupslots[2+1]);
- }
- break;
-
- case ICMD_DUP_X1:
- if (stage >= SHOW_STACK) {
- SHOW_STACKVAR(iptr->dst.dupslots[0]);
- SHOW_STACKVAR(iptr->dst.dupslots[1]);
- printf("=> ");
- SHOW_STACKVAR(iptr->dst.dupslots[2+0]);
- SHOW_STACKVAR(iptr->dst.dupslots[2+1]);
- SHOW_STACKVAR(iptr->dst.dupslots[2+2]);
- }
- break;
-
- case ICMD_DUP2_X1:
- if (stage >= SHOW_STACK) {
- SHOW_STACKVAR(iptr->dst.dupslots[0]);
- SHOW_STACKVAR(iptr->dst.dupslots[1]);
- SHOW_STACKVAR(iptr->dst.dupslots[2]);
- printf("=> ");
- SHOW_STACKVAR(iptr->dst.dupslots[3+0]);
- SHOW_STACKVAR(iptr->dst.dupslots[3+1]);
- SHOW_STACKVAR(iptr->dst.dupslots[3+2]);
- SHOW_STACKVAR(iptr->dst.dupslots[3+3]);
- SHOW_STACKVAR(iptr->dst.dupslots[3+4]);
- }
- break;
-
- case ICMD_DUP_X2:
- if (stage >= SHOW_STACK) {
- SHOW_STACKVAR(iptr->dst.dupslots[0]);
- SHOW_STACKVAR(iptr->dst.dupslots[1]);
- SHOW_STACKVAR(iptr->dst.dupslots[2]);
- printf("=> ");
- SHOW_STACKVAR(iptr->dst.dupslots[3+0]);
- SHOW_STACKVAR(iptr->dst.dupslots[3+1]);
- SHOW_STACKVAR(iptr->dst.dupslots[3+2]);
- SHOW_STACKVAR(iptr->dst.dupslots[3+3]);
- }
- break;
-
- case ICMD_DUP2_X2:
- if (stage >= SHOW_STACK) {
- SHOW_STACKVAR(iptr->dst.dupslots[0]);
- SHOW_STACKVAR(iptr->dst.dupslots[1]);
- SHOW_STACKVAR(iptr->dst.dupslots[2]);
- SHOW_STACKVAR(iptr->dst.dupslots[4]);
- printf("=> ");
- SHOW_STACKVAR(iptr->dst.dupslots[4+0]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+1]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+2]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+3]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+4]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+5]);
- }
- break;
-
- case ICMD_SWAP:
- if (stage >= SHOW_STACK) {
- SHOW_STACKVAR(iptr->dst.dupslots[0]);
- SHOW_STACKVAR(iptr->dst.dupslots[1]);
- printf("=> ");
- SHOW_STACKVAR(iptr->dst.dupslots[2+0]);
- SHOW_STACKVAR(iptr->dst.dupslots[2+1]);
- }
- break;
-
- }
-}
-#endif /* !defined(NDEBUG) */
-
-#if !defined(NDEBUG)
-void show_icmd(instruction *iptr, bool deadcode)
-{
-#if 0
- u2 opcode;
- u2 condition;
-#endif
- int j;
- s4 *s4ptr;
- void **tptr = NULL;
- classinfo *c;
- fieldinfo *f;
- constant_classref *cr;
- unresolved_field *uf;
-
-#if 0
- /* get the opcode and the condition */
-
- opcode = iptr->opc & ICMD_OPCODE_MASK;
- condition = (iptr->opc & ICMD_CONDITION_MASK) >> 8;
-
- /* Print the condition for conditional instructions. */
-
- if (condition != 0)
- printf(" (condition: %s)", icmd_names[condition]);
-#endif
-
- 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_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 (0x%08x)", iptr[1].op1, iptr->val.i, iptr->val.i);
- break;
-
- case ICMD_ELSE_ICONST:
- printf(" %d (0x%08x)", iptr->val.i, 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 SIZEOF_VOID_P == 4
- 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 (0x%08x)", iptr->val.f, iptr->val.i);
- break;
-
- case ICMD_DCONST:
-#if SIZEOF_VOID_P == 4
- printf(" %g (0x%016llx)", iptr->val.d, iptr->val.l);
-#else
- printf(" %g (0x%016lx)", iptr->val.d, iptr->val.l);
-#endif