+ dseg_createlinenumbertable(cd);
+
+#if 0
+ {
+ s4 *xcodeptr;
+ branchref *bref;
+
+ /* generate ArithmeticException stubs */
+
+ xcodeptr = NULL;
+
+ for (bref = cd->xdivrefs; bref != NULL; bref = bref->next) {
+ gen_resolvebranch((u1 *) cd->mcodebase + bref->branchpos,
+ bref->branchpos,
+ (u1 *) mcodeptr - cd->mcodebase);
+
+ MCODECHECK(100);
+
+ if (xcodeptr != NULL) {
+ M_BR(xcodeptr - mcodeptr);
+ M_AADD_IMM(REG_PV, bref->branchpos - 4, REG_ITMP2_XPC); /* delay */
+
+ } else {
+ M_AADD_IMM(REG_PV, bref->branchpos - 4, REG_ITMP2_XPC);
+
+ xcodeptr = mcodeptr;
+
+ M_MOV(REG_PV, rd->argintregs[0]);
+ M_MOV(REG_SP, rd->argintregs[1]);
+
+ if (m->isleafmethod)
+ M_MOV(REG_RA, rd->argintregs[2]);
+ else
+ M_ALD(rd->argintregs[2],
+ REG_SP, parentargs_base * 8 - SIZEOF_VOID_P);
+
+ M_MOV(REG_ITMP2_XPC, rd->argintregs[3]);
+
+ M_ASUB_IMM(REG_SP, 2 * 8, REG_SP);
+ M_AST(REG_ITMP2_XPC, REG_SP, 0 * 8);
+
+ if (m->isleafmethod)
+ M_AST(REG_RA, REG_SP, 1 * 8);
+
+ a = dseg_addaddress(cd, stacktrace_inline_arithmeticexception);
+ M_ALD(REG_ITMP3, REG_PV, a);
+ M_JSR(REG_RA, REG_ITMP3);
+ M_NOP;
+ M_MOV(REG_RESULT, REG_ITMP1_XPTR);
+
+ if (m->isleafmethod)
+ M_ALD(REG_RA, REG_SP, 1 * 8);
+
+ M_ALD(REG_ITMP2_XPC, REG_SP, 0 * 8);
+ M_AADD_IMM(REG_SP, 2 * 8, REG_SP);
+
+ a = dseg_addaddress(cd, asm_handle_exception);
+ M_ALD(REG_ITMP3, REG_PV, a);
+ M_JMP(REG_ITMP3);
+ M_NOP;
+ }
+ }
+
+ /* generate ArrayIndexOutOfBoundsException stubs */
+
+ xcodeptr = NULL;
+
+ for (bref = cd->xboundrefs; bref != NULL; bref = bref->next) {
+ gen_resolvebranch((u1 *) cd->mcodebase + bref->branchpos,
+ bref->branchpos,
+ (u1 *) mcodeptr - cd->mcodebase);
+
+ MCODECHECK(100);
+
+ /* move index register into REG_ITMP1 */
+
+ M_MOV(bref->reg, REG_ITMP1);
+ M_AADD_IMM(REG_PV, bref->branchpos - 4, REG_ITMP2_XPC);
+
+ if (xcodeptr != NULL) {
+ M_BR(xcodeptr - mcodeptr);
+ M_NOP;
+
+ } else {
+ xcodeptr = mcodeptr;
+
+ M_MOV(REG_PV, rd->argintregs[0]);
+ M_MOV(REG_SP, rd->argintregs[1]);
+
+ if (m->isleafmethod)
+ M_MOV(REG_RA, rd->argintregs[2]);
+ else
+ M_ALD(rd->argintregs[2],
+ REG_SP, parentargs_base * 8 - SIZEOF_VOID_P);
+
+ M_MOV(REG_ITMP2_XPC, rd->argintregs[3]);
+ M_MOV(REG_ITMP1, rd->argintregs[4]);
+
+ M_ASUB_IMM(REG_SP, 2 * 8, REG_SP);
+ M_AST(REG_ITMP2_XPC, REG_SP, 0 * 8);
+
+ if (m->isleafmethod)
+ M_AST(REG_RA, REG_SP, 1 * 8);
+
+ a = dseg_addaddress(cd, stacktrace_inline_arrayindexoutofboundsexception);
+ M_ALD(REG_ITMP3, REG_PV, a);
+ M_JSR(REG_RA, REG_ITMP3);
+ M_NOP;
+ M_MOV(REG_RESULT, REG_ITMP1_XPTR);
+
+ if (m->isleafmethod)
+ M_ALD(REG_RA, REG_SP, 1 * 8);
+
+ M_ALD(REG_ITMP2_XPC, REG_SP, 0 * 8);
+ M_AADD_IMM(REG_SP, 2 * 8, REG_SP);
+
+ a = dseg_addaddress(cd, asm_handle_exception);
+ M_ALD(REG_ITMP3, REG_PV, a);
+ M_JMP(REG_ITMP3);
+ M_NOP;
+ }
+ }
+
+ /* generate ArrayStoreException stubs */
+
+ xcodeptr = NULL;
+
+ for (bref = cd->xstorerefs; bref != NULL; bref = bref->next) {
+ gen_resolvebranch((u1 *) cd->mcodebase + bref->branchpos,
+ bref->branchpos,
+ (u1 *) mcodeptr - cd->mcodebase);
+
+ MCODECHECK(100);
+
+ M_AADD_IMM(REG_PV, bref->branchpos - 4, REG_ITMP2_XPC);
+
+ if (xcodeptr != NULL) {
+ M_BR(xcodeptr - mcodeptr);
+ M_NOP;
+
+ } else {
+ xcodeptr = mcodeptr;
+
+ M_MOV(REG_PV, rd->argintregs[0]);
+ M_MOV(REG_SP, rd->argintregs[1]);
+ M_ALD(rd->argintregs[2],
+ REG_SP, parentargs_base * 8 - SIZEOF_VOID_P);
+ M_MOV(REG_ITMP2_XPC, rd->argintregs[3]);
+
+ M_ASUB_IMM(REG_SP, 1 * 8, REG_SP);
+ M_AST(REG_ITMP2_XPC, REG_SP, 0 * 8);
+
+ a = dseg_addaddress(cd, stacktrace_inline_arraystoreexception);
+ M_ALD(REG_ITMP3, REG_PV, a);
+ M_JSR(REG_RA, REG_ITMP3);
+ M_NOP;
+ M_MOV(REG_RESULT, REG_ITMP1_XPTR);