File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
Misc/NEWS.d/next/Core_and_Builtins Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 1- Add a :func: ` !sys._jit_enabled ` helper to determine in runtime if JIT is enabled or not .
1+ Allow to determine whether the JIT is enabled at runtime via :func: ` !sys._jit_enabled ` .
Original file line number Diff line number Diff line change @@ -1303,14 +1303,13 @@ init_interp_main(PyThreadState *tstate)
13031303// perf profiler works fine with tier 2 interpreter, so
13041304// only checking for a "real JIT".
13051305#if _Py_TIER % 2 != 0
1306- int enabled = _PySys_JITEnabled ();
1307- printf ("enabled = %d\n" , enabled );
1308- if (enabled && config -> perf_profiling > 0 ) {
1306+ if (_PySys_JITEnabled () && config -> perf_profiling > 0 ) {
13091307 (void )PyErr_WarnEx (
1310- PyExc_RuntimeWarning ,
1311- "JIT deactivated as perf profiling support is active" ,
1312- 0 );
1313- } else
1308+ PyExc_RuntimeWarning ,
1309+ "JIT deactivated as perf profiling support is active" ,
1310+ 0 );
1311+ }
1312+ else
13141313#endif
13151314 {
13161315 PyObject * opt = _PyOptimizer_NewUOpOptimizer ();
Original file line number Diff line number Diff line change @@ -2541,7 +2541,7 @@ PyAPI_FUNC(int) PyUnstable_CopyPerfMapFile(const char* parent_filename) {
25412541int
25422542_PySys_JITEnabled (void )
25432543{
2544- char * env = Py_GETENV ("PYTHON_JIT" );
2544+ const char * env = Py_GETENV ("PYTHON_JIT" );
25452545 if (_Py_TIER2 == 1 ) {
25462546 // Interpreter was built with enabled jit, but it can be disabled via PYTHON_JIT=0
25472547 if (env && * env != '\0' ) {
You can’t perform that action at this time.
0 commit comments