- lw t0,ExTableSize(pv) /* t0 = exception table size */
- beqz t0,empty_table /* if empty table skip */
- aaddiu t1,pv,ExTableStart /* t1 = start of exception table */
-
-ex_table_loop:
- ald t2,ExStartPC(t1) /* t2 = exception start pc */
- sle t2,t2,xpc /* t2 = (startpc <= xpc) */
- beqz t2,ex_table_cont /* if (false) continue */
- ald t2,ExEndPC(t1) /* t2 = exception end pc */
- slt t2,xpc,t2 /* t2 = (xpc < endpc) */
- beqz t2,ex_table_cont /* if (false) continue */
- ald a1,ExCatchType(t1) /* arg1 = exception catch type */
- beqz a1,ex_handle_it /* NULL catches everything */
-
- lw itmp3,offclassloaded(a1)
- bnez itmp3,L_class_loaded
-
- aaddiu sp,sp,-8*8 /* allocate stack */
- sd t0,0*8(sp) /* save used register */
- sd t1,1*8(sp)
- sd t3,2*8(sp)
- sd xptr,3*8(sp)
- sd xpc,4*8(sp)
- sd pv,5*8(sp)
- sd ra,6*8(sp)
- sd a1,7*8(sp)
-
- move a0,a1
- jal load_class_bootstrap
-
- ld t0,0*8(sp) /* restore used register */
- ld t1,1*8(sp)
- ld t3,2*8(sp)
- ld xptr,3*8(sp)
- ld xpc,4*8(sp)
- ld pv,5*8(sp)
- ld ra,6*8(sp)
- ld a1,7*8(sp)
- aaddiu sp,sp,8*8 /* deallocate stack */
-
-L_class_loaded:
- lw itmp3,offclasslinked(a1)
- aaddiu sp,sp,-8*8 /* allocate stack */
- sd a1,7*8(sp)
- bnez itmp3,L_class_linked
-
- sd t0,0*8(sp) /* save used register */
- sd t1,1*8(sp)
- sd t3,2*8(sp)
- sd xptr,3*8(sp)
- sd xpc,4*8(sp)
- sd pv,5*8(sp)
- sd ra,6*8(sp)
-
- move a0,a1
- jal link_class
-
- ld t0,0*8(sp) /* restore used register */
- ld t1,1*8(sp)
- ld t3,2*8(sp)
- ld xptr,3*8(sp)
- ld xpc,4*8(sp)
- ld pv,5*8(sp)
- ld ra,6*8(sp)
-
-L_class_linked:
-_crit_restart1:
- ld a1,7*8(sp)
-_crit_begin1:
- ald a0,offobjvftbl(xptr) /* a0 = vftblptr(xptr) */
- ald a1,offclassvftbl(a1) /* a1 = vftblptr(catchtype) class (not obj) */
- lw a0,offbaseval(a0) /* a0 = baseval(xptr) */
- lw v0,offbaseval(a1) /* a2 = baseval(catchtype) */
- lw a1,offdiffval(a1) /* a1 = diffval(catchtype) */
-_crit_end1:
- subu a0,a0,v0 /* a0 = baseval(xptr) - baseval(catchtype) */
- sltu v0,a1,a0 /* v0 = xptr is instanceof catchtype */
- aaddiu sp,sp,8*8 /* deallocate stack */
- bnez v0,ex_table_cont /* if (false) continue */
-
-ex_handle_it:
- ald xpc,ExHandlerPC(t1) /* xpc = exception handler pc */
-
- beqz t3,ex_jump /* if (!(no stack unwinding) skip */
-
- ld v0,0*8(sp) /* restore possible used registers */
- ld t0,1*8(sp) /* also registers used by trace_exception */
- ld t1,2*8(sp)
- ld t2,3*8(sp)
- ld t3,4*8(sp)
- ld t8,5*8(sp)
- ld a0,6*8(sp)
- ld a1,7*8(sp)
- ld a2,8*8(sp)
- ld a3,9*8(sp)
- ld a4,10*8(sp)
- ld a5,11*8(sp)
- ld a6,12*8(sp)
- ld a7,13*8(sp)
-
- aaddiu sp,sp,14*8 /* deallocate stack */
-
-ex_jump:
- jr xpc /* jump to the handler */
-
-ex_table_cont:
- aaddiu t1,t1,ExEntrySize /* next exception table entry */
- addiu t0,t0,-1 /* decrement entry counter */
- bgtz t0,ex_table_loop /* if (t0 > 0) next entry */
-
-empty_table:
- beqz t3,ex_already_cleared /* if here the first time, then */
- aaddiu sp,sp,14*8 /* deallocate stack and */
- move t3,zero /* clear the no unwind flag */
-ex_already_cleared:
- lw t0,IsSync(pv) /* t0 = SyncOffset */
- beqz t0,no_monitor_exit /* if zero no monitorexit */
-
-#if defined(USE_THREADS)
- aaddu t0,sp,t0 /* add stackptr to Offset */
- ald a0,-8(t0) /* load monitorexit pointer */
-
- aaddiu sp,sp,-8*8 /* allocate stack */
- sd t0,0*8(sp) /* save used register */
- sd t1,1*8(sp)
- sd t3,2*8(sp)
- sd xptr,3*8(sp)
- sd xpc,4*8(sp)
- sd pv,5*8(sp)
- sd ra,6*8(sp)
-
- jal builtin_monitorexit /* builtin_monitorexit(objectptr) */