summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authormpage <mpage@cs.stanford.edu>2024-11-01 23:10:58 (GMT)
committerGitHub <noreply@github.com>2024-11-01 23:10:58 (GMT)
commitf0c6fccd08904787a39269367f09f263d496114c (patch)
tree1a12e809be9f39c6c668c96b100fbf2a7bbf5c67 /Python
parent8477951a1c460ff9b7dc7c54e7bf9b66b1722459 (diff)
downloadcpython-f0c6fccd08904787a39269367f09f263d496114c.zip
cpython-f0c6fccd08904787a39269367f09f263d496114c.tar.gz
cpython-f0c6fccd08904787a39269367f09f263d496114c.tar.bz2
gh-126255: Ignore warning about JIT being deactivated when perf support is active in `test_embed.InitConfigTests.test_initconfig_api` (#126302)
Temporarily ignore warnings about JIT deactivation when perf support is active. This will be reverted as soon as a way is found to determine at run time whether the interpreter was built with JIT. Currently, this is not possible on Windows. Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c7
-rw-r--r--Python/sysmodule.c1
2 files changed, 7 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 2efaa9d..23882d0 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -1310,12 +1310,17 @@ init_interp_main(PyThreadState *tstate)
enabled = *env != '0';
}
if (enabled) {
+#ifdef _Py_JIT
+ // perf profiler works fine with tier 2 interpreter, so
+ // only checking for a "real JIT".
if (config->perf_profiling > 0) {
(void)PyErr_WarnEx(
PyExc_RuntimeWarning,
"JIT deactivated as perf profiling support is active",
0);
- } else {
+ } else
+#endif
+ {
PyObject *opt = _PyOptimizer_NewUOpOptimizer();
if (opt == NULL) {
return _PyStatus_ERR("can't initialize optimizer");
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index cbb7397..a4abd7c 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2290,6 +2290,7 @@ sys_activate_stack_trampoline_impl(PyObject *module, const char *backend)
#ifdef _Py_JIT
_PyOptimizerObject* optimizer = _Py_GetOptimizer();
if (optimizer != NULL) {
+ Py_DECREF(optimizer);
PyErr_SetString(PyExc_ValueError, "Cannot activate the perf trampoline if the JIT is active");
return NULL;
}