Commits

Alex Gaynor committed e54e458

A branch to allow JITing of python when there's a tracehook installed.

Comments (0)

Files changed (1)

pypy/module/pypyjit/interp_jit.py

 def set_jitcell_at(newcell, next_instr, is_being_profiled, bytecode):
     bytecode.jit_cells[next_instr, is_being_profiled] = newcell
 
-def confirm_enter_jit(next_instr, is_being_profiled, bytecode, frame, ec):
-    return (frame.w_f_trace is None and
-            ec.w_tracefunc is None)
-
-def can_never_inline(next_instr, is_being_profiled, bytecode):
-    return False
-
 def should_unroll_one_iteration(next_instr, is_being_profiled, bytecode):
     return (bytecode.co_flags & CO_GENERATOR) != 0
 
 class PyPyJitDriver(JitDriver):
     reds = ['frame', 'ec']
-    greens = ['next_instr', 'is_being_profiled', 'pycode']
+    greens = ['next_instr', 'is_being_profiled', 'pycode', 'w_f_trace', 'w_tracefunc']
     virtualizables = ['frame']
 
 pypyjitdriver = PyPyJitDriver(get_printable_location = get_printable_location,
                               get_jitcell_at = get_jitcell_at,
                               set_jitcell_at = set_jitcell_at,
-                              confirm_enter_jit = confirm_enter_jit,
-                              can_never_inline = can_never_inline,
                               should_unroll_one_iteration =
                               should_unroll_one_iteration,
                               name='pypyjit')
             while True:
                 pypyjitdriver.jit_merge_point(ec=ec,
                     frame=self, next_instr=next_instr, pycode=pycode,
-                    is_being_profiled=is_being_profiled)
+                    is_being_profiled=is_being_profiled, w_f_trace=self.w_f_trace, w_tracefunc=ec.w_tracefunc)
                 co_code = pycode.co_code
                 self.valuestackdepth = hint(self.valuestackdepth, promote=True)
                 next_instr = self.handle_bytecode(co_code, next_instr, ec)
         #
         pypyjitdriver.can_enter_jit(frame=self, ec=ec, next_instr=jumpto,
                                     pycode=self.getcode(),
-                                    is_being_profiled=self.is_being_profiled)
+                                    is_being_profiled=self.is_being_profiled, w_f_trace=self.w_f_trace, w_tracefunc=ec.w_tracefunc)
         return jumpto
 
 def _get_adapted_tick_counter():