bnz %xcc, calljava_copyloop
calljava_nocopy:
-
+ /* set pv, like a java method does */
+ /* add ra_caller,(asm_vm_call_method - calljava_nocopy + 8),pv_callee */
+ setx asm_vm_call_method,%l0,pv_callee
+
mov %i0,itmp1 /* pass method info pointer via itmp1 */
setx asm_call_jit_compiler,%l0,mptr_itmp2 /* fake virtual function call (2 instr) */
nop
calljava_jit2:
/* pretend to restore pv */
- add ra_caller,(asm_vm_call_method - calljava_jit2 + 8),pv_callee
+ add ra_caller,(asm_vm_call_method - calljava_jit2 + 8),zero
calljava_return:
mov %o0, %i0 /* pass on the return value */
asm_vm_call_method_exception_handler:
- mov itmp1,%o0
+ /* so far this function did not call any c functions */
+ /* but now we need ABI compliant argslots on the stack */
+ sub %sp,6*8,%sp
+
+ mov xptr_itmp2,%o0
call builtin_throw_exception
nop
return %i7 + 8 /* implicit window restore */
restore /* unwind stack and window */
ba L_asm_handle_exception_stack_loop
- mov xpc_itmp3,ra_caller /* the new xpc is ra (delay) */
+ mov ra_caller,xpc_itmp3 /* the new xpc is ra (delay) */
mov %l1,itmp2 /* restore itmp2 */
brnz %o0,L_asm_patcher_wrapper_exception
+ nop
/* load RA (patch position from patcher data on the stack */
ldx [%fp+USESTACK+5*8],itmp3
restore %fp,6*8,%sp /* (source regs refer to old window, rd to new window) */
jmpl itmp3,zero /* jump to newly patched code */
+ nop
L_asm_patcher_wrapper_exception:
- mov itmp3,xptr_itmp2 /* get exception */
+ mov %o0,xptr_itmp2 /* get exception */
ldx [%fp+USESTACK+5*8],xpc_itmp3 /* xpc is RA */
restore %fp,6*8,%sp /* remove stack frame */
ba asm_handle_exception
stw itmp1,[offcast_super_baseval+%o2]
stw itmp2,[offcast_super_diffval+%o2]
stw itmp3,[offcast_sub_baseval+%o2]
- jmpl ra_caller,zero /* caller's ra, b/c no window save */
+ jmpl ra_caller+8,zero /* caller's ra, b/c no window save */
+ nop
.end asm_getclassvalues_atomic
} else {
#endif
while (len) {
- len--;
+ len--;
var = VAR(bptr->invars[len]);
if ((len == bptr->indepth-1) && (bptr->type == BBTYPE_EXH)) {
d = codegen_reg_of_var(0, var, REG_ITMP1);
- M_INTMOVE(REG_ITMP1, d);
+ M_INTMOVE(REG_ITMP1, d);
emit_store(jd, NULL, var, d);
- }
+ }
else {
assert((var->flags & INOUT));
- }
- }
+ }
+ }
#if defined(ENABLE_LSRA)
}
#endif
#ifdef ENABLE_VERIFIER
if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
- codegen_addpatchref(cd, PATCHER_athrow_areturn,
- iptr->sx.s23.s2.uc, 0);
+ uc = iptr->sx.s23.s2.uc;
- if (opt_showdisassemble) {
- M_NOP; M_NOP;
- }
+ codegen_add_patch_ref(cd, PATCHER_athrow_areturn, uc, 0);
}
#endif /* ENABLE_VERIFIER */
disp = dseg_add_functionptr(cd, asm_handle_exception);
- M_ALD(REG_ITMP2, REG_PV, disp);
- M_JMP(REG_ITMP3_XPC, REG_ITMP2, REG_ZERO);
+ M_ALD(REG_ITMP1, REG_PV, disp);
+ M_JMP(REG_ITMP3_XPC, REG_ITMP1, REG_ZERO);
M_NOP;
M_NOP; /* nop ensures that XPC is less than the end */
/* of basic block */
/* check for exception */
M_BNEZ(REG_ITMP2_XPTR, 4); /* if no exception then return */
+ M_NOP;
+
+ M_RETURN(REG_RA_CALLEE, 8); /* implicit window restore */
+ M_NOP;
+#if 0
M_RESTORE(REG_ZERO, 0, REG_ZERO); /* restore callers window (DELAY) */
M_RET(REG_RA_CALLER, 8); /* return to caller */
M_NOP; /* DELAY SLOT */
+#endif
/* handle exception */
disp = dseg_add_functionptr(cd, asm_handle_nat_exception);
M_ALD(REG_ITMP3, REG_PV, disp); /* load asm exception handler address */
M_JMP(REG_ZERO, REG_ITMP3, REG_ZERO);/* jump to asm exception handler */
- M_MOV(REG_RA_CALLER, REG_ITMP3_XPC); /* get exception address (DELAY) */
+ M_MOV(REG_RA_CALLEE, REG_ITMP3_XPC); /* get exception address (DELAY) */
/* generate patcher stubs */