[pypy-svn] pypy jit-unroll-loops: Adjusted tests to work without tracing some more when compile fails
hakanardo
commits-noreply at bitbucket.org
Thu Dec 30 10:53:31 CET 2010
Author: Hakan Ardo <hakan at debian.org>
Branch: jit-unroll-loops
Changeset: r40274:aff240cf013c
Date: 2010-12-30 10:31 +0100
http://bitbucket.org/pypy/pypy/changeset/aff240cf013c/
Log: Adjusted tests to work without tracing some more when compile fails
diff --git a/pypy/jit/metainterp/test/test_basic.py b/pypy/jit/metainterp/test/test_basic.py
--- a/pypy/jit/metainterp/test/test_basic.py
+++ b/pypy/jit/metainterp/test/test_basic.py
@@ -1970,7 +1970,7 @@
return a1.val + b1.val
res = self.meta_interp(g, [3, 23])
assert res == 7068153
- self.check_loop_count(7)
+ self.check_loop_count(6)
self.check_loops(guard_true=4, guard_class=0, int_add=2, int_mul=2,
guard_false=2)
diff --git a/pypy/jit/metainterp/compile.py b/pypy/jit/metainterp/compile.py
--- a/pypy/jit/metainterp/compile.py
+++ b/pypy/jit/metainterp/compile.py
@@ -106,7 +106,8 @@
try:
old_loop_token = jitdriver_sd.warmstate.optimize_loop(
metainterp_sd, old_loop_tokens, loop)
- except InvalidLoop:
+ except InvalidLoop as e:
+ #import traceback; import pdb; pdb.set_trace()
return None
if old_loop_token is not None:
metainterp.staticdata.log("reusing old loop")
diff --git a/pypy/jit/metainterp/test/test_jitprof.py b/pypy/jit/metainterp/test/test_jitprof.py
--- a/pypy/jit/metainterp/test/test_jitprof.py
+++ b/pypy/jit/metainterp/test/test_jitprof.py
@@ -66,7 +66,7 @@
assert profiler.events == expected
assert profiler.times == [3, 2, 1, 1]
assert profiler.counters == [1, 2, 1, 1, 3, 3, 1, 13, 2, 0, 0, 0,
- 0, 0, 0, 0]
+ 0, 0, 0, 0, 0]
def test_simple_loop_with_call(self):
@dont_look_inside
diff --git a/pypy/jit/metainterp/test/test_send.py b/pypy/jit/metainterp/test/test_send.py
--- a/pypy/jit/metainterp/test/test_send.py
+++ b/pypy/jit/metainterp/test/test_send.py
@@ -210,6 +210,7 @@
# InvalidLoop condition, and was then unrolled, giving two copies
# of the body in a single bigger loop with no failing guard except
# the final one.
+ py.test.skip('dissabled "try to trace some more when compile fails"')
self.check_loop_count(1)
self.check_loops(guard_class=0,
int_add=2, int_sub=2)
@@ -251,6 +252,7 @@
assert res == f(3, 28)
res = self.meta_interp(f, [4, 28])
assert res == f(4, 28)
+ py.test.skip('dissabled "try to trace some more when compile fails"')
self.check_loop_count(1)
self.check_loops(guard_class=0,
int_add=2, int_sub=2)
diff --git a/pypy/jit/metainterp/test/test_virtual.py b/pypy/jit/metainterp/test/test_virtual.py
--- a/pypy/jit/metainterp/test/test_virtual.py
+++ b/pypy/jit/metainterp/test/test_virtual.py
@@ -164,7 +164,6 @@
getfield_gc=0, setfield_gc=0)
def test_two_loops_with_virtual(self):
- #py.test.skip("We don't know how to virtualize across bridges right now")
myjitdriver = JitDriver(greens = [], reds = ['n', 'node'])
def f(n):
node = self._new()
@@ -176,7 +175,7 @@
next = self._new()
next.value = node.value + n
next.extra = node.extra + 1
- if next.extra == 4:
+ if next.extra == 5:
next.value += 100
next.extra = 0
node = next
@@ -204,14 +203,14 @@
next = self._new()
next.value = node.value + n
next.extra = node.extra + 1
- if next.extra == 4:
+ if next.extra == 5:
next.value = externfn(next)
next.extra = 0
node = next
n -= 1
return node.value
- res = self.meta_interp(f, [15], policy=StopAtXPolicy(externfn))
- assert res == f(15)
+ res = self.meta_interp(f, [20], policy=StopAtXPolicy(externfn))
+ assert res == f(20)
self.check_loop_count(2)
self.check_loops(**{self._new_op: 1})
self.check_loops(int_mul=0, call=1)
More information about the Pypy-commit
mailing list