/* monitor_exit. The stack position for the argument can not be shared */
/* with place to save the return register on PPC64, since both values */
/* reside in R3 */
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* reserve 2 slots for long/double return values for monitorexit */
cd->stackframesize += 2;
}
(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.
*/
+ /* XXX Remove this "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 + 1) * 8;
+ /* REMOVEME dummy IsSync */
+ (void) dseg_add_unique_s4(cd, 0);
/* REMOVEME: We still need it for exception handling in assembler. */
#if defined(ENABLE_THREADS)
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* stackoffset for argument used for LOCK_monitor_exit */
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);
M_ALD(REG_ITMP3, REG_ITMP3, 0); /* TOC */