1. Alex Gaynor
  2. pypy-postgresql

Commits

Maciej Fijalkowski  committed cab8b49

an experiment to start tracing from start even if function is inlinable

  • Participants
  • Parent commits 3857e93
  • Branches jitcounter-on-function

Comments (0)

Files changed (2)

File pypy/jit/metainterp/warmspot.py

View file
  • Ignore whitespace
         if self.translator.rtyper.type_system.name == 'lltypesystem':
             def maybe_enter_jit(*args):
                 try:
-                    maybe_compile_and_run(*args)
+                    maybe_compile_and_run(True, *args)
                 except JitException:
                     raise     # go through
                 except Exception, e:
             maybe_enter_jit._always_inline_ = True
         else:
             def maybe_enter_jit(*args):
-                maybe_compile_and_run(*args)
+                maybe_compile_and_run(True, *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):
-            if not can_inline(*args[:num_green_args]):
-                maybe_compile_and_run(*args)
+            maybe_compile_and_run(can_inline(*args[:num_green_args]), *args)
         maybe_enter_from_start._always_inline_ = True
         jd._maybe_enter_from_start_fn = maybe_enter_from_start
 

File pypy/jit/metainterp/warmstate.py

View file
  • Ignore whitespace
         self.make_jitdriver_callbacks()
         confirm_enter_jit = self.confirm_enter_jit
 
-        def maybe_compile_and_run(*args):
+        def maybe_compile_and_run(normal_threshold, *args):
             """Entry point to the JIT.  Called at the point with the
             can_enter_jit() hint.
             """
 
             if cell.counter >= 0:
                 # update the profiling counter
-                n = cell.counter + self.increment_threshold
+                if normal_threshold:
+                    threshold = self.increment_threshold
+                else:
+                    threshold = self.increment_threshold // 3
+                n = cell.counter + threshold
                 if n <= self.THRESHOLD_LIMIT:       # bound not reached
                     cell.counter = n
                     return