(temporarily).
* src/vm/exceptions.c (exceptions_handle_exception): Don't use IsSync
but code->synchronizedoffset.
* src/vm/jit/allocator/lsra.c,
src/vm/jit/allocator/simplereg.c,
src/vm/jit/code.c: Use code_is_synchronized.
* src/vm/jit/alpha/codegen.c,
src/vm/jit/arm/codegen.c,
src/vm/jit/i386/codegen.c,
src/vm/jit/m68k/codegen.c,
src/vm/jit/mips/codegen.c,
src/vm/jit/powerpc/codegen.c,
src/vm/jit/powerpc64/codegen.c,
src/vm/jit/s390/codegen.c,
src/vm/jit/sparc64/codegen.c,
src/vm/jit/x86_64/codegen.c: Use code_is_synchronized and set
code->synchronizedoffset.
java_handle_t *xptr;
methodinfo *m;
codeinfo *code;
- s4 issync;
dseg_exception_entry *ex;
s4 exceptiontablelength;
s4 i;
result = NULL;
- /* get info from the method header */
+ /* Get the codeinfo for the current method. */
+
+ code = code_get_codeinfo_for_pv(pv);
- code = *((codeinfo **) (pv + CodeinfoPointer));
- issync = *((s4 *) (pv + IsSync));
ex = (dseg_exception_entry *) (pv + ExTableStart);
exceptiontablelength = *((s4 *) (pv + ExTableSize));
}
#if defined(ENABLE_THREADS)
- /* is this method synchronized? */
+ /* Is this method realization synchronized? */
- if (issync) {
- /* get synchronization object */
+ if (code_is_synchronized(code)) {
+ /* Get synchronization object. */
# if (defined(__MIPS__) && (SIZEOF_VOID_P == 4)) || defined(__I386__) || defined(__S390__) || defined(__POWERPC__)
/* XXX change this if we ever want to use 4-byte stackslots */
- o = *((java_object_t **) (sp + issync - 8));
+ o = *((java_object_t **) (sp + code->synchronizedoffset - 8));
# else
- o = *((java_object_t **) (sp + issync - SIZEOF_VOID_P));
+ o = *((java_object_t **) (sp + code->synchronizedoffset - SIZEOF_VOID_P));
# endif
assert(o != NULL);
/* rd->memuse was already set in stack.c to allocate stack space for */
/* passing arguments to called methods */
#if defined(__I386__)
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* reserve 0(%esp) for Monitorenter/exit Argument on i386 */
if (rd->memuse < 1)
rd->memuse = 1;
for passing arguments to called methods. */
#if defined(__I386__)
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* reserve 0(%esp) for Monitorenter/exit Argument on i386 */
if (rd->memuse < 1)
rd->memuse = 1;
cd->stackframesize = rd->memuse + savedregs_num;
#if defined(ENABLE_THREADS) /* space to save argument of monitor_enter */
- if (checksync && (m->flags & ACC_SYNCHRONIZED))
+ if (checksync && code_is_synchronized(code))
cd->stackframesize++;
#endif
(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. */
/* 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)) {
M_ALD(REG_A0, REG_SP, rd->memuse * 8);
switch (iptr->opc) {
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 * 8 + 4;
+
+ /* REMOVEME dummy IsSync */
+ (void) dseg_add_unique_s4(cd, 0);
/* 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;
if (!checksync)
return 0;
- if (!(code->m->flags & ACC_SYNCHRONIZED))
+ if (!code_is_synchronized(code))
return 0;
count = 1;
u1 optlevel; /* optimization level of this code */
s4 basicblockcount; /* number of basic blocks */
+ int32_t synchronizedoffset; /* stack offset of synchronized obj. */
+
/* machine code */
u1 *mcode; /* pointer to machine code */
u1 *entrypoint; /* machine code entry point */
#if defined(ENABLE_THREADS)
/* space to save argument of monitor_enter */
- if (checksync && (m->flags & ACC_SYNCHRONIZED))
+ if (checksync && code_is_synchronized(code))
cd->stackframesize++;
#endif
(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 (code_is_leafmethod(code))
(void) dseg_add_unique_s4(cd, 1); /* IsLeaf */
else
/* call monitorenter function */
#if defined(ENABLE_THREADS)
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
s1 = rd->memuse;
if (m->flags & ACC_STATIC) {
#endif
#if defined(ENABLE_THREADS)
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
M_ALD(REG_ITMP2, REG_SP, rd->memuse * 8);
/* we need to save the proper return value */
#if 0
#if defined(ENABLE_THREADS)
/* we need additional space to save argument of monitor_enter */
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
if (IS_2_WORD_TYPE(m->parseddesc->returntype.type)) {
cd->stackframesize += 2;
} else {
/* create method header */
(void) dseg_add_unique_address(cd, code); /* CodeinfoPointer */
(void) dseg_add_unique_s4(cd, cd->stackframesize); /* FrameSize */
-#if defined(ENABLE_THREADS)
- 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 */
+
+ /* XXX Remove this "offset by one". */
+
+ 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)
/* call lock_monitor_enter function */
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
if (m->flags & ACC_STATIC) {
M_AMOV_IMM((&m->class->object.header), REG_ATMP1);
} else {
#if defined(ENABLE_THREADS)
/* call lock_monitor_exit */
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
M_ILD(REG_ITMP3, REG_SP, rd->memuse * 8);
/* we need to save the proper return value */
#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.
*/
+ /* 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. */
/* 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);
not be shared with place to save the return register on PPC,
since both values reside in R3. */
- if (checksync && (m->flags & ACC_SYNCHRONIZED))
+ if (checksync && code_is_synchronized(code))
cd->stackframesize += 2;
#endif
(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)
/* call monitorenter function */
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* stack offset for monitor argument */
s1 = rd->memuse;
emit_verbosecall_exit(jd);
#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_MTCTR(REG_ITMP3);
/* 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 */
not be shared with place to save the return register
since both values reside in R2. */
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* 1 slot space to save argument of monitor_enter */
/* 1 slot to temporary store return value before monitor_exit */
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. */
/* save monitorenter argument */
#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 /* !defined(NDEBUG) */
#if defined(ENABLE_THREADS)
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
/* we need to save the proper return value */
switch (iptr->opc) {
cd->stackframesize = rd->memuse + savedregs_num;
#if defined(ENABLE_THREADS) /* space to save argument of monitor_enter */
- if (checksync && (m->flags & ACC_SYNCHRONIZED))
+ if (checksync && code_is_synchronized(code))
cd->stackframesize++;
#endif
(void) dseg_add_unique_address(cd, code); /* CodeinfoPointer */
framesize_disp = 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, JITSTACK + (rd->memuse + 1) * 8); /* IsSync */
- else
-#endif
- (void) dseg_add_unique_s4(cd, 0); /* IsSync */
+ code->synchronizedoffset = JITSTACK + (rd->memuse + 1) * 8;
+
+ /* REMOVEME dummy IsSync */
+ (void) dseg_add_unique_s4(cd, 0);
/* REMOVEME: We still need it for exception handling in assembler. */
/* 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)) {
/* XXX jit-c-call */
disp = dseg_add_functionptr(cd, LOCK_monitor_exit);
M_ALD(REG_ITMP3, REG_PV, disp);
#if defined(ENABLE_THREADS)
/* space to save argument of monitor_enter */
- if (checksync && (m->flags & ACC_SYNCHRONIZED))
+ if (checksync && code_is_synchronized(code))
cd->stackframesize++;
#endif
(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);
if (code_is_leafmethod(code))
(void) dseg_add_unique_s4(cd, 1); /* IsLeaf */
/* save monitorenter argument */
#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 /* !defined(NDEBUG) */
#if defined(ENABLE_THREADS)
- if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
+ if (checksync && code_is_synchronized(code)) {
M_ALD(REG_A0, REG_SP, rd->memuse * 8);
/* we need to save the proper return value */