summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* bpo-46072: Add top level stats struct (GH-30169)Mark Shannon2021-12-171-8/+21
|
* bpo-45711: Remove type and traceback from exc_info (GH-30122)Irit Katriel2021-12-172-11/+3
| | | | | | | | * Do not PUSH/POP traceback or type to the stack as part of exc_info * Remove exc_traceback and exc_type from _PyErr_StackItem * Add to what's new, because this change breaks things like Cython
* bpo-46072: Add --with-pystats configure option to simplify gathering of VM ↵Mark Shannon2021-12-151-15/+2
| | | | | | | | | stats (GH-30116) * Simplify specialization stats collection macros. * Add --enable-pystats option to configure. * Update specialization summary script to handle larger number of kinds
* bpo-44525: Specialize for calls to type and other builtin classes with 1 ↵Mark Shannon2021-12-151-24/+26
| | | | argument. (GH-29942)
* bpo-46039: Split yield from in two (GH-30035)Mark Shannon2021-12-152-12/+13
| | | | | | * Split YIELD_FROM opcode into SEND and JUMP_ABSOLUTE. * Remove YIELD_FROM opcode.
* bpo-44525: Split calls into PRECALL and CALL (GH-30011)Mark Shannon2021-12-142-35/+37
| | | | | | | | | | * Add 3 new opcodes for calls: PRECALL_METHOD, CALL_NO_KW, CALL_KW. * Update specialization to handle new CALL opcodes. * Specialize call to method descriptors. * Remove old CALL opcodes: CALL_FUNCTION, CALL_METHOD, CALL_METHOD_KW, CALL_FUNCTION_KW.
* bpo-45292: [PEP-654] add except* (GH-29581)Irit Katriel2021-12-144-5/+27
|
* bpo-45953: Statically initialize the small ints. (gh-30092)Eric Snow2021-12-144-45/+355
| | | | | | | The array of small PyLong objects has been statically declared. Here I also statically initialize them. Consequently they are no longer initialized dynamically during runtime init. I've also moved them under a new sub-struct in _PyRuntimeState, in preparation for static allocation and initialization of other global objects. https://bugs.python.org/issue45953
* bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059)Pablo Galindo Salgado2021-12-111-2/+9
|
* bpo-43931: Export Python version as API data (GH-25577)Gabriele N. Tornetta2021-12-101-0/+4
| | | | | When Python is embedded in other applications, it is not easy to determine which version of Python is being used. This change exposes the Python version as part of the API data. Tools like Austin (https://github.com/P403n1x87/austin) can benefit from this data when targeting applications like uWSGI, as the Python version can then be inferred systematically by looking at the exported symbols rather than relying on unreliable pattern matching or other hacks (like remote code execution etc...). Automerge-Triggered-By: GH:pablogsal
* bpo-46008: Make runtime-global object/type lifecycle functions and state ↵Eric Snow2021-12-0920-231/+483
| | | | | | | | | | | | consistent. (gh-29998) This change is strictly renames and moving code around. It helps in the following ways: * ensures type-related init functions focus strictly on one of the three aspects (state, objects, types) * passes in PyInterpreterState * to all those functions, simplifying work on moving types/objects/state to the interpreter * consistent naming conventions help make what's going on more clear * keeping API related to a type in the corresponding header file makes it more obvious where to look for it https://bugs.python.org/issue46008
* bpo-46007: Exclude PyUnicode_CHECK_INTERNED() from limited C API (GH-29987)Victor Stinner2021-12-092-4/+4
| | | | | | | Exclude the PyUnicode_CHECK_INTERNED() macro from the limited C API, because it uses the PyASCIIObject structure which is excluded from the limited C API. Automerge-Triggered-By: GH:encukou
* Post 3.11.0a3Pablo Galindo2021-12-081-1/+1
|
* Python 3.11.0a3v3.11.0a3Pablo Galindo2021-12-081-2/+2
|
* bpo-46008: Move Py*State init into distinct functions. (gh-29977)Eric Snow2021-12-083-2/+27
| | | | | Previously, basic initialization of PyInterprterState happened in PyInterpreterState_New() (along with allocation and adding the new interpreter to the runtime state). This prevented us from initializing interpreter states that were allocated separately (e.g. statically or in a free list). We've addressed that here by factoring out a separate function just for initialization. We've done the same for PyThreadState. _PyRuntimeState was sorted out when we added it since _PyRuntime is statically allocated. However, here we update the existing init code to line up with the functions for PyInterpreterState and PyThreadState. https://bugs.python.org/issue46008
* bpo-46008: Add _PyInterpreterState_Main(). (gh-29978)Eric Snow2021-12-081-5/+9
| | | | | PyInterpreterState_Main() is a plain function exposed in the public C-API. For internal usage we can take the more efficient approach in this PR. https://bugs.python.org/issue46008
* bpo-46008: Stop calling _PyThreadState_Init() in new_threadstate(). (gh-29973)Eric Snow2021-12-081-0/+2
| | | | | This simplifies new_threadstate(). We also rename _PyThreadState_Init() to _PyThreadState_SetCurrent() to reflect what it actually does. https://bugs.python.org/issue46008
* bpo-46008: Move thread-related interpreter state into a sub-struct. (gh-29971)Eric Snow2021-12-071-11/+13
| | | | | This parallels _PyRuntimeState.interpreters. Doing this helps make it more clear what part of PyInterpreterState relates to its threads. https://bugs.python.org/issue46008
* bpo-46008: Return void from _PyEval_InitState(). (gh-29970)Eric Snow2021-12-071-1/+1
| | | | | This falls into the category of keep-allocation-and-initialization separate. It also allows us to use _PyEval_InitState() safely in functions that return void. https://bugs.python.org/issue46008
* bpo-45947: Place dict and values pointer at fixed (negative) offset just ↵Mark Shannon2021-12-074-5/+28
| | | | | | | | | | | | | | | | | | | before GC header. (GH-29879) * Place __dict__ immediately before GC header for plain Python objects. * Fix up lazy dict creation logic to use managed dict pointers. * Manage values pointer, placing them directly before managed dict pointers. * Convert hint-based load/store attr specialization target managed dict classes. * Specialize LOAD_METHOD for managed dict objects. * Remove unsafe _PyObject_GC_Calloc function. * Remove unsafe _PyObject_GC_Malloc() function. * Add comment explaning use of Py_TPFLAGS_MANAGED_DICT.
* bpo-45963: Make space for the InterpreterFrame of a generator in that ↵Mark Shannon2021-12-063-17/+10
| | | | | | | generator. (GH-29891) * Make generator, coroutine and async gen structs all the same size. * Store interpreter frame in generator (and coroutine). Reduces the number of allocations neeeded for a generator from two to one.
* bpo-45582 Fix prototype of _Py_Get_Getpath_CodeObject. (GH-29907)Benjamin Peterson2021-12-031-1/+1
| | | Automerge-Triggered-By: GH:tiran
* bpo-45607: Make it possible to enrich exception displays via setting their ↵Irit Katriel2021-12-031-1/+1
| | | | __note__ field (GH-29880)
* bpo-45885: Specialize COMPARE_OP (GH-29734)Dennis Sweeney2021-12-033-37/+46
| | | | | | | * Add COMPARE_OP_ADAPTIVE adaptive instruction. * Add COMPARE_OP_FLOAT_JUMP, COMPARE_OP_INT_JUMP and COMPARE_OP_STR_JUMP specialized instructions. * Introduce and use _PyUnicode_Equal
* bpo-45582: Port getpath[p].c to Python (GH-29041)Steve Dower2021-12-035-62/+14
| | | | | The getpath.py file is frozen at build time and executed as code over a namespace. It is never imported, nor is it meant to be importable or reusable. However, it should be easier to read, modify, and patch than the previous code. This commit attempts to preserve every previously tested quirk, but these may be changed in the future to better align platforms.
* bpo-40280: Optimize ints and and startup on wasm (GH-29887)Christian Heimes2021-12-021-4/+8
|
* bpo-45954: Rename PyConfig.no_debug_ranges to code_debug_ranges (GH-29886)Victor Stinner2021-12-021-1/+1
| | | | | | | Rename PyConfig.no_debug_ranges to PyConfig.code_debug_ranges and invert the value. Document -X no_debug_ranges and PYTHONNODEBUGRANGES env var in PyConfig.code_debug_ranges documentation.
* bpo-45753: Interpreter internal tweaks (GH-29575)Mark Shannon2021-12-012-11/+17
| | | | | | | | | | * Split exit paths into exceptional and non-exceptional. * Move exit tracing code to individual bytecodes. * Wrap all trace entry and exit events in macros to make them clearer and easier to enhance. * Move return sequence into RETURN_VALUE, YIELD_VALUE and YIELD_FROM. Distinguish between normal trace events and dtrace events.
* bpo-45476: Disallow using asdl_seq_GET() as l-value (GH-29866)Victor Stinner2021-11-301-3/+3
| | | | | | | | | The following internal macros can not longer be used as l-value: * asdl_seq_GET() * asdl_seq_GET_UNTYPED() * asdl_seq_LEN() They are modified to use the _Py_RVALUE() macro.
* bpo-45476: Add _Py_RVALUE() macro (GH-29860)Victor Stinner2021-11-306-7/+11
| | | | | | | | | | | | | | | | | | Add a new _Py_RVALUE() macro to prevent using an expression as an l-value. Replace a "(void)" cast with the _Py_RVALUE() macro in the following macros: * PyCell_SET() * PyList_SET_ITEM() * PyTuple_SET_ITEM() * _PyGCHead_SET_FINALIZED() * _PyGCHead_SET_NEXT() * asdl_seq_SET() * asdl_seq_SET_UNTYPED() Add also parentheses around macro arguments in PyCell_SET() and PyTuple_SET_ITEM() macros.
* bpo-45786: Allocate space for frame in frame object. (GH-29729)Mark Shannon2021-11-294-21/+7
|
* bpo-45711: use exc_value instead of exc_type to determine if exc_info is ↵Irit Katriel2021-11-251-0/+2
| | | | valid. Add more assertions. (GH-29627)
* bpo-45893: Add missing extern C to initconfig.h (GH-29761)Christian Heimes2021-11-241-0/+6
| | | Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-39026: Fix Python.h when building with Xcode (GH-29488)Victor Stinner2021-11-232-3/+1
| | | | Fix Python.h to build C extensions with Xcode: remove a relative include from Include/cpython/pystate.h.
* bpo-44525: Copy free variables in bytecode to allow calls to inner functions ↵Mark Shannon2021-11-235-18/+29
| | | | | | | | | | | to be specialized (GH-29595) * Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead. * Add reference to function to frame, borrow references to builtins and globals. * Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
* bpo-45848: Allow the parser to get error lines from encoded files (GH-29646)Pablo Galindo Salgado2021-11-201-0/+5
|
* bpo-45609: Specialize STORE_SUBSCR (GH-29242)Dennis Sweeney2021-11-193-29/+35
| | | | | * Specialize STORE_SUBSCR for list[int], and dict[object] * Adds _PyDict_SetItem_Take2 which consumes references to the key and values.
* bpo-45829: Specialize BINARY_SUBSCR for __getitem__ implemented in Python. ↵Mark Shannon2021-11-182-33/+35
| | | | (GH-29592)
* bpo-45510: Specialize BINARY_SUBTRACT (GH-29523)Dong-hee Na2021-11-182-33/+36
|
* bpo-45636: Simplify BINARY_OP (GH-29565)Brandt Bucher2021-11-161-0/+3
|
* bpo-45753: Make recursion checks more efficient. (GH-29524)Mark Shannon2021-11-162-6/+6
| | | | * Uses recursion remaining, instead of recursion depth to speed up check against recursion limit.
* bpo-45636: Merge all numeric operators (GH-29482)Brandt Bucher2021-11-112-174/+175
|
* bpo-45696: Deep-freeze selected modules (GH-29118)Guido van Rossum2021-11-111-0/+1
| | | | | | | This gains 10% or more in startup time for `python -c pass` on UNIX-ish systems. The Makefile.pre.in generating code builds on Eric's work for bpo-45020, but the .c file generator is new. Windows version TBD.
* bpo-45723: Prepare support for autoconf 2.71 (GH-29441)Christian Heimes2021-11-081-8/+1
|
* Post 3.11.0a2Pablo Galindo2021-11-051-1/+1
|
* Python 3.11.0a2v3.11.0a2Pablo Galindo2021-11-051-2/+2
|
* bpo-45292: [PEP 654] Update traceback display code to work with exception ↵Irit Katriel2021-11-051-0/+11
| | | | groups (GH-29207)
* bpo-45691: Make array of small ints static to fix use-after-free error. ↵Mark Shannon2021-11-033-29/+17
| | | | (GH-29366)
* bpo-45395: Make custom frozen modules additions instead of replacements. ↵Eric Snow2021-10-281-0/+3
| | | | | | | | | (gh-28778) Currently custom modules (the array set on PyImport_FrozenModules) replace all the frozen stdlib modules. That can be problematic and is unlikely to be what the user wants. This change treats the custom frozen modules as additions instead. They take precedence over all other frozen modules except for those needed to bootstrap the import system. If the "code" field of an entry in the custom array is NULL then that frozen module is treated as disabled, which allows a custom entry to disable a frozen stdlib module. This change allows us to get rid of is_essential_frozen_module() and simplifies the logic for which frozen modules should be ignored. https://bugs.python.org/issue45395
* Store actual ints, not pointers to them in the interpreter state. (GH-29274)Mark Shannon2021-10-283-3/+3
|