[pypy-commit] pypy stm-gc: Prevent popitem() from generating spurious conflicts.

arigo noreply at buildbot.pypy.org
Mon Feb 20 14:18:55 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r52677:b34d343bd69b
Date: 2012-02-20 14:18 +0100
http://bitbucket.org/pypy/pypy/changeset/b34d343bd69b/

Log:	Prevent popitem() from generating spurious conflicts.

diff --git a/pypy/rpython/lltypesystem/rdict.py b/pypy/rpython/lltypesystem/rdict.py
--- a/pypy/rpython/lltypesystem/rdict.py
+++ b/pypy/rpython/lltypesystem/rdict.py
@@ -850,7 +850,8 @@
     i = ll_dict_lookup(d, key, d.keyhash(key))
     return not i & HIGHEST_BIT
 
-POPITEMINDEX = lltype.Struct('PopItemIndex', ('nextindex', lltype.Unsigned))
+POPITEMINDEX = lltype.Struct('PopItemIndex', ('nextindex', lltype.Unsigned),
+                             hints={'stm_dont_track_raw_accesses': True})
 global_popitem_index = lltype.malloc(POPITEMINDEX, zero=True, immortal=True)
 
 def _ll_getnextitem(dic):
diff --git a/pypy/translator/stm/transform.py b/pypy/translator/stm/transform.py
--- a/pypy/translator/stm/transform.py
+++ b/pypy/translator/stm/transform.py
@@ -91,8 +91,10 @@
         if op.result.concretetype is lltype.Void:
             newoperations.append(op)
             return
-        if op.args[0].concretetype.TO._gckind == 'raw':
-            if not is_immutable(op):
+        S = op.args[0].concretetype.TO
+        if S._gckind == 'raw':
+            if not (is_immutable(op) or
+                    S._hints.get('stm_dont_track_raw_accesses', False)):
                 turn_inevitable(newoperations, op.opname + '-raw')
             newoperations.append(op)
             return
@@ -113,8 +115,10 @@
         if op.args[-1].concretetype is lltype.Void:
             newoperations.append(op)
             return
-        if op.args[0].concretetype.TO._gckind == 'raw':
-            if not is_immutable(op):
+        S = op.args[0].concretetype.TO
+        if S._gckind == 'raw':
+            if not (is_immutable(op) or
+                    S._hints.get('stm_dont_track_raw_accesses', False)):
                 turn_inevitable(newoperations, op.opname + '-raw')
             newoperations.append(op)
             return


More information about the pypy-commit mailing list