[pypy-commit] pypy jit-counter: Fix for guard counters, more test fixes

arigo noreply at buildbot.pypy.org
Thu Oct 31 12:38:41 CET 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: jit-counter
Changeset: r67767:f2bdf363205b
Date: 2013-10-31 12:21 +0100
http://bitbucket.org/pypy/pypy/changeset/f2bdf363205b/

Log:	Fix for guard counters, more test fixes

diff --git a/rpython/jit/metainterp/counter.py b/rpython/jit/metainterp/counter.py
--- a/rpython/jit/metainterp/counter.py
+++ b/rpython/jit/metainterp/counter.py
@@ -43,18 +43,16 @@
 
     def tick(self, index, increment):
         counter = float(self.timetable[index]) + increment
-        #print '-'*79
-        #print 'COUNTER TICK:', index, '-> %s' % counter
         if counter < 1.0:
             self.timetable[index] = r_singlefloat(counter)
             return False
         else:
+            # when the bound is reached, we immediately reset the value to 0.0
+            self.reset(index)
             return True
     tick._always_inline_ = True
 
     def reset(self, index):
-        #print '-'*79
-        #print 'COUNTER RESET:', index
         self.timetable[index] = r_singlefloat(0.0)
 
     def lookup_chain(self, index):
diff --git a/rpython/jit/metainterp/test/test_recursive.py b/rpython/jit/metainterp/test/test_recursive.py
--- a/rpython/jit/metainterp/test/test_recursive.py
+++ b/rpython/jit/metainterp/test/test_recursive.py
@@ -342,7 +342,7 @@
         assert res == 0
         self.check_max_trace_length(TRACE_LIMIT)
         self.check_enter_count_at_most(10) # maybe
-        self.check_aborted_count(7)
+        self.check_aborted_count(6)
 
     def test_trace_limit_bridge(self):
         def recursive(n):
@@ -425,7 +425,7 @@
 
         res = self.meta_interp(loop, [20], failargs_limit=FAILARGS_LIMIT,
                                listops=True)
-        self.check_aborted_count(5)
+        self.check_aborted_count(4)
 
     def test_max_failure_args_exc(self):
         FAILARGS_LIMIT = 10
@@ -465,7 +465,7 @@
         res = self.meta_interp(main, [20], failargs_limit=FAILARGS_LIMIT,
                                listops=True)
         assert not res
-        self.check_aborted_count(5)
+        self.check_aborted_count(4)
 
     def test_set_param_inlining(self):
         myjitdriver = JitDriver(greens=[], reds=['n', 'recurse'])
diff --git a/rpython/jit/metainterp/warmstate.py b/rpython/jit/metainterp/warmstate.py
--- a/rpython/jit/metainterp/warmstate.py
+++ b/rpython/jit/metainterp/warmstate.py
@@ -312,7 +312,6 @@
             assert 0, "should have raised"
 
         def bound_reached(index, *args):
-            jitcounter.reset(index)
             if not confirm_enter_jit(*args):
                 return
             # start tracing


More information about the pypy-commit mailing list