Author: Hakan Ardo <[email protected]>
Branch:
Changeset: r50544:94f53881b7bf
Date: 2011-12-15 12:48 +0100
http://bitbucket.org/pypy/pypy/changeset/94f53881b7bf/
Log: setinteriorfield_should_not_clear_cache
diff --git a/pypy/jit/metainterp/optimizeopt/heap.py
b/pypy/jit/metainterp/optimizeopt/heap.py
--- a/pypy/jit/metainterp/optimizeopt/heap.py
+++ b/pypy/jit/metainterp/optimizeopt/heap.py
@@ -246,15 +246,16 @@
self.force_lazy_setfields_and_arrayitems_for_guard())
return
opnum = op.getopnum()
- if (opnum == rop.SETFIELD_GC or # handled specially
- opnum == rop.SETFIELD_RAW or # no effect on GC struct/array
- opnum == rop.SETARRAYITEM_GC or # handled specially
- opnum == rop.SETARRAYITEM_RAW or # no effect on GC struct
- opnum == rop.STRSETITEM or # no effect on GC struct/array
- opnum == rop.UNICODESETITEM or # no effect on GC struct/array
- opnum == rop.DEBUG_MERGE_POINT or # no effect whatsoever
- opnum == rop.COPYSTRCONTENT or # no effect on GC struct/array
- opnum == rop.COPYUNICODECONTENT): # no effect on GC struct/array
+ if (opnum == rop.SETFIELD_GC or # handled specially
+ opnum == rop.SETFIELD_RAW or # no effect on GC struct/array
+ opnum == rop.SETARRAYITEM_GC or # handled specially
+ opnum == rop.SETARRAYITEM_RAW or # no effect on GC struct
+ opnum == rop.SETINTERIORFIELD_RAW or # no effect on GC struct
+ opnum == rop.STRSETITEM or # no effect on GC struct/array
+ opnum == rop.UNICODESETITEM or # no effect on GC struct/array
+ opnum == rop.DEBUG_MERGE_POINT or # no effect whatsoever
+ opnum == rop.COPYSTRCONTENT or # no effect on GC struct/array
+ opnum == rop.COPYUNICODECONTENT): # no effect on GC struct/array
return
assert opnum != rop.CALL_PURE
if (opnum == rop.CALL or
diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -7755,6 +7755,22 @@
"""
self.optimize_loop(ops, expected)
+ def test_setinteriorfield_should_not_clear_cache(self):
+ ops = """
+ [i0, p0]
+ i2 = getfield_gc(p0, descr=adescr)
+ i3 = call(i2, descr=nonwritedescr)
+ setinteriorfield_raw(i0, i2, i3)
+ jump(i0, p0)
+ """
+ expected = """
+ [i0, p0, i2]
+ i3 = call(i2, descr=nonwritedescr)
+ setinteriorfield_raw(i0, i2, i3)
+ jump(i0, p0, i2)
+ """
+ self.optimize_loop(ops, expected)
+
class TestLLtype(OptimizeOptTest, LLtypeMixin):
pass
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit