Author: Hakan Ardo <ha...@debian.org> Branch: jit-targets Changeset: r48935:d200a90155ef Date: 2011-11-08 13:51 +0100 http://bitbucket.org/pypy/pypy/changeset/d200a90155ef/
Log: fix test to actually count the number of specialized versions of the loop diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py b/pypy/jit/metainterp/optimizeopt/unroll.py --- a/pypy/jit/metainterp/optimizeopt/unroll.py +++ b/pypy/jit/metainterp/optimizeopt/unroll.py @@ -536,6 +536,8 @@ return True debug_stop('jit-log-virtualstate') + if self.did_import: + return False limit = self.optimizer.metainterp_sd.warmrunnerdesc.memory_manager.retrace_limit if cell_token.retraced_count<limit: cell_token.retraced_count += 1 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 @@ -2598,10 +2598,12 @@ i += 1 return sa assert self.meta_interp(f, [20, 2]) == f(20, 2) - self.check_jitcell_token_count(3) + self.check_jitcell_token_count(1) + assert len(get_stats().jitcell_tokens.pop().target_tokens) == 4 assert self.meta_interp(f, [20, 3]) == f(20, 3) - self.check_jitcell_token_count(4) - + self.check_jitcell_token_count(1) + assert len(get_stats().jitcell_tokens.pop().target_tokens) == 5 + def test_max_retrace_guards(self): myjitdriver = JitDriver(greens = [], reds = ['n', 'i', 'sa', 'a']) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit