mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
gh-118335: Configure Tier 2 interpreter at build time (#118339)
The code for Tier 2 is now only compiled when configured with `--enable-experimental-jit[=yes|interpreter]`. We drop support for `PYTHON_UOPS` and -`Xuops`, but you can disable the interpreter or JIT at runtime by setting `PYTHON_JIT=0`. You can also build it without enabling it by default using `--enable-experimental-jit=yes-off`; enable with `PYTHON_JIT=1`. On Windows, the `build.bat` script supports `--experimental-jit`, `--experimental-jit-off`, `--experimental-interpreter`. In the C code, `_Py_JIT` is defined as before when the JIT is enabled; the new variable `_Py_TIER2` is defined when the JIT *or* the interpreter is enabled. It is actually a bitmask: 1: JIT; 2: default-off; 4: interpreter.
This commit is contained in:
parent
9c468e2c5d
commit
7d83f7bcc4
32 changed files with 181 additions and 42 deletions
|
|
@ -367,7 +367,13 @@ _opcode_get_executor_impl(PyObject *module, PyObject *code, int offset)
|
|||
Py_TYPE(code)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
#ifdef _Py_TIER2
|
||||
return (PyObject *)PyUnstable_GetExecutor((PyCodeObject *)code, offset);
|
||||
#else
|
||||
PyErr_Format(PyExc_RuntimeError,
|
||||
"Executors are not available in this build");
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static PyMethodDef
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue