* src/vm/jit/powerpc64/linux/md-os.c (thread_restartcriticalsection):
authortbfg <none@none>
Wed, 9 May 2007 08:36:16 +0000 (08:36 +0000)
committertbfg <none@none>
Wed, 9 May 2007 08:36:16 +0000 (08:36 +0000)
Renamed to md_critical_section_restart.

* src/vm/jit/powerpc64/codegen.c (codegen_emit): Use
CODEGEN_CRITICAL_SECTION_* macros.

src/vm/jit/powerpc64/codegen.c
src/vm/jit/powerpc64/linux/md-os.c

index bb246fb81ace14c0d09b0d5ae20fb702956e480a..ceef8580c4ddf916642c490bec5587b801948e63 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: codegen.c 7817 2007-04-25 19:42:50Z twisti $
+   $Id: codegen.c 7888 2007-05-09 08:36:16Z tbfg $
 
 */
 
@@ -2318,10 +2318,11 @@ gen_method:
                                        super = iptr->sx.s23.s3.c.cls;
                                        superindex = super->index;
                                }
-                       
-#if defined(ENABLE_THREADS)
-                               codegen_threadcritrestart(cd, cd->mcodeptr - cd->mcodebase);
-#endif
+               
+                               if ((super == NULL) || !(super->flags & ACC_INTERFACE)) {
+                                       CODEGEN_CRITICAL_SECTION_NEW;
+                               }
+
                                s1 = emit_load_s1(jd, iptr, REG_ITMP1);
 
                                /* calculate interface checkcast code size */
@@ -2402,17 +2403,17 @@ gen_method:
                                        }
 
                                        M_ALD(REG_ITMP2, s1, OFFSET(java_objectheader, vftbl));
-#if defined(ENABLE_THREADS)
-                                       codegen_threadcritstart(cd, cd->mcodeptr - cd->mcodebase);
-#endif
+
+                                       CODEGEN_CRITICAL_SECTION_START;
+
                                        M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                        M_ALD(REG_ITMP2, REG_PV, disp);
                                        if (s1 != REG_ITMP1) {
                                                M_ILD(REG_ITMP1, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
-#if defined(ENABLE_THREADS)
-                                               codegen_threadcritstop(cd, cd->mcodeptr - cd->mcodebase);
-#endif
+
+                                               CODEGEN_CRITICAL_SECTION_END;
+
                                                M_SUB(REG_ITMP3, REG_ITMP1, REG_ITMP3);
                                                M_EXTSW(REG_ITMP3, REG_ITMP3);
                                        } else {
@@ -2421,9 +2422,9 @@ gen_method:
                                                M_EXTSW(REG_ITMP3, REG_ITMP3);
                                                M_ALD(REG_ITMP2, REG_PV, disp);
                                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
-#if defined(ENABLE_THREADS)
-                                               codegen_threadcritstop(cd, cd->mcodeptr - cd->mcodebase);
-#endif
+
+                                               CODEGEN_CRITICAL_SECTION_END;
+
                                        }
                                        M_CMPU(REG_ITMP3, REG_ITMP2);
                                        emit_classcast_check(cd, iptr, BRANCH_GT, REG_ITMP3, s1);
@@ -2495,9 +2496,10 @@ gen_method:
                                supervftbl = super->vftbl;
                        }
                        
-#if defined(ENABLE_THREADS)
-            codegen_threadcritrestart(cd, cd->mcodeptr - cd->mcodebase);
-#endif
+                       if ((super == NULL) || !(super->flags & ACC_INTERFACE)) {
+                               CODEGEN_CRITICAL_SECTION_NEW;
+                       }
+
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
                        if (s1 == d) {
@@ -2581,15 +2583,15 @@ gen_method:
 
                                M_ALD(REG_ITMP1, s1, OFFSET(java_objectheader, vftbl));
                                M_ALD(REG_ITMP2, REG_PV, disp);
-#if defined(ENABLE_THREADS)
-                               codegen_threadcritstart(cd, cd->mcodeptr - cd->mcodebase);
-#endif
+
+                               CODEGEN_CRITICAL_SECTION_START;
+
                                M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl_t, diffval));
-#if defined(ENABLE_THREADS)
-                               codegen_threadcritstop(cd, cd->mcodeptr - cd->mcodebase);
-#endif
+
+                               CODEGEN_CRITICAL_SECTION_END;
+
                                M_SUB(REG_ITMP1, REG_ITMP3, REG_ITMP1);
                                M_EXTSW(REG_ITMP1, REG_ITMP1);
                                M_CMPU(REG_ITMP1, REG_ITMP2);
index 730435c0294af9d7d26a306573c6dbfe6da7d32e..5c7648744ec5615ca70fa4e133d0ac3126b37390 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: md-os.c 7596 2007-03-28 21:05:53Z twisti $
+   $Id: md-os.c 7888 2007-05-09 08:36:16Z tbfg $
 
 */
 
@@ -135,7 +135,7 @@ void md_signal_handler_sigusr2(int sig, siginfo_t *siginfo, void *_p)
 }
 
 
-void thread_restartcriticalsection(ucontext_t *_uc)
+void md_critical_section_restart(ucontext_t *_uc)
 {
        mcontext_t *_mc;
        u1         *pc;
@@ -147,8 +147,10 @@ void thread_restartcriticalsection(ucontext_t *_uc)
 
        critical = critical_find_restart_point(pc);
 
-       if (critical != NULL)
+       if (critical != NULL)   {
+               log_println("md_critical_section_restart: pc=%p, npc=%p", pc, critical);
                _mc->gp_regs[PT_NIP] = (ptrint) critical;
+       }
 }
 #endif