Пример #1
0
 def bound_reached(cell, *args):
     # bound reached, but we do a last check: if it is the first
     # time we reach the bound, or if another loop or bridge was
     # compiled since the last time we reached it, then decrease
     # the counter by a few percents instead.  It should avoid
     # sudden bursts of JIT-compilation, and also corner cases
     # where we suddenly compile more than one loop because all
     # counters reach the bound at the same time, but where
     # compiling all but the first one is pointless.
     curgen = warmrunnerdesc.memory_manager.current_generation
     curgen = chr(intmask(curgen) & 0xFF)    # only use 8 bits
     if we_are_translated() and curgen != cell.extra_delay:
         cell.counter = int(self.THRESHOLD_LIMIT * 0.98)
         cell.extra_delay = curgen
         return
     #
     if not confirm_enter_jit(*args):
         cell.counter = 0
         return
     # start tracing
     from rpython.jit.metainterp.pyjitpl import MetaInterp
     metainterp = MetaInterp(metainterp_sd, jitdriver_sd)
     # set counter to -2, to mean "tracing in effect"
     cell.counter = -2
     try:
         metainterp.compile_and_run_once(jitdriver_sd, *args)
     finally:
         if cell.counter == -2:
             cell.counter = 0
Пример #2
0
 def _trace_and_compile_from_bridge(self, deadframe, metainterp_sd,
                                    jitdriver_sd):
     # 'jitdriver_sd' corresponds to the outermost one, i.e. the one
     # of the jit_merge_point where we started the loop, even if the
     # loop itself may contain temporarily recursion into other
     # jitdrivers.
     from rpython.jit.metainterp.pyjitpl import MetaInterp
     metainterp = MetaInterp(metainterp_sd, jitdriver_sd)
     metainterp.handle_guard_failure(self, deadframe)
Пример #3
0
 def _trace_and_compile_from_bridge(self, deadframe, metainterp_sd,
                                    jitdriver_sd):
     # 'jitdriver_sd' corresponds to the outermost one, i.e. the one
     # of the jit_merge_point where we started the loop, even if the
     # loop itself may contain temporarily recursion into other
     # jitdrivers.
     from rpython.jit.metainterp.pyjitpl import MetaInterp
     metainterp = MetaInterp(metainterp_sd, jitdriver_sd)
     metainterp.handle_guard_failure(self, deadframe)
Пример #4
0
 def bound_reached(hash, cell, *args):
     if not confirm_enter_jit(*args):
         return
     jitcounter.decay_all_counters()
     # start tracing
     from rpython.jit.metainterp.pyjitpl import MetaInterp
     metainterp = MetaInterp(metainterp_sd, jitdriver_sd)
     greenargs = args[:num_green_args]
     if cell is None:
         cell = JitCell(*greenargs)
         jitcounter.install_new_cell(hash, cell)
     cell.flags |= JC_TRACING | JC_TRACING_OCCURRED
     try:
         metainterp.compile_and_run_once(jitdriver_sd, *args)
     finally:
         cell.flags &= ~JC_TRACING
Пример #5
0
 def bound_reached(hash, cell, *args):
     if not confirm_enter_jit(*args):
         return
     jitcounter.decay_all_counters()
     # start tracing
     from rpython.jit.metainterp.pyjitpl import MetaInterp
     metainterp = MetaInterp(metainterp_sd, jitdriver_sd)
     greenargs = args[:num_green_args]
     if cell is None:
         cell = JitCell(*greenargs)
         jitcounter.install_new_cell(hash, cell)
     cell.flags |= JC_TRACING | JC_TRACING_OCCURRED
     try:
         metainterp.compile_and_run_once(jitdriver_sd, *args)
     finally:
         cell.flags &= ~JC_TRACING
Пример #6
0
 def _trace_and_compile_from_bridge(self, deadframe, metainterp_sd,
                                    jitdriver_sd):
     # 'jitdriver_sd' corresponds to the outermost one, i.e. the one
     # of the jit_merge_point where we started the loop, even if the
     # loop itself may contain temporarily recursion into other
     # jitdrivers.
     from rpython.jit.metainterp.pyjitpl import MetaInterp
     loop_token = self.rd_loop_token.loop_token_wref()
     force_finish_trace = False
     if loop_token:
         force_finish_trace = bool(loop_token.retraced_count
                                   & loop_token.FORCE_BRIDGE_SEGMENTING)
     metainterp = MetaInterp(metainterp_sd,
                             jitdriver_sd,
                             force_finish_trace=force_finish_trace)
     metainterp.handle_guard_failure(self, deadframe)
Пример #7
0
 def bound_reached(hash, cell, *args):
     from rpython.jit.metainterp.pyjitpl import MetaInterp
     if not confirm_enter_jit(*args):
         return
     jitcounter.decay_all_counters()
     if rstack.stack_almost_full():
         return
     greenargs = args[:num_green_args]
     if cell is None:
         cell = JitCell(*greenargs)
         jitcounter.install_new_cell(hash, cell)
     # start tracing
     metainterp = MetaInterp(
         metainterp_sd, jitdriver_sd,
         force_finish_trace=bool(cell.flags & JC_FORCE_FINISH))
     cell.flags |= JC_TRACING | JC_TRACING_OCCURRED
     try:
         metainterp.compile_and_run_once(jitdriver_sd, *args)
     finally:
         cell.flags &= ~JC_TRACING