[pypy-commit] pypy default: test short preamble and non constant case aswell
hakanardo
noreply at buildbot.pypy.org
Thu Nov 3 11:03:26 CET 2011
Author: Hakan Ardo <hakan at debian.org>
Branch:
Changeset: r48682:9f81b789732c
Date: 2011-11-03 07:50 +0100
http://bitbucket.org/pypy/pypy/changeset/9f81b789732c/
Log: test short preamble and non constant case aswell
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
@@ -7355,7 +7355,7 @@
"""
self.optimize_loop(ops, expected)
- def test_repeated_setfield_mixed_with_guard(self):
+ def test_repeated_constant_setfield_mixed_with_guard(self):
ops = """
[p22, p18]
setfield_gc(p22, 2, descr=valuedescr)
@@ -7369,11 +7369,48 @@
guard_nonnull_class(p18, ConstClass(node_vtable)) []
jump(p22, p18)
"""
+ short = """
+ [p22, p18]
+ i1 = getfield_gc(p22, descr=valuedescr)
+ guard_value(i1, 2) []
+ jump(p22, p18)
+ """
expected = """
[p22, p18]
jump(p22, p18)
"""
- self.optimize_loop(ops, expected, preamble)
+ self.optimize_loop(ops, expected, preamble, expected_short=short)
+
+ def test_repeated_setfield_mixed_with_guard(self):
+ ops = """
+ [p22, p18, i1]
+ i2 = getfield_gc(p22, descr=valuedescr)
+ call(i2, descr=nonwritedescr)
+ setfield_gc(p22, i1, descr=valuedescr)
+ guard_nonnull_class(p18, ConstClass(node_vtable)) []
+ setfield_gc(p22, i1, descr=valuedescr)
+ jump(p22, p18, i1)
+ """
+ preamble = """
+ [p22, p18, i1]
+ i2 = getfield_gc(p22, descr=valuedescr)
+ call(i2, descr=nonwritedescr)
+ setfield_gc(p22, i1, descr=valuedescr)
+ guard_nonnull_class(p18, ConstClass(node_vtable)) []
+ jump(p22, p18, i1, i1)
+ """
+ short = """
+ [p22, p18, i1]
+ i2 = getfield_gc(p22, descr=valuedescr)
+ jump(p22, p18, i1, i2)
+ """
+ expected = """
+ [p22, p18, i1, i2]
+ call(i2, descr=nonwritedescr)
+ setfield_gc(p22, i1, descr=valuedescr)
+ jump(p22, p18, i1, i1)
+ """
+ self.optimize_loop(ops, expected, preamble, expected_short=short)
class TestLLtype(OptimizeOptTest, LLtypeMixin):
pass
More information about the pypy-commit
mailing list