From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:43:35 +0000 (+0100) Subject: Don't JIT short traces except if they end in a loop X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d820e22378966553002e718930c77c1edfa50997;p=thirdparty%2FPython%2Fcpython.git Don't JIT short traces except if they end in a loop --- diff --git a/Python/optimizer.c b/Python/optimizer.c index c46c23aa1288..53f3c6e8bfc8 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -1234,7 +1234,7 @@ uop_optimize( int curr_stackentries = tstate->interp->jit_state.jit_tracer_initial_stack_depth; int length = interp->jit_state.jit_tracer_code_curr_size; // Trace too short, don't bother. - if (length <= 20) { + if (length <= 20 && buffer[length-1].opcode != _JUMP_TO_TOP) { return 0; } assert(length > 0);