summaryrefslogtreecommitdiffstats
path: root/Python/pylifecycle.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2025-01-29 00:10:51 (GMT)
committerGitHub <noreply@github.com>2025-01-29 00:10:51 (GMT)
commit828b27680f07f1ed8302616b8229f49c09032657 (patch)
tree234ff54d729e7233cca6a943800d1dadc20189d9 /Python/pylifecycle.c
parent5c930a26fb78c40929f1b894efee1b07c6d828fd (diff)
downloadcpython-828b27680f07f1ed8302616b8229f49c09032657.zip
cpython-828b27680f07f1ed8302616b8229f49c09032657.tar.gz
cpython-828b27680f07f1ed8302616b8229f49c09032657.tar.bz2
GH-126599: Remove the PyOptimizer API (GH-129194)
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index f357ddf..00a98af 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -1306,14 +1306,7 @@ init_interp_main(PyThreadState *tstate)
} else
#endif
{
- PyObject *opt = _PyOptimizer_NewUOpOptimizer();
- if (opt == NULL) {
- return _PyStatus_ERR("can't initialize optimizer");
- }
- if (_Py_SetTier2Optimizer((_PyOptimizerObject *)opt)) {
- return _PyStatus_ERR("can't install optimizer");
- }
- Py_DECREF(opt);
+ interp->jit = true;
}
}
}
@@ -1665,11 +1658,10 @@ finalize_modules(PyThreadState *tstate)
{
PyInterpreterState *interp = tstate->interp;
+ // Invalidate all executors and turn off JIT:
+ interp->jit = false;
#ifdef _Py_TIER2
- // Invalidate all executors and turn off tier 2 optimizer
_Py_Executors_InvalidateAll(interp, 0);
- _PyOptimizerObject *old = _Py_SetOptimizer(interp, NULL);
- Py_XDECREF(old);
#endif
// Stop watching __builtin__ modifications