Commits

Armin Rigo  committed a5a9bfc

Go through "hint" operations that are not related to stm.

  • Participants
  • Parent commits f20611c
  • Branches stm-gc

Comments (0)

Files changed (2)

File pypy/translator/stm/gcsource.py

         for block in graph.iterblocks():
             for op in block.operations:
                 #
-                if op.opname in COPIES_POINTER:
+                if (op.opname in COPIES_POINTER or
+                        (op.opname == 'hint' and
+                         'stm_write' not in op.args[1].value)):
                     if _is_gc(op.result) and _is_gc(op.args[0]):
                         resultlist.append((op.args[0], op.result))
                         continue

File pypy/translator/stm/test/test_gcsource.py

 from pypy.translator.stm.gcsource import GcSource
 from pypy.objspace.flow.model import SpaceOperation, Constant
 from pypy.rpython.lltypesystem import lltype
+from pypy.rlib.jit import hint
 
 
 class X:
     v_result = gsrc.translator.graphs[0].getreturnvar()
     s = gsrc[v_result]
     assert list(s) == ['last_exc_value']
+
+def test_hint_xyz():
+    def main(n):
+        return hint(X(n), xyz=True)
+    gsrc = gcsource(main, [int])
+    v_result = gsrc.translator.graphs[0].getreturnvar()
+    s = gsrc[v_result]
+    assert len(s) == 1
+    assert list(s)[0].opname == 'malloc'
+
+def test_hint_stm_write():
+    def main(n):
+        return hint(X(n), stm_write=True)
+    gsrc = gcsource(main, [int])
+    v_result = gsrc.translator.graphs[0].getreturnvar()
+    s = gsrc[v_result]
+    assert len(s) == 1
+    assert list(s)[0].opname == 'hint'