We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1e4adf commit c4a6beeCopy full SHA for c4a6bee
1 file changed
Python/optimizer.c
@@ -827,7 +827,10 @@ _PyJit_translate_single_bytecode_to_trace(
827
// We don't want to continue tracing as we might get stuck in the
828
// inner loop. Instead, end the trace where the executor of the
829
// inner loop might start and let the traces rejoin.
830
- if (_tstate->jit_tracer_state.prev_state.jump_backward_seen >= 1) {
+ if (_tstate->jit_tracer_state.prev_state.jump_backward_seen >= 1 ||
831
+ // Also end the trace early if we probably have no more space left, as it's better
832
+ // to link to another backwards jump trace.
833
+ trace_length >= (_tstate->jit_tracer_state.prev_state.code_max_size / 2)) {
834
OPT_STAT_INC(inner_loop);
835
ADD_TO_TRACE(_EXIT_TRACE, 0, 0, target);
836
trace[trace_length-1].operand1 = true; // is_control_flow
0 commit comments