Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
43740f7
Add `Py_JIT_ENABLED` variable to `pyconfig.h`
Eclips4 Oct 31, 2024
65e6cfa
Changes for Windows build
Eclips4 Oct 31, 2024
718b21e
fix typo
Eclips4 Oct 31, 2024
f4f1748
Another changes for Windows build
Eclips4 Oct 31, 2024
20d51dc
Update _sysconfig.c
Eclips4 Oct 31, 2024
a3e6dda
Don't set Py_JIT_ENABLED to 1 if --enable-experimental-jit=no
Eclips4 Oct 31, 2024
40c001c
Fixes for Windows build..
Eclips4 Oct 31, 2024
81994a9
Set Py_JIT_ENABLED to 2 insetad of 'interpreter'
Eclips4 Oct 31, 2024
1618433
PyLong_FromInt -> PyLong_FromLong
Eclips4 Oct 31, 2024
1773d9e
Fix typo in pyconfigs
Eclips4 Oct 31, 2024
9a50db7
Add a NEWS entry
Eclips4 Oct 31, 2024
4b4e212
Update documentation
Eclips4 Oct 31, 2024
19ddff2
Fix typo
Eclips4 Oct 31, 2024
91b7a78
Move NEWS entry
Eclips4 Oct 31, 2024
e79e0df
Fix typo in path
Eclips4 Oct 31, 2024
759321b
Fix doc formatting
Eclips4 Oct 31, 2024
49e4fdc
Fix configure
Eclips4 Oct 31, 2024
169831e
Revert previous changes
Eclips4 Nov 5, 2024
c83ea49
Revert other part of previous changes
Eclips4 Nov 5, 2024
1dec18a
Merge branch 'main' into add-py-jit
Eclips4 Nov 9, 2024
02d1f60
Add ``sys._jit_enabled``
Eclips4 Nov 10, 2024
a9c5b41
Add a ``NEWS`` entry
Eclips4 Nov 10, 2024
5423c71
Fix typo
Eclips4 Nov 10, 2024
49336ab
Apply suggestions from code review
Eclips4 Nov 10, 2024
67123ee
Add documentation for sys._jit_enabled and what's new entry.
Eclips4 Nov 10, 2024
4ddcd62
``availability`` only works for platforms :(
Eclips4 Nov 10, 2024
aa8f5bb
Apply suggestions from code review
Eclips4 Nov 10, 2024
0b5bce8
Align indentation
Eclips4 Nov 10, 2024
0ffcd9f
Remove unnecessary check
Eclips4 Nov 10, 2024
b6c097b
Update Python/pylifecycle.c
Eclips4 Nov 10, 2024
b4dc9dc
Update Python/sysmodule.c
Eclips4 Nov 11, 2024
46a4a7f
Fix reference leak in error path
Eclips4 Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
  • Loading branch information
Eclips4 and picnixz authored Nov 10, 2024
commit 49336ab89cde97502ea2deb4503f8b5f6e346b3b
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Add a :func:`!sys._jit_enabled` helper to determine in runtime if JIT is enabled or not.
Allow to determine whether the JIT is enabled at runtime via :func:`!sys._jit_enabled`.
13 changes: 6 additions & 7 deletions Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,14 +1303,13 @@ init_interp_main(PyThreadState *tstate)
// perf profiler works fine with tier 2 interpreter, so
// only checking for a "real JIT".
#if _Py_TIER % 2 != 0
int enabled = _PySys_JITEnabled();
printf("enabled = %d\n", enabled);
if (enabled && config->perf_profiling > 0) {
if (_PySys_JITEnabled() && config->perf_profiling > 0) {
(void)PyErr_WarnEx(
PyExc_RuntimeWarning,
"JIT deactivated as perf profiling support is active",
0);
} else
PyExc_RuntimeWarning,
"JIT deactivated as perf profiling support is active",
0);
}
else
#endif
{
Comment thread
Eclips4 marked this conversation as resolved.
Outdated
PyObject *opt = _PyOptimizer_NewUOpOptimizer();
Expand Down
2 changes: 1 addition & 1 deletion Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2541,7 +2541,7 @@ PyAPI_FUNC(int) PyUnstable_CopyPerfMapFile(const char* parent_filename) {
int
_PySys_JITEnabled(void)
{
char *env = Py_GETENV("PYTHON_JIT");
const char *env = Py_GETENV("PYTHON_JIT");
if (_Py_TIER2 == 1) {
// Interpreter was built with enabled jit, but it can be disabled via PYTHON_JIT=0
if (env && *env != '\0') {
Expand Down