Skip to content

Commit d01f572

Browse files
committed
fix
1 parent 7fce731 commit d01f572

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Include/internal/pycore_tstate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ typedef struct _PyJitMetrics {
5959
uint16_t side_exit_initial_value;
6060
uint16_t side_exit_initial_backoff;
6161
} _PyJitMetrics;
62+
6263
#endif
6364

6465
// Every PyThreadState is actually allocated as a _PyThreadStateImpl. The

Python/pystate.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,10 +1524,7 @@ init_threadstate(_PyThreadStateImpl *_tstate,
15241524

15251525
_tstate->asyncio_running_loop = NULL;
15261526
_tstate->asyncio_running_task = NULL;
1527-
15281527
#ifdef _Py_TIER2
1529-
_tstate->jit_tracer_state.code_buffer = NULL;
1530-
15311528
// Initialize JIT metrics from environment variables
15321529
_tstate->jit_metrics.jump_backward_initial_value = JUMP_BACKWARD_INITIAL_VALUE;
15331530
_tstate->jit_metrics.jump_backward_initial_backoff = JUMP_BACKWARD_INITIAL_BACKOFF;
@@ -1565,6 +1562,7 @@ init_threadstate(_PyThreadStateImpl *_tstate,
15651562
_tstate->jit_metrics.side_exit_initial_backoff = (uint16_t)value;
15661563
}
15671564
}
1565+
_tstate->jit_tracer_state.code_buffer = NULL;
15681566
#endif
15691567
tstate->delete_later = NULL;
15701568

Python/specialize.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ _PyCode_Quicken(_Py_CODEUNIT *instructions, Py_ssize_t size, int enable_counters
4747
#if ENABLE_SPECIALIZATION_FT
4848
_Py_BackoffCounter jump_counter, adaptive_counter;
4949
if (enable_counters) {
50-
PyThreadState *tstate = _PyThreadState_GET();
51-
_PyThreadStateImpl *tstate_impl = (_PyThreadStateImpl *)tstate;
5250
jump_counter = initial_jump_backoff_counter(
53-
tstate_impl->jit_metrics.jump_backward_initial_value,
54-
tstate_impl->jit_metrics.jump_backward_initial_backoff);
51+
JUMP_BACKWARD_INITIAL_VALUE,
52+
JUMP_BACKWARD_INITIAL_BACKOFF);
5553
adaptive_counter = adaptive_counter_warmup();
5654
}
5755
else {

0 commit comments

Comments
 (0)