static monitorenter
authorstefan <none@none>
Sat, 3 Jul 2004 10:32:02 +0000 (10:32 +0000)
committerstefan <none@none>
Sat, 3 Jul 2004 10:32:02 +0000 (10:32 +0000)
jit/alpha/codegen.c
jit/i386/codegen.c
src/vm/jit/alpha/codegen.c
src/vm/jit/i386/codegen.c

index 262be37ca96c3f274f65ab311586783925073e58..172e57ebdc16e4e17764baf66a57819799cc1a5d 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Reinhard Grafl
 
-   $Id: codegen.c 1218 2004-06-29 14:11:16Z twisti $
+   $Id: codegen.c 1270 2004-07-03 10:32:02Z stefan $
 
 */
 
@@ -620,7 +620,9 @@ void codegen(methodinfo *m)
 #if defined(USE_THREADS)
        if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
                s4 disp;
-               p = dseg_addaddress((void*) (builtin_monitorenter));
+               s8 func_enter = (method->flags & ACC_STATIC) ?
+                       (s8) builtin_staticmonitorenter : (s8) builtin_monitorenter;
+               p = dseg_addaddress((void*) func_enter);
                M_ALD(REG_PV, REG_PV, p);
                M_ALD(argintregs[0], REG_SP, maxmemuse * 8);
                M_JSR(REG_RA, REG_PV);
index e910c302082c6bb843d0624c9228d386a3470205..c598e377f447b29cf7273cb2639830c37d878f0f 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Christian Thalinger
 
-   $Id: codegen.c 1258 2004-06-30 21:35:11Z twisti $
+   $Id: codegen.c 1270 2004-07-03 10:32:02Z stefan $
 
 */
 
@@ -345,6 +345,9 @@ void codegen(methodinfo *m)
        /* save monitorenter argument */
 
 #if defined(USE_THREADS)
+       s4 func_enter = (m->flags & ACC_STATIC) ?
+               (s4) builtin_staticmonitorenter : (s4) builtin_monitorenter;
+
        if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
                if (m->flags & ACC_STATIC) {
                        i386_mov_imm_reg((s4) m->class, REG_ITMP1);
@@ -359,7 +362,7 @@ void codegen(methodinfo *m)
 
                i386_alu_imm_reg(I386_SUB, 4, REG_SP);
                i386_mov_reg_membase(REG_ITMP1, REG_SP, 0);
-               i386_mov_imm_reg((s4) builtin_monitorenter, REG_ITMP1);
+               i386_mov_imm_reg(func_enter, REG_ITMP1);
                i386_call_reg(REG_ITMP1);
                i386_alu_imm_reg(I386_ADD, 4, REG_SP);
        }                       
index 262be37ca96c3f274f65ab311586783925073e58..172e57ebdc16e4e17764baf66a57819799cc1a5d 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Reinhard Grafl
 
-   $Id: codegen.c 1218 2004-06-29 14:11:16Z twisti $
+   $Id: codegen.c 1270 2004-07-03 10:32:02Z stefan $
 
 */
 
@@ -620,7 +620,9 @@ void codegen(methodinfo *m)
 #if defined(USE_THREADS)
        if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
                s4 disp;
-               p = dseg_addaddress((void*) (builtin_monitorenter));
+               s8 func_enter = (method->flags & ACC_STATIC) ?
+                       (s8) builtin_staticmonitorenter : (s8) builtin_monitorenter;
+               p = dseg_addaddress((void*) func_enter);
                M_ALD(REG_PV, REG_PV, p);
                M_ALD(argintregs[0], REG_SP, maxmemuse * 8);
                M_JSR(REG_RA, REG_PV);
index e910c302082c6bb843d0624c9228d386a3470205..c598e377f447b29cf7273cb2639830c37d878f0f 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Christian Thalinger
 
-   $Id: codegen.c 1258 2004-06-30 21:35:11Z twisti $
+   $Id: codegen.c 1270 2004-07-03 10:32:02Z stefan $
 
 */
 
@@ -345,6 +345,9 @@ void codegen(methodinfo *m)
        /* save monitorenter argument */
 
 #if defined(USE_THREADS)
+       s4 func_enter = (m->flags & ACC_STATIC) ?
+               (s4) builtin_staticmonitorenter : (s4) builtin_monitorenter;
+
        if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
                if (m->flags & ACC_STATIC) {
                        i386_mov_imm_reg((s4) m->class, REG_ITMP1);
@@ -359,7 +362,7 @@ void codegen(methodinfo *m)
 
                i386_alu_imm_reg(I386_SUB, 4, REG_SP);
                i386_mov_reg_membase(REG_ITMP1, REG_SP, 0);
-               i386_mov_imm_reg((s4) builtin_monitorenter, REG_ITMP1);
+               i386_mov_imm_reg(func_enter, REG_ITMP1);
                i386_call_reg(REG_ITMP1);
                i386_alu_imm_reg(I386_ADD, 4, REG_SP);
        }