Author: Remi Meier <[email protected]>
Branch: stmgc-c4
Changeset: r67600:1385fb758727
Date: 2013-10-25 17:51 +0200
http://bitbucket.org/pypy/pypy/changeset/1385fb758727/
Log: add missing string resops that really need barriers in stmrewrite
diff --git a/TODO b/TODO
--- a/TODO
+++ b/TODO
@@ -1,3 +1,18 @@
+------------------------------------------------------------
+
+constptrs always require slowpath of read_barrier if they
+point to a stub
+they also always require the slowpath of a write-barrier
+because there is always one indirection to the current version
+
+------------------------------------------------------------
+
+we may have too many transaction breaks in jitted code.
+
+------------------------------------------------------------
+
+unregister constptrs in stmgc when freeing traces
+
------------------------------------------------------------
stm-jitdriver with autoreds
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
@@ -69,7 +69,9 @@
# ---------- pure operations needing read-barrier ----------
if opnum in (rop.GETFIELD_GC_PURE,
rop.GETARRAYITEM_GC_PURE,
- rop.ARRAYLEN_GC,):
+ rop.ARRAYLEN_GC, rop.STRGETITEM,
+ rop.UNICODEGETITEM, rop.STRLEN,
+ rop.UNICODELEN):
# e.g. getting inst_intval of a W_IntObject that is
# currently only a stub needs to first resolve to a
# real object
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
@@ -646,8 +646,24 @@
stm_transaction_break(1)
jump()
""")
- py.test.skip("XXX not really right: should instead be an assert "
- "that p1 is already a W")
+ # py.test.skip("XXX not really right: should instead be an assert "
+ # "that p1 is already a W")
+
+ def test_rewrite_strgetitem_unicodegetitem(self):
+ self.check_rewrite("""
+ [p1, i2, i3]
+ i4=strgetitem(p1, i2)
+ i5=unicodegetitem(p1, i2)
+ jump()
+ """, """
+ [p1, i2, i3]
+ cond_call_stm_b(p1, descr=A2Idescr)
+ i4=strgetitem(p1, i2)
+ i5=unicodegetitem(p1, i2)
+ stm_transaction_break(1)
+ jump()
+ """)
+
def test_call_release_gil(self):
T = rffi.CArrayPtr(rffi.TIME_T)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit