summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] GH-104405: Add missing PEP 523 checks (GH-104441)Brandt Bucher2023-05-121-0/+4
|
* [3.11] GH-99257: Check the owner's type when specializing slots (GH-99324)Miss Islington (bot)2022-11-101-0/+8
| | | | | (cherry picked from commit 9d692841691590c25e6cf5b2250a594d3bf54825) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.11] GH-95113: Don't use EXTENDED_ARG_QUICK in unquickened code (GH-95121) ↵Brandt Bucher2022-07-221-0/+3
| | | | | (GH-95143) (cherry picked from commit e402b26b7fb953a2f0c17a0044bb6d6cbd726e54)
* [3.11] GH-94822: Don't specialize when metaclasses are involved (GH-94892) ↵Brandt Bucher2022-07-181-6/+5
| | | | | | | (GH-94980) (cherry picked from commit daf68ba92f315bfd239a0c993f9f683fb90325fb) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* [3.11] GH-93354: Use exponential backoff to avoid excessive specialization ↵Mark Shannon2022-06-301-24/+23
| | | | | | attempts (GH-93355) (GH-93379) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-94021: Address unreachable code warning in specialize code (GH-94022)Miss Islington (bot)2022-06-211-1/+2
| | | | | (cherry picked from commit 77c839c98fe57dcb01f5cad2e65fb4cac5a052c1) Co-authored-by: Christian Heimes <christian@python.org>
* GH-92239: Make sure that PEP 523 is supported, even when specializing first. ↵Mark Shannon2022-05-041-0/+6
| | | | (GH-92245)
* Add more stats for freelist use and allocations. (GH-92211)Mark Shannon2022-05-031-0/+5
|
* gh-91719: Add pycore_opcode.h internal header file (#91906)Victor Stinner2022-04-251-1/+1
| | | | | | | | | | | Move the following API from Include/opcode.h (public C API) to a new Include/internal/pycore_opcode.h header file (internal C API): * EXTRA_CASES * _PyOpcode_Caches * _PyOpcode_Deopt * _PyOpcode_Jump * _PyOpcode_OpName * _PyOpcode_RelativeJump
* bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)Irit Katriel2022-04-111-3/+11
|
* bpo-47009: Let PRECALL_NO_KW_LIST_APPEND do its own POP_TOP (GH-32239)Dennis Sweeney2022-04-051-1/+4
|
* bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD ↵Irit Katriel2022-03-311-2/+2
| | | | (GH-32115)
* Merge deoptimization blocks in interpreter (GH-32155)Mark Shannon2022-03-301-3/+3
|
* bpo-47127: Specialize calls for fastcall c methods with keywords (GH-32125)Kumar Aditya2022-03-271-0/+4
| | | | * add PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS
* bpo-47053: Reduce deoptimization in BINARY_OP_INPLACE_ADD_UNICODE (GH-31318)Dennis Sweeney2022-03-251-2/+4
| | | | | * Don't deopt if refcounts are too big * Detect more at specialization time
* bpo-46841: Quicken code in-place (GH-31888)Brandt Bucher2022-03-211-83/+17
| | | | | | | | | | | | | | | | | | | * Moves the bytecode to the end of the corresponding PyCodeObject, and quickens it in-place. * Removes the almost-always-unused co_varnames, co_freevars, and co_cellvars member caches * _PyOpcode_Deopt is a new mapping from all opcodes to their un-quickened forms. * _PyOpcode_InlineCacheEntries is renamed to _PyOpcode_Caches * _Py_IncrementCountAndMaybeQuicken is renamed to _PyCode_Warmup * _Py_Quicken is renamed to _PyCode_Quicken * _co_quickened is renamed to _co_code_adaptive (and is now a read-only memoryview). * Do not emit unused nonzero opargs anymore in the compiler.
* bpo-46841: Add a _Py_SET_OPCODE macro (GH-31780)Brandt Bucher2022-03-121-80/+65
|
* bpo-46841: Don't use an oparg counter for `STORE_SUBSCR` (GH-31742)Brandt Bucher2022-03-081-7/+7
|
* bpo-46841: Use inline caching for calls (GH-31709)Brandt Bucher2022-03-071-194/+69
|
* Remove trailing spaces (GH-31695)Serhiy Storchaka2022-03-051-1/+1
|
* bpo-46841: Fix BINARY_OP's handling of inline caches (GH-31671)Brandt Bucher2022-03-041-1/+2
|
* bpo-46903: Handle str-subclasses in virtual instance dictionaries. (GH-31658)Mark Shannon2022-03-041-0/+1
|
* bpo-46841: Use inline caching for attribute accesses (GH-31640)Brandt Bucher2022-03-031-64/+56
|
* bpo-46841: Improve the failure stats for COMPARE_OP (GH-31663)Brandt Bucher2022-03-031-0/+5
|
* Move check for str-only keys in LOAD_GLOBAL specializations to ↵Mark Shannon2022-03-031-0/+8
| | | | specialization time. (GH-31659)
* bpo-46841: Use inline cache for `BINARY_SUBSCR`. (GH-31618)Mark Shannon2022-03-011-11/+19
|
* bpo-46841: Use inline caching for `COMPARE_OP` (GH-31622)Brandt Bucher2022-03-011-18/+18
|
* bpo-46841: Move the cache for `LOAD_GLOBAL` inline. (GH-31575)Mark Shannon2022-02-281-12/+16
|
* bpo-46841: Use inline caching for `UNPACK_SEQUENCE` (GH-31591)Brandt Bucher2022-02-281-12/+11
|
* bpo-45316: Move private functions to internal C API (GH-31579)Victor Stinner2022-02-251-1/+2
| | | | | | | | | Move the unexported private functions to the internal C API: * pycore_frame.h: _PyFrame_New_NoTrack() * pycore_function.h: _PyFunction_GetVersionForCurrentState() * pycore_genobject.h: _PyAsyncGenValueWrapperNew() * pycore_genobject.h: _PyCoro_GetAwaitableIter() * pycore_genobject.h: _PyGen_yf()
* bpo-46841: Use *inline* caching for `BINARY_OP` (GH-31543)Brandt Bucher2022-02-251-44/+43
|
* bpo-45107: Specialize `LOAD_METHOD` for instances with dict. (GH-31531)Mark Shannon2022-02-241-13/+53
|
* bpo-46823: Implement LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE superinstruction ↵Dennis Sweeney2022-02-241-0/+10
| | | | (GH-31484)
* bpo-44337: Shrink the LOAD_ATTR/STORE_ATTR caches (GH-31517)Brandt Bucher2022-02-231-19/+17
|
* bpo-45885: Don't un-adapt `COMPARE_OP` when collecting stats (GH-31516)Brandt Bucher2022-02-231-2/+8
|
* bpo-46329: Fix test failure when `Py_STATS` is enabled (GH-31511)Brandt Bucher2022-02-231-2/+1
|
* Move call specializations from CALL to PRECALL. (GH-31496)Mark Shannon2022-02-221-32/+72
|
* bpo-46329: Change calling sequence (again) (GH-31373)Mark Shannon2022-02-181-3/+2
| | | | * Change calling sequence: Add PUSH_NULL. Merge PRECALL_FUNCTION and PRECALL_METHOD into PRECALL.
* bpo-46072: Add detailed failure stats for BINARY_OP (GH-31289)Brandt Bucher2022-02-161-12/+103
|
* bpo-46702: Specialize UNPACK_SEQUENCE (GH-31240)Brandt Bucher2022-02-161-37/+57
|
* Add pair counts to stats output and summary. (GH-31324)Mark Shannon2022-02-141-5/+11
|
* Include length in stats for UNPACK_SEQUENCE. (GH-31254)Mark Shannon2022-02-141-6/+28
|
* bpo-45490: Rename static inline functions (GH-31217)Victor Stinner2022-02-111-1/+1
| | | | | | | | | | | | When a static inline function is wrapped by a macro which casts its arguments to the expected type, there is no need that the function has a different name than the macro. Use the same name for the macro and the function to avoid confusion. Rename _PyUnicode_get_wstr_length() to PyUnicode_WSTR_LENGTH(). Don't rename static inline _Py_NewRef() and _Py_XNewRef() functions, since the C API exports Py_NewRef() and Py_XNewRef() functions as regular functions. The name cannot be reused in this case.
* bpo-45923: Add `RESUME_QUICK` (GH-31244)Brandt Bucher2022-02-101-0/+3
|
* Gather stats for PRECALL_METHOD. (GH-31259)Mark Shannon2022-02-101-0/+1
|
* Add stats for PRECALL_FUNCTION. (GH-31250)Mark Shannon2022-02-101-3/+29
|
* bpo-46072: Output stats as markdown with collapsible sections. (GH-31228)Mark Shannon2022-02-091-189/+197
|
* bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized ↵Eric Snow2022-02-081-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | global objects. (gh-30928) We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code. It is still used in a number of non-builtin stdlib modules. The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime. A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings). https://bugs.python.org/issue46541#msg411799 explains the rationale for this change. The core of the change is in: * (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros * Include/internal/pycore_runtime_init.h - added the static initializers for the global strings * Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState * Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings. That check is added to the PR CI config. The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()). This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *. The following are not changed (yet): * stop using _Py_IDENTIFIER() in the stdlib modules * (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API * (maybe) intern the strings during runtime init https://bugs.python.org/issue46541
* bpo-46072: Improve LOAD_METHOD stats (GH-31104)Mark Shannon2022-02-071-3/+17
|
* Add miss stats for specialized instructions. (GH-31108)Mark Shannon2022-02-041-27/+34
|