Author: Remi Meier <remi.me...@inf.ethz.ch>
Branch: stmgc-c7
Changeset: r71275:cce0ed9a775c
Date: 2014-05-05 10:57 +0200
http://bitbucket.org/pypy/pypy/changeset/cce0ed9a775c/

Log:    add real stmcb_commit_soon()

diff --git a/rpython/translator/stm/src_stm/stmgcintf.c 
b/rpython/translator/stm/src_stm/stmgcintf.c
--- a/rpython/translator/stm/src_stm/stmgcintf.c
+++ b/rpython/translator/stm/src_stm/stmgcintf.c
@@ -23,6 +23,16 @@
     pypy_stmcb_trace(obj, (void(*)(void*))visit);
 }
 
+inline void stmcb_commit_soon()
+{
+    if (pypy_stm_nursery_low_fill_mark == (uintptr_t)-1) {
+        /* atomic */
+        pypy_stm_nursery_low_fill_mark_saved = 0;
+    } else {
+        pypy_stm_nursery_low_fill_mark >>= 2;
+    }
+}
+
 
 /************************************************************/
 /* "include" the stmgc.c file here */
@@ -147,7 +157,7 @@
                transaction.
              */
             assert(pypy_stm_nursery_low_fill_mark != (uintptr_t) -1);
-            assert((STM_SEGMENT->jmpbuf_ptr == NULL) ==
+            assert(!(STM_SEGMENT->jmpbuf_ptr == NULL) ||
                    (pypy_stm_nursery_low_fill_mark == 0));
 
             stm_commit_transaction();
@@ -182,7 +192,7 @@
            transaction whose jmpbuf points into this function
         */
         if (pypy_stm_ready_atomic == 1) {
-            assert(pypy_stm_nursery_low_fill_mark != 0);
+            //assert(pypy_stm_nursery_low_fill_mark != 0);
             assert(pypy_stm_nursery_low_fill_mark != (uintptr_t) -1);
             stm_commit_transaction();
             pypy_stm_nursery_low_fill_mark = 0;
@@ -196,7 +206,7 @@
     }
     /* double-check */
     if (pypy_stm_ready_atomic == 1) {
-        assert((STM_SEGMENT->jmpbuf_ptr == NULL) ==
+        assert(!(STM_SEGMENT->jmpbuf_ptr == NULL) ||
                (pypy_stm_nursery_low_fill_mark == 0));
     }
     else {
@@ -234,5 +244,3 @@
     _pypy_stm_inev_state();
     stm_become_globally_unique_transaction(&stm_thread_local, "for the JIT");
 }
-
-void stmcb_commit_soon(void) { /*XXX FIXME*/ }
diff --git a/rpython/translator/stm/src_stm/stmgcintf.h 
b/rpython/translator/stm/src_stm/stmgcintf.h
--- a/rpython/translator/stm/src_stm/stmgcintf.h
+++ b/rpython/translator/stm/src_stm/stmgcintf.h
@@ -73,7 +73,7 @@
     case 1:
         pypy_stm_nursery_low_fill_mark = pypy_stm_nursery_low_fill_mark_saved;
         assert(pypy_stm_nursery_low_fill_mark != (uintptr_t) -1);
-        assert((STM_SEGMENT->jmpbuf_ptr == NULL) ==
+        assert(!(STM_SEGMENT->jmpbuf_ptr == NULL) ||
                (pypy_stm_nursery_low_fill_mark == 0));
         break;
     case 0:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to