[pypy-commit] pypy stmgc-c7: adapt some tests and make hint_commit_soon do something again even if transaction_length is set to unlimited. It previously didn't do anything in that case, so now we will get more breaks again since we call stmcb_commit_soon in minor collections.

Raemi noreply at buildbot.pypy.org
Tue Jul 1 16:57:52 CEST 2014


Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch: stmgc-c7
Changeset: r72307:3e144ed1d5b7
Date: 2014-07-01 16:58 +0200
http://bitbucket.org/pypy/pypy/changeset/3e144ed1d5b7/

Log:	adapt some tests and make hint_commit_soon do something again even
	if transaction_length is set to unlimited. It previously didn't do
	anything in that case, so now we will get more breaks again since we
	call stmcb_commit_soon in minor collections.

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
@@ -42,7 +42,8 @@
         if (((long)pypy_stm_nursery_low_fill_mark_saved) > 0) {
             pypy_stm_nursery_low_fill_mark_saved = 0;
         }
-    } else if (((long)pypy_stm_nursery_low_fill_mark) > 0) {
+    } else {
+        /* if (((long)pypy_stm_nursery_low_fill_mark) > 0)  */
         /* if not set to unlimited by pypy_stm_setup() (s.b.) */
         pypy_stm_nursery_low_fill_mark = 0;
     }
diff --git a/rpython/translator/stm/test/test_ztranslated.py b/rpython/translator/stm/test/test_ztranslated.py
--- a/rpython/translator/stm/test/test_ztranslated.py
+++ b/rpython/translator/stm/test/test_ztranslated.py
@@ -90,6 +90,7 @@
 
     def test_should_break_transaction(self):
         def entry_point(argv):
+            rstm.hint_commit_soon()
             print '<', int(rstm.should_break_transaction()), '>'
             return 0
         t, cbuilder = self.compile(entry_point)
@@ -213,7 +214,7 @@
         S = lltype.GcStruct('S', ('got_exception', OBJECTPTR))
         PS = lltype.Ptr(S)
         perform_transaction = rstm.make_perform_transaction(check, PS)
-        
+
         from rpython.rtyper.lltypesystem import lltype
         R = lltype.GcStruct('R', ('x', lltype.Signed))
         S1 = lltype.Struct('S1', ('r', lltype.Ptr(R)))
@@ -281,6 +282,11 @@
             Parent().xy = 0
             globf.xy = -2
             globf.yx = 'hi there %d' % len(argv)
+
+            # make sure perform_transaction breaks the transaction:
+            rstm.hint_commit_soon()
+            assert rstm.should_break_transaction()
+
             perform_transaction(lltype.nullptr(PS.TO))
             return 0
         t, cbuilder = self.compile(main)
@@ -378,6 +384,9 @@
         perform_transaction = rstm.make_perform_transaction(check, PS)
 
         def main(argv):
+            # make sure perform_transaction breaks the transaction:
+            rstm.hint_commit_soon()
+            assert rstm.should_break_transaction()
             perform_transaction(lltype.nullptr(PS.TO))
             return 0
 
@@ -589,8 +598,8 @@
                 'File "/tmp/foobaz.py", line 73, in bar\n'
                 'stopping bar\n') in data
         assert ('starting some_extremely_longish_and_boring_function_name\n'
-                'File "...bla/br/project/foobaz.py", line 81,'
-                ' in some_extremely_longish_a...\n') in data
+                'File "<bla/br/project/foobaz.py", line 81,'
+                ' in some_extremely_longish_a>\n') in data
 
     def test_pypy_marker_2(self):
         import time
@@ -619,6 +628,11 @@
             llop.stm_setup_expand_marker_for_pypy(
                 lltype.Void, pycode1,
                 "co_filename", "co_name", "co_firstlineno", "co_lnotab")
+
+            # make sure perform_transaction breaks the transaction:
+            rstm.hint_commit_soon()
+            assert rstm.should_break_transaction()
+
             perform_transaction(lltype.malloc(S))
             return 0
         #


More information about the pypy-commit mailing list