summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Collect stats for UNPACK_SEQUENCE. (GH-31105)Mark Shannon2022-02-031-1/+16
|
* bpo-45885: Add more stats for COMPARE_OP in specialize.c (GH-31040)Dennis Sweeney2022-02-031-2/+47
|
* Add specialization stats for FOR_ITER. (GH-31079)Mark Shannon2022-02-021-0/+68
|
* bpo-46072: Add some frame stats. (GH-31060)Mark Shannon2022-02-021-0/+2
|
* bpo-46072: Add some object layout and allocation stats (GH-31051)Mark Shannon2022-02-011-0/+12
|
* bpo-46072: Add simple stats for Python calls. (GH-30989)Mark Shannon2022-01-281-0/+9
|
* bpo-46329: Split calls into precall and call instructions. (GH-30855)Mark Shannon2022-01-281-83/+131
| | | | | | | | | | | | | | * Add PRECALL_FUNCTION opcode. * Move 'call shape' varaibles into struct. * Replace CALL_NO_KW and CALL_KW with KW_NAMES and CALL instructions. * Specialize for builtin methods taking using the METH_FASTCALL | METH_KEYWORDS protocol. * Allow kwnames for specialized calls to builtin types. * Specialize calls to tuple(arg) and str(arg).
* bpo-46486: Fixed misspelled name DesciptorClassificationKumar Aditya2022-01-231-8/+8
|
* bpo-46417: Use _PyType_CAST() in Python directory (GH-30769)Victor Stinner2022-01-211-2/+1
|
* bpo-46409: Make generators in bytecode (GH-30633)Mark Shannon2022-01-201-4/+0
| | | | | | | | | | | | * Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes. * Trim frame and generator by word each. * Minor refactor of frame.c * Update test.test_sys to account for smaller frames. * Treat generator functions as normal functions when evaluating and specializing.
* bpo-46405: fix msvc compiler warnings (GH-30627)Kumar Aditya2022-01-171-1/+1
|