From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Thu, 23 Oct 2025 23:20:58 +0000 (+0100) Subject: Fix ifdefs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=676faf8bf465fcb7d9d86db9fbacc3c3927fef43;p=thirdparty%2FPython%2Fcpython.git Fix ifdefs --- diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index bfc84e8c6623..9a006e185bce 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -133,7 +133,7 @@ # define LABEL(name) name: #endif -#if _Py_TAIL_CALL_INTERP || USE_COMPUTED_GOTOS +#if (_Py_TAIL_CALL_INTERP || USE_COMPUTED_GOTOS) && _Py_TIER2 # define IS_JIT_TRACING() (DISPATCH_TABLE_VAR == TRACING_DISPATCH_TABLE) // Required to not get stuck in infinite pecialization loops due to specialization failure. # define IS_JIT_TRACING_MAKING_PROGRESS() (IS_JIT_TRACING() && !tstate->interp->jit_state.do_not_specialize) @@ -141,9 +141,13 @@ DISPATCH_TABLE_VAR = TRACING_DISPATCH_TABLE; # define LEAVE_TRACING() \ DISPATCH_TABLE_VAR = DISPATCH_TABLE; +#else +# define IS_JIT_TRACING() (0) +# define IS_JIT_TRACING_MAKING_PROGRESS() (0) +# define ENTER_TRACING() +# define LEAVE_TRACING() #endif - /* PRE_DISPATCH_GOTO() does lltrace if enabled. Normally a no-op */ #ifdef Py_DEBUG #define PRE_DISPATCH_GOTO() if (frame->lltrace >= 5) { \ @@ -324,14 +328,10 @@ GETITEM(PyObject *v, Py_ssize_t i) { /* This takes a uint16_t instead of a _Py_BackoffCounter, * because it is used directly on the cache entry in generated code, * which is always an integral type. */ -#if _Py_TIER2 // Force re-specialization when tracing a side exit to get good side exits. #define ADAPTIVE_COUNTER_TRIGGERS(COUNTER) \ backoff_counter_triggers(forge_backoff_counter((COUNTER))) || IS_JIT_TRACING_MAKING_PROGRESS() -#else -#define ADAPTIVE_COUNTER_TRIGGERS(COUNTER) \ - backoff_counter_triggers(forge_backoff_counter((COUNTER))) -#endif + #define ADVANCE_ADAPTIVE_COUNTER(COUNTER) \ do { \ (COUNTER) = advance_backoff_counter((COUNTER)); \