varinfo *var;
basicblock *bptr;
instruction *iptr;
- exception_entry *ex;
u2 currentline;
constant_classref *cr;
unresolved_class *uc;
#if defined(ENABLE_THREADS)
/* space to save argument of monitor_enter */
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
# if SIZEOF_VOID_P == 8
cd->stackframesize++;
# else
(void) dseg_add_unique_address(cd, code); /* CodeinfoPointer */
(void) dseg_add_unique_s4(cd, cd->stackframesize * 8); /* 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.
- */
-
- if (checksync && (m->flags & ACC_SYNCHRONIZED))
- (void) dseg_add_unique_s4(cd, (rd->memuse + 1) * 8); /* IsSync */
- else
-#endif
- (void) dseg_add_unique_s4(cd, 0); /* IsSync */
-
+ code->synchronizedoffset = rd->memuse * 8;
+
/* REMOVEME: We still need it for exception handling in assembler. */
if (code_is_leafmethod(code))
(void) dseg_add_unique_s4(cd, INT_SAV_CNT - rd->savintreguse); /* IntSave */
(void) dseg_add_unique_s4(cd, FLT_SAV_CNT - rd->savfltreguse); /* FltSave */
- dseg_addlinenumbertablesize(cd);
- (void) dseg_add_unique_s4(cd, jd->exceptiontablelength); /* ExTableSize */
- /* create exception table */
+ dseg_addlinenumbertablesize(cd);
- for (ex = jd->exceptiontable; ex != NULL; ex = ex->down) {
- dseg_add_target(cd, ex->start);
- dseg_add_target(cd, ex->end);
- dseg_add_target(cd, ex->handler);
- (void) dseg_add_unique_address(cd, ex->catchtype.any);
- }
-
/* create stack frame (if necessary) */
if (cd->stackframesize)
/* call monitorenter function */
#if defined(ENABLE_THREADS)
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* stack offset for monitor argument */
s1 = rd->memuse;
#endif
#if defined(ENABLE_THREADS)
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
disp = dseg_add_functionptr(cd, LOCK_monitor_exit);
M_ALD(REG_ITMP3, REG_PV, disp);
methoddesc *md;
s4 i, j;
s4 t;
- s4 s1, s2, disp;
- s4 funcdisp; /* displacement of the function */
+ int s1, s2;
+ int disp;
/* get required compiler data */
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);
-
/* save integer and float argument registers */
#if SIZEOF_VOID_P == 8
M_ALD(REG_A0, REG_PV, disp);
}
- /* do the native function call */
+ /* Call the native function. */
- M_ALD(REG_ITMP3, REG_PV, funcdisp); /* load adress of native method */
+ disp = dseg_add_functionptr(cd, f);
+ M_ALD(REG_ITMP3, REG_PV, disp); /* load adress of native method */
M_JSR(REG_RA, REG_ITMP3); /* call native method */
M_NOP; /* delay slot */