summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'upstream/main'Pablo Galindo2022-01-149-608/+687
|\
| * bpo-45569: Change PYLONG_BITS_IN_DIGIT default to 30 (GH-30497)Mark Dickinson2022-01-141-12/+4
| |
| * bpo-45953: Statically initialize all the non-object PyInterpreterState ↵Eric Snow2022-01-142-0/+29
| | | | | | | | | | fields we can. (gh-30589) https://bugs.python.org/issue45953
| * bpo-45953: Statically initialize all the PyThreadState fields we can. (gh-30590)Eric Snow2022-01-143-13/+36
| | | | | | https://bugs.python.org/issue45953
| * bpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571)neonene2022-01-131-0/+3
| | | | | | This makes ntpath.abspath()/getpath_abspath() follow normpath(), since some WinAPIs such as PathCchSkipRoot() require backslashed paths.
| * Statically initialize _PyRuntimeState fields. (gh-30588)Eric Snow2022-01-131-0/+11
| | | | | | https://bugs.python.org/issue45953
| * bpo-46370: Move the static initializer for _PyRuntime to its own header ↵Eric Snow2022-01-134-583/+604
| | | | | | | | | | file. (gh-30587) https://bugs.python.org/issue46370
* | Post 3.11.0a4Pablo Galindo2022-01-141-1/+1
| |
* | Python 3.11.0a4v3.11.0a4Pablo Galindo2022-01-131-2/+2
|/
* bpo-46315: Add ifdef HAVE_ feature checks for WASI compatibility (GH-30507)Christian Heimes2022-01-132-2/+4
|
* bpo-45953: Statically allocate the main interpreter (and initial thread ↵Eric Snow2022-01-124-16/+76
| | | | | | | | | state). (gh-29883) Previously, the main interpreter was allocated on the heap during runtime initialization. Here we instead embed it into _PyRuntimeState, which means it is statically allocated as part of the _PyRuntime global. The same goes for the initial thread state (of each interpreter, including the main one). Consequently there are fewer allocations during runtime/interpreter init, fewer possible failures, and better memory locality. FYI, this also helps efforts to consolidate globals, which in turns helps work on subinterpreter isolation. https://bugs.python.org/issue45953
* bpo-45953: Statically allocate and initialize global bytes objects. (gh-30096)Eric Snow2022-01-113-12/+280
| | | | | The empty bytes object (b'') and the 256 one-character bytes objects were allocated at runtime init. Now we statically allocate and initialize them. https://bugs.python.org/issue45953
* bpo-46303: Move fileutils.h private functions to internal C API (GH-30484)Victor Stinner2022-01-113-159/+162
| | | | | | | | | | Move almost all private functions of Include/cpython/fileutils.h to the internal C API Include/internal/pycore_fileutils.h. Only keep _Py_fopen_obj() in Include/cpython/fileutils.h, since it's used by _testcapi which must not use the internal C API. Move EncodeLocaleEx() and DecodeLocaleEx() functions from _testcapi to _testinternalcapi, since the C API moved to the internal C API.
* bpo-45923: Handle call events in bytecode (GH-30364)Mark Shannon2022-01-061-0/+1
| | | | * Add a RESUME instruction to handle "call" events.
* bpo-46031: add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE (GH-30019)penguin_wwy2022-01-061-5/+7
|
* bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" ↵Victor Stinner2022-01-061-11/+1
| | | | | | | | | | | (GH-30422) This reverts commit ea251806b8dffff11b30d2182af1e589caf88acf. Keep "assert(interned == NULL);" in _PyUnicode_Fini(), but only for the main interpreter. Keep _PyUnicode_ClearInterned() changes avoiding the creation of a temporary Python list object.
* bpo-45256: Don't track the exact depth of each `InterpreterFrame` (GH-30372)Brandt Bucher2022-01-051-2/+4
|
* bpo-46009: Remove GEN_START (GH-30367)Brandt Bucher2022-01-041-4/+3
|
* bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302)Irit Katriel2022-01-041-37/+36
| | | | | | * bpo-46202: remove opcode POP_EXCEPT_AND_RERAISE * do not assume that an exception group is truthy
* bpo-46219, 46221: simplify except* implementation following exc_info ↵Irit Katriel2022-01-021-3/+3
| | | | changes. Move helpers to exceptions.c. Do not assume that exception groups are truthy. (GH-30289)
* bpo-46218: Change long_pow() to sliding window algorithm (GH-30319)Tim Peters2022-01-021-6/+0
| | | | | | | | | | | * bpo-46218: Change long_pow() to sliding window algorithm The primary motivation is to eliminate long_pow's reliance on that the number of bits in a long "digit" is a multiple of 5. Now it no longer cares how many bits are in a digit. But the sliding window approach also allows cutting the precomputed table of small powers in half, which reduces initialization overhead enough that the approach pays off for smaller exponents too. Depending on exponent bit patterns, a sliding window may also be able to save some bigint multiplies (sometimes when at least 5 consecutive exponent bits are 0, regardless of their starting bit position modulo 5). Note: boosting the window width to 6 didn't work well overall. It give marginal speed improvements for huge exponents, but the increased overhead (the small-power table needs twice as many entries) made it a loss for smaller exponents. Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* bpo-46090: Allow PyThreadState.datastack_* members to be NULL (GH-30234)Brandt Bucher2021-12-281-4/+7
|
* bpo-46140: take more Py_buffer arguments as const * (GH-30217)David Hewitt2021-12-222-4/+4
|
* Revert "bpo-46131: add fastpath for PyFloat_Check() (GH-30200)" (GH-30208)Raymond Hettinger2021-12-192-3/+0
| | | This reverts commit 2ef06d412531d1163dbc72877c88aedf3ed82a25.
* bpo-46131: add fastpath for PyFloat_Check() (#30200)Matti Picus2021-12-192-0/+3
|
* 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.