Author: Maciej Fijalkowski <[email protected]>
Branch: optresult-unroll
Changeset: r78906:13aafd39caf2
Date: 2015-08-09 11:41 +0200
http://bitbucket.org/pypy/pypy/changeset/13aafd39caf2/
Log: fix a few tests and improve one
diff --git a/rpython/jit/metainterp/optimizeopt/shortpreamble.py
b/rpython/jit/metainterp/optimizeopt/shortpreamble.py
--- a/rpython/jit/metainterp/optimizeopt/shortpreamble.py
+++ b/rpython/jit/metainterp/optimizeopt/shortpreamble.py
@@ -147,10 +147,11 @@
for short_op in self.const_short_boxes:
getfield_op = short_op.getfield_op
- preamble_arg = self.produce_arg(getfield_op.getarg(0))
+ args = getfield_op.getarglist()
+ preamble_arg = self.produce_arg(args[0])
if preamble_arg is not None:
preamble_op = getfield_op.copy_and_change(
- getfield_op.getopnum(), [preamble_arg])
+ getfield_op.getopnum(), [preamble_arg] + args[1:])
produced_op = ProducedShortOp(short_op, preamble_op)
short_boxes.append(produced_op)
return short_boxes
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
@@ -3997,7 +3997,7 @@
[p0, i1]
p3 = force_token()
#
- p2 = new_with_vtable(ConstClass(jit_virtual_ref_vtable))
+ p2 = new_with_vtable(descr=vref_descr)
setfield_gc(p2, NULL, descr=virtualforceddescr)
setfield_gc(p2, p3, descr=virtualtokendescr)
setfield_gc(p0, p2, descr=nextdescr)
@@ -4085,7 +4085,7 @@
expected = """
[i1]
p3 = force_token()
- p2 = new_with_vtable(ConstClass(jit_virtual_ref_vtable))
+ p2 = new_with_vtable(descr=vref_descr)
setfield_gc(p2, NULL, descr=virtualforceddescr)
setfield_gc(p2, p3, descr=virtualtokendescr)
escape_n(p2)
@@ -7223,36 +7223,38 @@
def test_constant_getfield1(self):
ops = """
[p1, p187, i184]
- p188 = getarrayitem_gc_r(p187, 42, descr=<GcPtrArrayDescr>)
+ p188 = getarrayitem_gc_r(p187, 42, descr=arraydescr)
guard_value(p188, ConstPtr(myptr)) []
p25 = getfield_gc_r(ConstPtr(myptr), descr=otherdescr)
+ call_n(123, p25, descr=nonwritedescr)
jump(p25, p187, i184)
"""
preamble = """
[p1, p187, i184]
- p188 = getarrayitem_gc_r(p187, 42, descr=<GcPtrArrayDescr>)
+ p188 = getarrayitem_gc_r(p187, 42, descr=arraydescr)
guard_value(p188, ConstPtr(myptr)) []
p25 = getfield_gc_r(ConstPtr(myptr), descr=otherdescr)
- p26 = same_as_r(p25)
- jump(p25, p187, i184, p26)
+ p123 = same_as_r(p25)
+ jump(p25, p187, i184, p123)
"""
short = """
[p1, p187, i184]
- p188 = getarrayitem_gc_r(p187, 42, descr=<GcPtrArrayDescr>)
+ p188 = getarrayitem_gc_r(p187, 42, descr=arraydescr)
guard_value(p188, ConstPtr(myptr)) []
p25 = getfield_gc_r(ConstPtr(myptr), descr=otherdescr)
- jump(p1, p187, i184, p25)
+ jump(p25)
"""
expected = """
[p25, p187, i184, p189]
- jump(p189, p187, i184, p189)
+ call_n(123, p189, descr=nonwritedescr)
+ jump(p25, p187, i184, p189)
"""
self.optimize_loop(ops, expected, preamble, expected_short=short)
def test_constant_getfield1bis(self):
ops = """
[p1, p187, i184]
- p188 = getarrayitem_gc_r(p187, 42, descr=<GcPtrArrayDescr>)
+ p188 = getarrayitem_gc_r(p187, 42, descr=arraydescr)
guard_value(p188, ConstPtr(myptr)) []
p25 = getfield_gc_r(ConstPtr(myptr), descr=otherdescr)
p26 = call_r(p25, descr=nonwritedescr)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit