spilledregs_num = rd->memuse;
#if defined(ENABLE_THREADS) /* space to save argument of monitor_enter */
- if (checksync && (m->flags & ACC_SYNCHRONIZED))
+ if (checksync && code_is_synchronized(code))
spilledregs_num++;
#endif
(void) dseg_add_unique_address(cd, code); /* CodeinfoPointer */
(void) dseg_add_unique_s4(cd, cd->stackframesize); /* FrameSize */
-#if defined(ENABLE_THREADS)
/* IsSync contains the offset relative to the stack pointer for the
argument of monitor_exit used in the exception handler. Since the
offset could be zero and give a wrong meaning of the flag it is
offset by one.
*/
+ /* XXX Remove this "offset by one". */
- if (checksync && (m->flags & ACC_SYNCHRONIZED))
- (void) dseg_add_unique_s4(cd, rd->memuse * 8 + 4);/* IsSync */
- else
-#endif
- (void) dseg_add_unique_s4(cd, 0); /* IsSync */
+ code->synchronizedoffset = (rd->memuse + 1) * 8;
/* REMOVEME: We still need it for exception handling in assembler. */
#if defined(ENABLE_THREADS)
/* call monitorenter function */
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* stack offset for monitor argument */
s1 = rd->memuse * 8;
#if defined(ENABLE_THREADS)
/* call monitorexit function */
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* stack offset for monitor argument */
s1 = rd->memuse * 8;
methoddesc *md;
s4 i, j;
s4 t;
- s4 disp, funcdisp, s1, s2;
+ int s1, s2;
+ int disp;
/* get required compiler data */
cd->stackframesize =
4 + /* return address */
- sizeof(stackframeinfo) + /* stackframeinfo */
+ sizeof(stackframeinfo_t) + /* stackframeinfo */
sizeof(localref_table) + /* localref_table */
nmd->memuse * 4; /* stack arguments */
emit_verbosecall_enter(jd);
#endif
- /* get function address (this must happen before the stackframeinfo) */
-
- funcdisp = dseg_add_functionptr(cd, f);
-
- if (f == NULL)
- patcher_add_patch_ref(jd, PATCHER_resolve_native_function, m, funcdisp);
-
#if defined(ENABLE_GC_CACAO)
/* Save callee saved integer registers in stackframeinfo (GC may
need to recover them during a collection). */
- disp = cd->stackframesize - SIZEOF_VOID_P - sizeof(stackframeinfo) +
- OFFSET(stackframeinfo, intregs);
+ disp = cd->stackframesize - SIZEOF_VOID_P - sizeof(stackframeinfo_t) +
+ OFFSET(stackframeinfo_t, intregs);
for (i = 0; i < INT_SAV_CNT; i++)
M_STR_INTERN(abi_registers_integer_saved[i], REG_SP, disp + i * 4);
M_DSEG_LOAD(REG_A0, disp);
}
- /* do the native function call */
+ /* Call the native function. */
- M_DSEG_BRANCH(funcdisp);
+ disp = dseg_add_functionptr(cd, f);
+ M_DSEG_BRANCH(disp);
/* recompute pv */
/* TODO: this is only needed because of the tracer ... do we
/* restore callee saved int registers from stackframeinfo (GC might have */
/* modified them during a collection). */
- disp = cd->stackframesize - SIZEOF_VOID_P - sizeof(stackframeinfo) +
- OFFSET(stackframeinfo, intregs);
+ disp = cd->stackframesize - SIZEOF_VOID_P - sizeof(stackframeinfo_t) +
+ OFFSET(stackframeinfo_t, intregs);
for (i = 0; i < INT_SAV_CNT; i++)
M_LDR_INTERN(abi_registers_integer_saved[i], REG_SP, disp + i * 4);