Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: jitcounter-on-function
Changeset: r44969:626eaf2fd51d
Date: 2011-06-16 14:34 +0200
http://bitbucket.org/pypy/pypy/changeset/626eaf2fd51d/

Log:    micro changes for style. always pass function_threshold from
        can_enter_from_start

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
@@ -504,7 +504,7 @@
         assert res == 6 - 4 - 5
         self.check_history(call=0)   # because the trace starts in the middle
         #
-        res = self.meta_interp(f, [60, 84], repeat=7, function_threshold=0)
+        res = self.meta_interp(f, [60, 84], repeat=7)
         assert res == 84 - 61 - 62
         self.check_history(call=1)   # because the trace starts immediately
 
diff --git a/pypy/jit/metainterp/warmspot.py b/pypy/jit/metainterp/warmspot.py
--- a/pypy/jit/metainterp/warmspot.py
+++ b/pypy/jit/metainterp/warmspot.py
@@ -424,7 +424,7 @@
         if self.translator.rtyper.type_system.name == 'lltypesystem':
             def maybe_enter_jit(*args):
                 try:
-                    maybe_compile_and_run(True, *args)
+                    maybe_compile_and_run(state.increment_threshold, *args)
                 except JitException:
                     raise     # go through
                 except Exception, e:
@@ -432,14 +432,13 @@
             maybe_enter_jit._always_inline_ = True
         else:
             def maybe_enter_jit(*args):
-                maybe_compile_and_run(True, *args)
+                maybe_compile_and_run(state.increment_threshold, *args)
             maybe_enter_jit._always_inline_ = True
         jd._maybe_enter_jit_fn = maybe_enter_jit
 
-        can_inline = state.can_inline_greenargs
         num_green_args = jd.num_green_args
         def maybe_enter_from_start(*args):
-            maybe_compile_and_run(not can_inline(*args[:num_green_args]), 
*args)
+            maybe_compile_and_run(state.increment_function_threshold, *args)
         maybe_enter_from_start._always_inline_ = True
         jd._maybe_enter_from_start_fn = maybe_enter_from_start
 
diff --git a/pypy/jit/metainterp/warmstate.py b/pypy/jit/metainterp/warmstate.py
--- a/pypy/jit/metainterp/warmstate.py
+++ b/pypy/jit/metainterp/warmstate.py
@@ -296,7 +296,7 @@
         self.make_jitdriver_callbacks()
         confirm_enter_jit = self.confirm_enter_jit
 
-        def maybe_compile_and_run(use_loop_threshold, *args):
+        def maybe_compile_and_run(threshold, *args):
             """Entry point to the JIT.  Called at the point with the
             can_enter_jit() hint.
             """
@@ -312,10 +312,6 @@
 
             if cell.counter >= 0:
                 # update the profiling counter
-                if use_loop_threshold:
-                    threshold = self.increment_threshold
-                else: # function threshold
-                    threshold = self.increment_function_threshold
                 n = cell.counter + threshold
                 if n <= self.THRESHOLD_LIMIT:       # bound not reached
                     cell.counter = n
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to