summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* bpo-46020: Optimize long_pow for the common case (GH-30555)Tim Peters2022-01-121-6/+13
| | | | This cuts a bit of overhead by not initializing the table of small odd powers unless it's needed for a large exponent.
* bpo-45953: Statically allocate and initialize global bytes objects. (gh-30096)Eric Snow2022-01-111-78/+14
| | | | | 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-46235: Do all ref-counting at once during list/tuple multiplication ↵Dennis Sweeney2022-01-082-26/+48
| | | | | | | | | | (GH-30346) When multiplying lists and tuples by `n`, increment each element's refcount, by `n`, just once. Saves `n-1` increments per element, and allows for a leaner & faster copying loop. Code by sweeneyde (Dennis Sweeney).
* bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" ↵Victor Stinner2022-01-062-19/+69
| | | | | | | | | | | (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-46236: Fix PyFunction_GetAnnotations() returned tuple. (GH-30409)Inada Naoki2022-01-051-22/+33
| | | Automerge-Triggered-By: GH:pablogsal
* bpo-46009: Remove GEN_START (GH-30367)Brandt Bucher2022-01-041-3/+5
|
* bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302)Irit Katriel2022-01-041-1/+0
| | | | | | * bpo-46202: remove opcode POP_EXCEPT_AND_RERAISE * do not assume that an exception group is truthy
* bpo-46233: Minor speedup for bigint squaring (GH-30345)Tim Peters2022-01-041-5/+19
| | | | | | | x_mul()'s squaring code can do some redundant and/or useless work at the end of each digit pass. A more careful analysis of worst-case carries at various digit positions allows making that code leaner.
* bpo-46219, 46221: simplify except* implementation following exc_info ↵Irit Katriel2022-01-021-2/+118
| | | | 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-24/+84
| | | | | | | | | | | * 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-46085: Fix iterator cache mechanism of OrderedDict. (GH-30290)Dong-hee Na2021-12-301-3/+5
|
* bpo-46055: Speed up binary shifting operators (GH-30044)Xinhang Xu2021-12-271-1/+16
| | | Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-46055: Streamline inner loop for right shifts (#30243)Mark Dickinson2021-12-271-7/+8
|
* bpo-43413: Revert changes in set.__init__ (GH-28403)Serhiy Storchaka2021-12-261-3/+1
| | | | Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-46140: take more Py_buffer arguments as const * (GH-30217)David Hewitt2021-12-222-12/+13
|
* bpo-46107: ExceptionGroup.subgroup()/split() should copy __note__ to the ↵Irit Katriel2021-12-211-0/+5
| | | | parts (GH-30159)
* Revert "bpo-46131: add fastpath for PyFloat_Check() (GH-30200)" (GH-30208)Raymond Hettinger2021-12-192-4/+0
| | | This reverts commit 2ef06d412531d1163dbc72877c88aedf3ed82a25.
* bpo-46131: add fastpath for PyFloat_Check() (#30200)Matti Picus2021-12-192-0/+4
|
* bpo-45711: Remove type and traceback from exc_info (GH-30122)Irit Katriel2021-12-171-6/+0
| | | | | | | | * 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-46039: Split yield from in two (GH-30035)Mark Shannon2021-12-152-8/+18
| | | | | | * 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-5/+5
| | | | | | | | | | * 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-142-24/+139
|
* bpo-45953: Statically initialize the small ints. (gh-30092)Eric Snow2021-12-141-29/+0
| | | | | | | 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-45855: document that `no_block` has no use anymore in PyCapsule_Import ↵Georg Brandl2021-12-121-7/+3
| | | | (#29665)
* bpo-45855: Replaced deprecated `PyImport_ImportModuleNoBlock` with ↵Kumar Aditya2021-12-121-1/+1
| | | | PyImport_ImportModule (GH-30046)
* bpo-46008: Make runtime-global object/type lifecycle functions and state ↵Eric Snow2021-12-0911-72/+193
| | | | | | | | | | | | 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-45813: Drop redundant assertion from frame.clear() (GH-29990)Andrew Svetlov2021-12-081-1/+4
| | | | | * bpo-45813: Drop redundant assertion from frame.clear() * Move assertion to frame_dealloc()
* bpo-46009: Do not exhaust generator when send() method raises (GH-29986)Mark Shannon2021-12-081-0/+13
|
* bpo-45947: Place dict and values pointer at fixed (negative) offset just ↵Mark Shannon2021-12-074-144/+131
| | | | | | | | | | | | | | | | | | | 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-061-84/+99
| | | | | | | 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-45607: Make it possible to enrich exception displays via setting their ↵Irit Katriel2021-12-031-0/+31
| | | | __note__ field (GH-29880)
* bpo-45885: Specialize COMPARE_OP (GH-29734)Dennis Sweeney2021-12-031-0/+14
| | | | | | | * 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-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-45786: Allocate space for frame in frame object. (GH-29729)Mark Shannon2021-11-292-122/+41
|
* bpo-44530: Reverts a change to the 'code.__new__' audit event (GH-29809)Steve Dower2021-11-271-4/+4
|
* bpo-45760: Remove PyNumber_InMatrixMultiply (GH-29751)Dong-hee Na2021-11-261-29/+4
|
* bpo-44525: Copy free variables in bytecode to allow calls to inner functions ↵Mark Shannon2021-11-235-23/+71
| | | | | | | | | | | 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-45813: Make sure that frame->generator is NULLed when generator is ↵Mark Shannon2021-11-221-0/+1
| | | | deallocated. (GH-29700)
* bpo-45609: Specialize STORE_SUBSCR (GH-29242)Dennis Sweeney2021-11-191-21/+47
| | | | | * Specialize STORE_SUBSCR for list[int], and dict[object] * Adds _PyDict_SetItem_Take2 which consumes references to the key and values.
* bpo-45510: Specialize BINARY_SUBTRACT (GH-29523)Dong-hee Na2021-11-181-5/+9
|
* bpo-45636: Simplify BINARY_OP (GH-29565)Brandt Bucher2021-11-161-0/+12
|
* bpo-45723: Prepare support for autoconf 2.71 (GH-29441)Christian Heimes2021-11-081-5/+0
|
* bpo-45392: Update the docstring of the 'type' built-in (GH-29439)Mark Dickinson2021-11-061-3/+1
|
* bpo-45697: Use PyObject_TypeCheck in type_call (GH-29392)Itamar Ostricher2021-11-041-1/+1
|
* bpo-45691: Make array of small ints static to fix use-after-free error. ↵Mark Shannon2021-11-031-16/+14
| | | | (GH-29366)
* Store actual ints, not pointers to them in the interpreter state. (GH-29274)Mark Shannon2021-10-281-15/+6
|
* bpo-45256: Rationalize code around Python-to-Python calls a bit. (GH-29235)Mark Shannon2021-10-281-6/+5
|
* bpo-45637: Store the frame pointer in the cframe (GH-29267)Mark Shannon2021-10-281-5/+5
| | | * Rename 'frame' to 'current_frame'
* bpo-45530: speed listobject.c's unsafe_tuple_compare() (GH-29076)Tim Peters2021-10-251-13/+64
| | | | | | | | Keep track of whether unsafe_tuple_compare() calls are resolved by the very first tuple elements, and adjust strategy accordingly. This can significantly cut the number of calls made to the full-blown PyObject_RichCompareBool(), and especially when duplicates are rare. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-45292: [PEP 654] add the ExceptionGroup and BaseExceptionGroup classes ↵Irit Katriel2021-10-221-1/+527
| | | | (GH-28569)