[pypy-commit] pypy stm-gc: Fixes

arigo noreply at buildbot.pypy.org
Mon Apr 16 15:51:34 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54420:f0e91e76c868
Date: 2012-04-16 15:50 +0200
http://bitbucket.org/pypy/pypy/changeset/f0e91e76c868/

Log:	Fixes

diff --git a/pypy/translator/stm/test/targetdemo.py b/pypy/translator/stm/test/targetdemo.py
--- a/pypy/translator/stm/test/targetdemo.py
+++ b/pypy/translator/stm/test/targetdemo.py
@@ -100,6 +100,7 @@
 
 @rgc.no_collect     # don't use the gc as long as other threads are running
 def _run():
+    rstm.enter_transactional_mode()
     i = 0
     while i < glob.NUM_THREADS:
         glob._arg = glob._arglist[i]
@@ -111,6 +112,7 @@
     while glob.done < glob.NUM_THREADS:    # poor man's lock
         _sleep(rffi.cast(rffi.ULONG, 1))
     debug_print("done sleeping.")
+    rstm.leave_transactional_mode()
 
 
 # Posix only
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
@@ -249,7 +249,7 @@
     # one variable on which we do 'stm_writebarrier', but there are
     # also other variables that contain the same pointer, e.g. casted
     # to a different precise type.
-    from pypy.translator.stm.gcsource import COPIES_POINTER
+    from pypy.translator.stm.gcsource import COPIES_POINTER, _is_gc
     #
     def emit(op):
         for v1 in op.args:
@@ -275,7 +275,8 @@
         for op in block.operations:
             if op.opname in COPIES_POINTER:
                 assert len(op.args) == 1
-                copies[op.result] = op
+                if _is_gc(op.result) and _is_gc(op.args[0]):
+                    copies[op.result] = op
             elif (op.opname in ('getfield', 'getarrayitem',
                                 'getinteriorfield') and
                   op.result.concretetype is not lltype.Void and


More information about the pypy-commit mailing list