[pypy-commit] pypy stmgc-c8: Found a way to, maybe, reduce the frequency of heapcache resets

arigo noreply at buildbot.pypy.org
Sat May 30 21:17:30 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c8
Changeset: r77713:d2d1782d3d34
Date: 2015-05-30 21:17 +0200
http://bitbucket.org/pypy/pypy/changeset/d2d1782d3d34/

Log:	Found a way to, maybe, reduce the frequency of heapcache resets

diff --git a/rpython/jit/metainterp/pyjitpl.py b/rpython/jit/metainterp/pyjitpl.py
--- a/rpython/jit/metainterp/pyjitpl.py
+++ b/rpython/jit/metainterp/pyjitpl.py
@@ -214,8 +214,8 @@
             resbox = history.BoxInt(0)
             record_break = True
 
-        self.metainterp.heapcache.reset_keep_likely_virtuals()
-        rstm.possible_transaction_break(0)
+        if rstm.possible_transaction_break(0) or record_break:
+            self.metainterp.heapcache.reset_keep_likely_virtuals()
 
         if record_break:
             mi = self.metainterp
diff --git a/rpython/rlib/rstm.py b/rpython/rlib/rstm.py
--- a/rpython/rlib/rstm.py
+++ b/rpython/rlib/rstm.py
@@ -65,6 +65,8 @@
     if rgc.stm_is_enabled():
         if llop.stm_should_break_transaction(lltype.Bool, keep):
             break_transaction()
+            return True
+    return False
 
 def hint_commit_soon():
     """As the name says, just a hint. Maybe calling it


More information about the pypy-commit mailing list