Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r71346:b04b034d97fa
Date: 2014-05-06 23:11 +0200
http://bitbucket.org/pypy/pypy/changeset/b04b034d97fa/
Log: Test and fix
diff --git a/rpython/jit/backend/llsupport/stmrewrite.py
b/rpython/jit/backend/llsupport/stmrewrite.py
--- a/rpython/jit/backend/llsupport/stmrewrite.py
+++ b/rpython/jit/backend/llsupport/stmrewrite.py
@@ -26,7 +26,7 @@
return
# ---------- transaction breaks ----------
if opnum == rop.STM_SHOULD_BREAK_TRANSACTION:
- self.handle_should_break_transaction()
+ self.handle_should_break_transaction(op)
return
if opnum == rop.STM_TRANSACTION_BREAK:
self.emitting_an_operation_that_can_collect()
@@ -120,9 +120,10 @@
self.newops.append(op1)
self.read_barrier_applied[v_ptr] = None
- def handle_should_break_transaction(self):
+ def handle_should_break_transaction(self, op):
op1 = ResOperation(rop.STM_SHOULD_BREAK_TRANSACTION,
- [ConstInt(not self.does_any_allocation)], None)
+ [ConstInt(not self.does_any_allocation)],
+ op.result)
self.newops.append(op1)
self.does_any_allocation = True
diff --git a/rpython/jit/backend/llsupport/test/test_stmrewrite.py
b/rpython/jit/backend/llsupport/test/test_stmrewrite.py
--- a/rpython/jit/backend/llsupport/test/test_stmrewrite.py
+++ b/rpython/jit/backend/llsupport/test/test_stmrewrite.py
@@ -1233,31 +1233,37 @@
def test_stm_should_break_transaction_no_malloc(self):
self.check_rewrite("""
[]
- stm_should_break_transaction(0)
+ i1 = stm_should_break_transaction(0)
+ jump(i1)
""", """
[]
- stm_should_break_transaction(1)
+ i1 = stm_should_break_transaction(1)
+ jump(i1)
""")
def test_stm_should_break_transaction_with_malloc(self):
self.check_rewrite("""
[]
p2 = new(descr=tdescr)
- stm_should_break_transaction(0)
+ i1 = stm_should_break_transaction(0)
+ jump(i1)
""", """
[]
p2 = call_malloc_nursery(%(tdescr.size)d)
setfield_gc(p2, %(tdescr.tid)d, descr=tiddescr)
- stm_should_break_transaction(0)
+ i1 = stm_should_break_transaction(0)
+ jump(i1)
""")
def test_double_stm_should_break_allocation(self):
self.check_rewrite("""
[]
- stm_should_break_transaction(0)
- stm_should_break_transaction(0)
+ i1 = stm_should_break_transaction(0)
+ i2 = stm_should_break_transaction(0)
+ jump(i1, i2)
""", """
[]
- stm_should_break_transaction(1)
- stm_should_break_transaction(0)
+ i1 = stm_should_break_transaction(1)
+ i2 = stm_should_break_transaction(0)
+ jump(i1, i2)
""")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit