File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -827,7 +827,10 @@ _PyJit_translate_single_bytecode_to_trace(
827827 // We don't want to continue tracing as we might get stuck in the
828828 // inner loop. Instead, end the trace where the executor of the
829829 // inner loop might start and let the traces rejoin.
830- if (_tstate -> jit_tracer_state .prev_state .jump_backward_seen >= 1 ) {
830+ 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 )) {
831834 OPT_STAT_INC (inner_loop );
832835 ADD_TO_TRACE (_EXIT_TRACE , 0 , 0 , target );
833836 trace [trace_length - 1 ].operand1 = true; // is_control_flow
You can’t perform that action at this time.
0 commit comments