| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
|
| |
|
|
|
|
|
| |
This cleanup up resolves a few subtle bugs and makes the implementation for multi-phase init much cleaner.
https://github.com/python/cpython/issues/99741
|
|
|
|
| |
(#99956)
|
|
|
|
|
| |
There were some minor issues that showed up while I was working on porting _xxsubinterpreters to multi-phase init. This fixes them.
https://github.com/python/cpython/issues/99741
|
|
|
|
|
|
| |
* Add API to allow extensions to set callback function on creation and destruction of PyCodeObject
Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
|
| |
|
| |
|
|
|
|
| |
assembler stage (GH-99869)
|
| |
|
| |
|
|
|
|
| |
block (GH-99732)
|
|
|
| |
Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Newly supported interpreter definition syntax:
- `op(NAME, (input_stack_effects -- output_stack_effects)) { ... }`
- `macro(NAME) = OP1 + OP2;`
Also some other random improvements:
- Convert `WITH_EXCEPT_START` to use stack effects
- Fix lexer to balk at unrecognized characters, e.g. `@`
- Fix moved output names; support object pointers in cache
- Introduce `error()` method to print errors
- Introduce read_uint16(p) as equivalent to `*p`
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
|
|
|
|
|
|
| |
computed gotos aren't enabled (GH-98265)
Keep target labels when debugging, but don't warn about lack of use.
Co-authored-by: Eryk Sun <eryksun@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix potential race condition in code patterns:
* Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);"
* Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);"
* Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);"
Other changes:
* Replace "old = var; var = new; Py_DECREF(var)"
with "Py_SETREF(var, new);"
* Replace "old = var; var = new; Py_XDECREF(var)"
with "Py_XSETREF(var, new);"
* And remove the "old" variable.
|
|
|
|
| |
modified (#98175)
|
|
|
|
| |
Fix a reference bug in _imp.create_builtin() after the creation of
the first sub-interpreter for modules "builtins" and "sys".
|
|
|
|
|
|
|
|
| |
Fix a number of compile errors with GCC-12 on macOS:
1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS
|
|
|
|
| |
Also complete cache effects for BINARY_SUBSCR family.
|
| |
|
| |
|
| |
|
|
|
|
| |
the GIL is not properly held at these times (GH-99543)
|
|
|
|
|
| |
We also move the global func version.
https://github.com/python/cpython/issues/81057
|
|
|
|
| |
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef()
and Py_XNewRef().
|
| |
|
|
|
|
|
| |
This is part of the effort to consolidate global variables, to make them easier to manage (and make it easier to later move some of them to PyInterpreterState).
https://github.com/python/cpython/issues/81057
|
|
|
| |
https://github.com/python/cpython/issues/81057
|
| |
|
|
|
|
| |
paths (#99461)
|
|
|
|
|
| |
This is the first of several changes to consolidate non-object globals in core code.
https://github.com/python/cpython/issues/81057
|
|
|
|
|
|
| |
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in Python/Python-ast.c.
Update Parser/asdl_c.py to regenerate code.
|
|
|
|
| |
`PyInterpreterState` (GH-99385)
|
|
|
| |
https://github.com/python/cpython/issues/81057
|
|
|
|
| |
the gc module (GH-99373)
|
|
|
|
|
| |
This moves nearly all remaining object-holding globals in core code (other than static types).
https://github.com/python/cpython/issues/81057
|
| |
|
|
|
|
|
| |
(GH-99145)
Automerge-Triggered-By: GH:isidentical
|
| |
|
|
|
|
|
| |
We actually don't move PyImport_Inittab. Instead, we make a copy that we keep on _PyRuntimeState and use only that after Py_Initialize(). We also prevent folks from modifying PyImport_Inittab (the best we can) after that point.
https://github.com/python/cpython/issues/81057
|
|
|
|
|
| |
The global allocators were stored in 3 static global variables: _PyMem_Raw, _PyMem, and _PyObject. State for the "small block" allocator was stored in another 13. That makes a total of 16 global variables. We are moving all 16 to the _PyRuntimeState struct as part of the work for gh-81057. (If PEP 684 is accepted then we will follow up by moving them all to PyInterpreterState.)
https://github.com/python/cpython/issues/81057
|
|
|
|
|
| |
As we consolidate global variables, we find some objects that are almost suitable to add to _PyRuntimeState.global_objects, but have some small/sneaky bit of per-interpreter state (e.g. a weakref list). We're adding PyInterpreterState.static_objects so we can move such objects there. (We'll removed the _not_used field once we've added others.)
https://github.com/python/cpython/issues/81057
|
|
|
|
|
| |
We also move the closely related max_module_number and add comments documenting the group of struct members.
https://github.com/python/cpython/issues/81057
|
| |
|
|
|
|
|
| |
Also mark those opcodes that have no stack effect as such.
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
| |
|
|
|
|
|
|
| |
* Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault()
* Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
|
| |
|
|
|
|
| |
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in Python/ceval.c and related files.
|