Author: Maciej Fijalkowski <[email protected]>
Branch: optresult-unroll
Changeset: r78907:ca67a935c149
Date: 2015-08-11 12:34 +0200
http://bitbucket.org/pypy/pypy/changeset/ca67a935c149/
Log: fix some tests
diff --git a/rpython/jit/metainterp/optimizeopt/info.py
b/rpython/jit/metainterp/optimizeopt/info.py
--- a/rpython/jit/metainterp/optimizeopt/info.py
+++ b/rpython/jit/metainterp/optimizeopt/info.py
@@ -52,8 +52,7 @@
return None
def make_guards(self, op, short):
- pass # XXX
-
+ pass
class NonNullPtrInfo(PtrInfo):
_attrs_ = ('last_guard_pos',)
@@ -85,6 +84,10 @@
return
return self._visitor_walk_recursive(instbox, visitor, optimizer)
+ def make_guards(self, op, short):
+ op = ResOperation(rop.GUARD_NONNULL, [op], None)
+ short.append(op)
+
class AbstractVirtualPtrInfo(NonNullPtrInfo):
_attrs_ = ('_cached_vinfo', 'vdescr')
# XXX merge _cached_vinfo with vdescr
diff --git a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -1278,9 +1278,9 @@
[i0, p1, p3]
i28 = int_add(i0, 1)
p30 = new_with_vtable(descr=nodesize)
- setfield_gc(p30, i28, descr=nextdescr)
- setfield_gc(p3, p30, descr=valuedescr)
- p45 = getfield_gc_r(p3, descr=valuedescr)
+ setfield_gc(p30, i28, descr=valuedescr)
+ setfield_gc(p3, p30, descr=nextdescr)
+ p45 = getfield_gc_r(p3, descr=nextdescr)
i29 = int_add(i28, 1)
jump(i29, p45, p3)
"""
@@ -1289,8 +1289,8 @@
i28 = int_add(i0, 1)
i29 = int_add(i0, 2)
p30 = new_with_vtable(descr=nodesize)
- setfield_gc(p30, i28, descr=nextdescr)
- setfield_gc(p3, p30, descr=valuedescr)
+ setfield_gc(p30, i28, descr=valuedescr)
+ setfield_gc(p3, p30, descr=nextdescr)
#p46 = same_as(p30) # This same_as should be killed by backend
jump(i29, p30, p3)
"""
@@ -1299,8 +1299,8 @@
i28 = int_add(i0, 1)
i29 = int_add(i0, 2)
p30 = new_with_vtable(descr=nodesize)
- setfield_gc(p30, i28, descr=nextdescr)
- setfield_gc(p3, p30, descr=valuedescr)
+ setfield_gc(p30, i28, descr=valuedescr)
+ setfield_gc(p3, p30, descr=nextdescr)
jump(i29, p30, p3)
"""
self.optimize_loop(ops, expected, preamble)
@@ -3924,12 +3924,12 @@
expected = """
[p1]
p0 = force_token()
- p2 = new_with_vtable(ConstClass(jit_virtual_ref_vtable))
+ p2 = new_with_vtable(descr=vref_descr)
+ setfield_gc(p2, p0, descr=virtualtokendescr)
setfield_gc(p2, NULL, descr=virtualforceddescr)
- setfield_gc(p2, p0, descr=virtualtokendescr)
escape_n(p2)
+ setfield_gc(p2, NULL, descr=virtualtokendescr)
setfield_gc(p2, p1, descr=virtualforceddescr)
- setfield_gc(p2, NULL, descr=virtualtokendescr)
jump(p1)
"""
# XXX we should optimize a bit more the case of a nonvirtual.
@@ -4273,13 +4273,17 @@
i2 = int_lt(i0, 5)
jump(i2)
"""
- expected = """
+ preamble = """
[i0]
i1 = int_lt(i0, 4)
i2 = int_lt(i0, 5)
jump(i2)
"""
- self.optimize_loop(ops, expected, expected)
+ expected = """
+ [i0]
+ jump(1)
+ """
+ self.optimize_loop(ops, expected, preamble)
def test_bound_lt_noopt(self):
ops = """
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit