Skip to content

Commit

Permalink
Don't try to optimize when the JIT is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Jan 8, 2025
1 parent f098037 commit 1f40ea4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,10 @@ _PyCode_Quicken(_Py_CODEUNIT *instructions, Py_ssize_t size, PyObject *consts,
#if ENABLE_SPECIALIZATION_FT
_Py_BackoffCounter jump_counter, adaptive_counter;
if (enable_counters) {
jump_counter = initial_jump_backoff_counter();
_PyOptimizerObject *optimizer = _Py_GetOptimizer();
Py_XDECREF(optimizer);
jump_counter = optimizer ? initial_jump_backoff_counter()
: initial_unreachable_backoff_counter();
adaptive_counter = adaptive_counter_warmup();
}
else {
Expand Down

0 comments on commit 1f40ea4

Please sign in to comment.