Skip to content

Commit ba67ab7

Browse files
fix default builkd
1 parent fa99108 commit ba67ab7

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,7 @@ def testfunc(n):
24872487

24882488
self.assertIn("_POP_TOP_NOP", uops)
24892489

2490+
@unittest.skipIf(Py_GIL_DISABLED, "FT build immortalizes constants")
24902491
def test_pop_top_specialize_int(self):
24912492
def testfunc(n):
24922493
for _ in range(n):
@@ -2500,6 +2501,7 @@ def testfunc(n):
25002501

25012502
self.assertIn("_POP_TOP_INT", uops)
25022503

2504+
@unittest.skipIf(Py_GIL_DISABLED, "FT build immortalizes constants")
25032505
def test_pop_top_specialize_float(self):
25042506
def testfunc(n):
25052507
for _ in range(n):

Python/bytecodes.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3018,22 +3018,18 @@ dummy_func(
30183018
goto stop_tracing;
30193019
}
30203020
PyCodeObject *code = _PyFrame_GetCode(frame);
3021-
#ifdef Py_GIL_DISABLED
3021+
30223022
LOCK_OBJECT_SLOW(code);
30233023
_PyExecutorObject *executor = code->co_executors->executors[oparg & 255];
30243024
// On FT, we are responsible for cleaning up after ourselves.
3025-
if (!_Py_atomic_load_uint8_relaxed(&executor->vm_data.valid)) {
3025+
if (!FT_ATOMIC_LOAD_UINT8_RELAXED(executor->vm_data.valid)) {
30263026
opcode = executor->vm_data.opcode;
30273027
oparg = (oparg & ~255) | executor->vm_data.oparg;
30283028
next_instr = this_instr;
30293029
_Py_ExecutorDetach(executor);
30303030
UNLOCK_OBJECT_SLOW(code);
30313031
DISPATCH_GOTO();
30323032
}
3033-
#else
3034-
_PyExecutorObject *executor = code->co_executors->executors[oparg & 255];
3035-
assert(executor->vm_data.valid);
3036-
#endif
30373033
assert(tstate->current_executor == NULL);
30383034
assert(executor->vm_data.index == INSTR_OFFSET() - 1);
30393035
assert(executor->vm_data.code == code);

Python/generated_cases.c.h

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,9 @@ _Py_ExecutorDetach(_PyExecutorObject *executor)
16571657
if (code == NULL) {
16581658
return;
16591659
}
1660+
#ifdef Py_GIL_DISABLED
16601661
assert(_PyInterpreterState_GET()->stoptheworld.world_stopped || PyMutex_IsLocked(&((PyObject *)code)->ob_mutex));
1662+
#endif
16611663
_Py_CODEUNIT *instruction = &_PyCode_CODE(code)[executor->vm_data.index];
16621664
assert(instruction->op.code == ENTER_EXECUTOR);
16631665
int index = instruction->op.arg;

0 commit comments

Comments
 (0)