[pypy-commit] pypy stmgc-c4: Fix for e6fe5ef81974

arigo noreply at buildbot.pypy.org
Fri Oct 4 07:04:40 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c4
Changeset: r67148:622d65b97854
Date: 2013-10-04 06:01 +0200
http://bitbucket.org/pypy/pypy/changeset/622d65b97854/

Log:	Fix for e6fe5ef81974

diff --git a/rpython/rlib/objectmodel.py b/rpython/rlib/objectmodel.py
--- a/rpython/rlib/objectmodel.py
+++ b/rpython/rlib/objectmodel.py
@@ -788,22 +788,8 @@
         "NOT_RPYTHON"
     def __exit__(self, *args):
         "NOT_RPYTHON"
-
-class Entry(ExtRegistryEntry):
-    _about_ = _StmIgnored.__enter__.im_func
-    def compute_result_annotation(self, *args_s):
-        return None
-    def specialize_call(self, hop):
-        hop.exception_cannot_occur()
-        hop.genop('stm_ignored_start', [])
-
-class Entry(ExtRegistryEntry):
-    _about_ = _StmIgnored.__exit__.im_func
-    def compute_result_annotation(self, *args_s):
-        return None
-    def specialize_call(self, hop):
-        hop.exception_cannot_occur()
-        hop.genop('stm_ignored_stop', [])
+    def _freeze_(self):
+        return True
 
 # Use "with stm_ignored:" around simple field read/write operations
 # that should not be tracked by the STM machinery.  They are always
@@ -814,3 +800,24 @@
 # XXX but it should replace 'stm_dont_track_raw_accesses' too
 # XXX DON'T USE for *writes* of a GC pointer into an object
 stm_ignored = _StmIgnored()
+
+
+# RPython hacks
+def _stm_ignored_start(): "NOT_RPYTHON"
+def _stm_ignored_stop(exc, val, tb): "NOT_RPYTHON"
+stm_ignored.__enter__ = _stm_ignored_start
+stm_ignored.__exit__ = _stm_ignored_stop
+class Entry(ExtRegistryEntry):
+    _about_ = _stm_ignored_start
+    def compute_result_annotation(self, *args_s):
+        return None
+    def specialize_call(self, hop):
+        hop.exception_cannot_occur()
+        hop.genop('stm_ignored_start', [])
+class Entry(ExtRegistryEntry):
+    _about_ = _stm_ignored_stop
+    def compute_result_annotation(self, *args_s):
+        return None
+    def specialize_call(self, hop):
+        hop.exception_cannot_occur()
+        hop.genop('stm_ignored_stop', [])


More information about the pypy-commit mailing list