f" {executor} at offset {idx} rather"
f" than expected _EXIT_TRACE")
+ def test_jit_shutdown_after_cold_executor_creation(self):
+ script_helper.assert_python_ok("-c", textwrap.dedent(f"""
+ def f():
+ for x in range({TIER2_THRESHOLD + 3}):
+ for y in range({TIER2_THRESHOLD + 3}):
+ z = x + y
+
+ f()
+ """), PYTHON_JIT="1")
+
def test_enter_executor_valid_op_arg(self):
script_helper.assert_python_ok("-c", textwrap.dedent("""
import sys
Py_FatalError("Cannot allocate core JIT code");
}
((_PyUOpInstruction *)cold->trace)->opcode = opcode;
+ // Cold executors bypass _Py_ExecutorInit().
+ cold->vm_data.valid = true;
+ cold->vm_data.pending_deletion = 0;
+ cold->vm_data.code = NULL;
+
// This is initialized to false so we can prevent the executor
// from being immediately detected as cold and invalidated.
cold->vm_data.cold = false;
cold->jit_code = NULL;
cold->jit_size = 0;
if (_PyJIT_Compile(cold, cold->trace, 1)) {
- Py_DECREF(cold);
+ _PyExecutor_Free(cold);
Py_FatalError("Cannot allocate core JIT code");
}
#endif