summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497)Eric Snow2022-11-161-1/+1
| | | | | We also move the global func version. https://github.com/python/cpython/issues/81057
* gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)Victor Stinner2022-11-1610-39/+23
| | | | Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
* gh-99377: Add audit events for thread creation and clear (GH-99378)Steve Dower2022-11-161-6/+25
|
* gh-81057: Move contextvars-related Globals to _PyRuntimeState (gh-99400)Eric Snow2022-11-162-78/+46
| | | | | 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
* gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)Eric Snow2022-11-168-23/+20
| | | https://github.com/python/cpython/issues/81057
* GH-98831: Implement basic cache effects (#99313)Guido van Rossum2022-11-162-56/+48
|
* gh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code ↵Hood Chatham2022-11-152-6/+6
| | | | paths (#99461)
* gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)Eric Snow2022-11-154-30/+35
| | | | | This is the first of several changes to consolidate non-object globals in core code. https://github.com/python/cpython/issues/81057
* gh-99300: Use Py_NewRef() in Python/Python-ast.c (#99499)Victor Stinner2022-11-151-140/+73
| | | | | | 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.
* GH-99205: remove `_static` field from `PyThreadState` and ↵Kumar Aditya2022-11-151-10/+6
| | | | `PyInterpreterState` (GH-99385)
* gh-81057: Move the Remaining Import State Globals to _PyRuntimeState (gh-99488)Eric Snow2022-11-141-6/+9
| | | https://github.com/python/cpython/issues/81057
* gh-87604: Avoid publishing list of active per-interpreter audit hooks via ↵Steve Dower2022-11-141-0/+2
| | | | the gc module (GH-99373)
* gh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (gh-99487)Eric Snow2022-11-142-1/+5
| | | | | This moves nearly all remaining object-holding globals in core code (other than static types). https://github.com/python/cpython/issues/81057
* gh-87092: expose the compiler's codegen to python for unit tests (GH-99111)Irit Katriel2022-11-141-53/+120
|
* gh-99103: Normalize specialized traceback anchors against the current line ↵Batuhan Taskaya2022-11-121-2/+7
| | | | | (GH-99145) Automerge-Triggered-By: GH:isidentical
* gh-98762: Fix locations of match sub-patterns (GH-98775)Irit Katriel2022-11-121-129/+116
|
* gh-81057: Move PyImport_Inittab to _PyRuntimeState (gh-99402)Eric Snow2022-11-123-6/+68
| | | | | 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
* gh-81057: Move the Allocators to _PyRuntimeState (gh-99217)Eric Snow2022-11-112-3/+6
| | | | | 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
* gh-81057: Add PyInterpreterState.static_objects (gh-99397)Eric Snow2022-11-111-1/+1
| | | | | 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
* gh-81057: Move the Extension Modules Cache to _PyRuntimeState (gh-99355)Eric Snow2022-11-111-28/+50
| | | | | 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
* gh-99254: remove all unused consts from code objects (GH-99255)Irit Katriel2022-11-111-19/+92
|
* GH-98831: Remove all remaining DISPATCH() calls from bytecodes.c (#99271)Guido van Rossum2022-11-102-169/+175
| | | | | Also mark those opcodes that have no stack effect as such. Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* GH-99298: Don't perform jumps before error handling (GH-99299)Brandt Bucher2022-11-102-30/+38
|
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-109-219/+217
| | | | | | * 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.
* GH-99257: Check the owner's type when specializing slots (GH-99258)Brandt Bucher2022-11-101-0/+8
|
* gh-99300: Use Py_NewRef() in Python/ceval.c (#99318)Victor Stinner2022-11-103-128/+68
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in Python/ceval.c and related files.
* gh-99300: Use Py_NewRef() in Python/ directory (#99317)Victor Stinner2022-11-109-319/+162
| | | | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Python/ directory. Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* gh-99300: Use Py_NewRef() in Python/ directory (#99302)Victor Stinner2022-11-1014-80/+41
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Python/ directory.
* GH-99205: Mark new interpreters and threads as non-static (GH-99268)Brandt Bucher2022-11-091-0/+8
|
* GH-98686: Get rid of "adaptive" and "quick" instructions (GH-99182)Brandt Bucher2022-11-097-596/+397
|
* gh-90868: Adjust the Generated Objects (gh-99223)Eric Snow2022-11-082-1/+3
| | | | | | | | | | | We do the following: * move the generated _PyUnicode_InitStaticStrings() to its own file * move the generated _PyStaticObjects_CheckRefcnt() to its own file * include pycore_global_objects.h in extension modules instead of pycore_runtime_init.h These changes help us avoid including things that aren't needed. https://github.com/python/cpython/issues/90868
* GH-98831: Simple input-output stack effects for bytecodes.c (#99120)Guido van Rossum2022-11-083-350/+271
|
* gh-72719: Remove asyncore and asynchat modules (#96580)Nikita Sobolev2022-11-081-2/+0
| | | | | Remove modules asyncore and asynchat, which were deprecated by PEP 594. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* GH-96793: Specialize FOR_ITER for generators. (GH-98772)Mark Shannon2022-11-075-23/+132
|
* GH-98831: Implement super-instruction generation (#99084)Guido van Rossum2022-11-062-123/+88
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-99139: Improve NameError error suggestion for instances (#99140)Pablo Galindo Salgado2022-11-061-0/+23
|
* GH-99104: Update headers for bytecodes.c and generate_cases.py (#99112)Guido van Rossum2022-11-052-8/+17
| | | Also tweak the labels near the end of bytecodes.c.
* GH-98686: Fix compiler warning for HAS_ARG (GH-99106)Brandt Bucher2022-11-041-1/+1
|
* GH-98831: Add some macros definitions to bytecodes.c to reduce IDE warnings. ↵Mark Shannon2022-11-041-2/+29
| | | | (#99093)
* GH-98831: Auto-generate PREDICTED() macro calls (#99102)Guido van Rossum2022-11-041-16/+0
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* gh-92584: Remove the distutils package (#99061)Victor Stinner2022-11-031-1/+0
| | | | | | | | | | | | Remove the distutils package. It was deprecated in Python 3.10 by PEP 632 "Deprecate distutils module". For projects still using distutils and cannot be updated to something else, the setuptools project can be installed: it still provides distutils. * Remove Lib/distutils/ directory * Remove test_distutils * Remove references to distutils * Skip test_check_c_globals and test_peg_generator since they use distutils
* gh-98978: Fix Py_SetPythonHome(NULL) (#99066)Victor Stinner2022-11-031-0/+6
| | | | | | Fix use-after-free in Py_SetPythonHome(NULL), Py_SetProgramName(NULL) and _Py_SetProgramFullPath(NULL) function calls. Issue reported by Benedikt Reinartz.
* GH-96793: Implement PEP 479 in bytecode. (GH-99006)Mark Shannon2022-11-034-24/+147
| | | | | * Handle converting StopIteration to RuntimeError in bytecode. * Add custom instruction for converting StopIteration into RuntimeError.
* GH-98831: "Generate" the interpreter (#98830)Guido van Rossum2022-11-033-3850/+7867
| | | | | | | | | | | The switch cases (really TARGET(opcode) macros) have been moved from ceval.c to generated_cases.c.h. That file is generated from instruction definitions in bytecodes.c (which impersonates a C file so the C code it contains can be edited without custom support in e.g. VS Code). The code generator lives in Tools/cases_generator (it has a README.md explaining how it works). The DSL used to describe the instructions is a work in progress, described in https://github.com/faster-cpython/ideas/blob/main/3.12/interpreter_definition.md. This is surely a work-in-progress. An easy next step could be auto-generating super-instructions. **IMPORTANT: Merge Conflicts** If you get a merge conflict for instruction implementations in ceval.c, your best bet is to port your changes to bytecodes.c. That file looks almost the same as the original cases, except instead of `TARGET(NAME)` it uses `inst(NAME)`, and the trailing `DISPATCH()` call is omitted (the code generator adds it automatically).
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-025-86/+25
|
* gh-87092: remove unused SET_LOC/UNSET_LOC macros (GH-98914)Irit Katriel2022-11-021-73/+6
|
* gh-87092: do not allocate PyFutureFeatures dynamically (GH-98913)Irit Katriel2022-11-023-29/+18
|
* gh-98925: Lower marshal recursion depth for WASI (GH-98938)Brett Cannon2022-11-011-0/+2
| | | | | For wasmtime 2.0, the stack depth cost is 6% higher. This causes the default max `marshal` recursion depth to blow the stack. As the default marshal depth is 2000 and Windows is set to 1000, split the difference and choose 1500 for WASI to be safe.
* Rename JUMP_TO_INSTRUCTION to GO_TO_INSTRUCTION (#98934)Guido van Rossum2022-11-011-14/+14
| | | | | | This reduces confusion between jumps at the bytecode level (e.g. JUMPTO(), JUMPBY(), and various JUMP_*() opcodes) and jumps in the C code (which are 'goto' statements).
* gh-98610: Adjust the Optional Restrictions on Subinterpreters (GH-98618)Eric Snow2022-10-311-2/+8
| | | | | | | Previously, the optional restrictions on subinterpreters were: disallow fork, subprocess, and threads. By default, we were disallowing all three for "isolated" interpreters. We always allowed all three for the main interpreter and those created through the legacy `Py_NewInterpreter()` API. Those settings were a bit conservative, so here we've adjusted the optional restrictions to: fork, exec, threads, and daemon threads. The default for "isolated" interpreters disables fork, exec, and daemon threads. Regular threads are allowed by default. We continue always allowing everything For the main interpreter and the legacy API. In the code, we add `_PyInterpreterConfig.allow_exec` and `_PyInterpreterConfig.allow_daemon_threads`. We also add `Py_RTFLAGS_DAEMON_THREADS` and `Py_RTFLAGS_EXEC`.