Skip to content

Commit b5d6571

Browse files
reduce diff further
1 parent 46413cf commit b5d6571

File tree

7 files changed

+5
-12
lines changed

7 files changed

+5
-12
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,4 +375,4 @@ void _PyJit_FinalizeTracing(PyThreadState *tstate);
375375
#ifdef __cplusplus
376376
}
377377
#endif
378-
#endif /* !Py_INTERNAL_OPTIMIZER_H */
378+
#endif /* !Py_INTERNAL_OPTIMIZER_H */

Include/internal/pycore_tstate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ typedef struct _PyJitTracerInitialState {
3535
} _PyJitTracerInitialState;
3636

3737
typedef struct _PyJitTracerPreviousState {
38-
uint8_t dependencies_still_valid;
38+
bool dependencies_still_valid;
3939
bool instr_is_super;
4040
int code_max_size;
4141
int code_curr_size;

Lib/test/test_capi/test_opt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ def f():
128128
self.assertTrue(exe.is_valid())
129129
sys._clear_internal_caches()
130130
self.assertFalse(exe.is_valid())
131-
gc.collect()
132131
exe = get_first_executor(f)
133132
self.assertIsNone(exe)
134133

Python/bytecodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3018,10 +3018,10 @@ dummy_func(
30183018
goto stop_tracing;
30193019
}
30203020
PyCodeObject *code = _PyFrame_GetCode(frame);
3021-
30223021
_PyExecutorObject *executor = code->co_executors->executors[oparg & 255];
30233022
assert(executor->vm_data.index == INSTR_OFFSET() - 1);
30243023
assert(executor->vm_data.code == code);
3024+
assert(executor->vm_data.valid);
30253025
assert(tstate->current_executor == NULL);
30263026
/* If the eval breaker is set then stay in tier 1.
30273027
* This avoids any potentially infinite loops

Python/gc_free_threading.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "pycore_interp.h" // PyInterpreterState.gc
1111
#include "pycore_interpframe.h" // _PyFrame_GetLocalsArray()
1212
#include "pycore_object_alloc.h" // _PyObject_MallocWithType()
13-
#include "pycore_optimizer.h"
1413
#include "pycore_pystate.h" // _PyThreadState_GET()
1514
#include "pycore_tstate.h" // _PyThreadStateImpl
1615
#include "pycore_tuple.h" // _PyTuple_MaybeUntrack()

Python/instrumentation.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,9 +1928,7 @@ _Py_Instrument(PyCodeObject *code, PyInterpreterState *interp)
19281928
{
19291929
int res;
19301930
LOCK_CODE(code);
1931-
HEAD_LOCK(interp->runtime);
19321931
res = instrument_lock_held(code, interp);
1933-
HEAD_UNLOCK(interp->runtime);
19341932
UNLOCK_CODE();
19351933
return res;
19361934
}
@@ -2064,10 +2062,7 @@ _PyMonitoring_SetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEvent
20642062
}
20652063
set_local_events(local, tool_id, events);
20662064

2067-
HEAD_LOCK(interp->runtime);
2068-
int res = force_instrument_lock_held(code, interp);
2069-
HEAD_UNLOCK(interp->runtime);
2070-
return res;
2065+
return force_instrument_lock_held(code, interp);
20712066
}
20722067

20732068
int

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,7 @@ sys_activate_stack_trampoline_impl(PyObject *module, const char *backend)
23652365
{
23662366
#ifdef PY_HAVE_PERF_TRAMPOLINE
23672367
#ifdef _Py_JIT
2368-
if (((_PyThreadStateImpl *)_PyThreadState_GET())->jit_executor_state.jit) {
2368+
if (FT_ATOMIC_LOAD_UINT8(_PyInterpreterState_GET()->jit)) {
23692369
PyErr_SetString(PyExc_ValueError, "Cannot activate the perf trampoline if the JIT is active");
23702370
return NULL;
23712371
}

0 commit comments

Comments
 (0)