Author: Hakan Ardo <[email protected]>
Branch: jit-targets
Changeset: r49050:91a9170e92e8
Date: 2011-11-08 18:13 +0100
http://bitbucket.org/pypy/pypy/changeset/91a9170e92e8/
Log: merge messup?
diff --git a/pypy/jit/metainterp/test/test_ajit.py
b/pypy/jit/metainterp/test/test_ajit.py
--- a/pypy/jit/metainterp/test/test_ajit.py
+++ b/pypy/jit/metainterp/test/test_ajit.py
@@ -2649,7 +2649,7 @@
self.check_jitcell_token_count(1)
assert len(list(get_stats().jitcell_tokens)[0].target_tokens) == 5
- def test_retrace_ending_up_retrazing_another_loop(self):
+ def test_retrace_ending_up_retracing_another_loop(self):
myjitdriver = JitDriver(greens = ['pc'], reds = ['n', 'i', 'sa'])
bytecode = "0+sI0+SI"
@@ -2842,66 +2842,6 @@
assert res == -2
self.check_resops(setarrayitem_gc=2, getarrayitem_gc=1)
- def test_retrace_ending_up_retracing_another_loop(self):
-
- myjitdriver = JitDriver(greens = ['pc'], reds = ['n', 'i', 'sa'])
- bytecode = "0+sI0+SI"
- def f(n):
- myjitdriver.set_param('threshold', 3)
- myjitdriver.set_param('trace_eagerness', 1)
- myjitdriver.set_param('retrace_limit', 5)
- myjitdriver.set_param('function_threshold', -1)
- pc = sa = i = 0
- while pc < len(bytecode):
- myjitdriver.jit_merge_point(pc=pc, n=n, sa=sa, i=i)
- n = hint(n, promote=True)
- op = bytecode[pc]
- if op == '0':
- i = 0
- elif op == '+':
- i += 1
- elif op == 's':
- sa += i
- elif op == 'S':
- sa += 2
- elif op == 'I':
- if i < n:
- pc -= 2
- myjitdriver.can_enter_jit(pc=pc, n=n, sa=sa, i=i)
- continue
- pc += 1
- return sa
-
- def g(n1, n2):
- for i in range(10):
- f(n1)
- for i in range(10):
- f(n2)
-
- nn = [10, 3]
- assert self.meta_interp(g, nn) == g(*nn)
-
- # The attempts of retracing first loop will end up retracing the
- # second and thus fail 5 times, saturating the retrace_count. Instead a
- # bridge back to the preamble of the first loop is produced. A guard in
- # this bridge is later traced resulting in a retrace of the second
loop.
- # Thus we end up with:
- # 1 preamble and 1 specialized version of first loop
- # 1 preamble and 2 specialized version of second loop
- self.check_jitcell_token_count(2 + 3)
-
- # FIXME: Add a gloabl retrace counter and test that we are not trying
more than 5 times.
-
- def g(n):
- for i in range(n):
- for j in range(10):
- f(n-i)
-
- res = self.meta_interp(g, [10])
- assert res == g(10)
- # 1 preamble and 6 speciealized versions of each loop
- self.check_jitcell_token_count(2*(1 + 6))
-
def
test_continue_tracing_with_boxes_in_start_snapshot_replaced_by_optimizer(self):
myjitdriver = JitDriver(greens = [], reds = ['sa', 'n', 'a', 'b'])
def f(n):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit