mirror of
https://github.com/python/cpython.git
synced 2025-12-11 03:20:01 +00:00
Changes to the function version cache: - In addition to the function object, also store the code object, and allow the latter to be retrieved even if the function has been evicted. - Stop assigning new function versions after a critical attribute (e.g. `__code__`) has been modified; the version is permanently reset to zero in this case. - Changes to `__annotations__` are no longer considered critical. (This fixes gh-109998.) Changes to the Tier 2 optimization machinery: - If we cannot map a function version to a function, but it is still mapped to a code object, we continue projecting the trace. The operand of the `_PUSH_FRAME` and `_POP_FRAME` opcodes can be either NULL, a function object, or a code object with the lowest bit set. This allows us to trace through code that calls an ephemeral function, i.e., a function that may not be alive when we are constructing the executor, e.g. a generator expression or certain nested functions. We will lose globals removal inside such functions, but we can still do other peephole operations (and even possibly [call inlining](https://github.com/python/cpython/pull/116290), if we decide to do it), which only need the code object. As before, if we cannot retrieve the code object from the cache, we stop projecting. |
||
|---|---|---|
| .. | ||
| clinic | ||
| mimalloc | ||
| stringlib | ||
| abstract.c | ||
| boolobject.c | ||
| bytearrayobject.c | ||
| bytes_methods.c | ||
| bytesobject.c | ||
| call.c | ||
| capsule.c | ||
| cellobject.c | ||
| classobject.c | ||
| codeobject.c | ||
| complexobject.c | ||
| descrobject.c | ||
| dictnotes.txt | ||
| dictobject.c | ||
| enumobject.c | ||
| exception_handling_notes.txt | ||
| exceptions.c | ||
| fileobject.c | ||
| floatobject.c | ||
| frame_layout.md | ||
| frameobject.c | ||
| funcobject.c | ||
| genericaliasobject.c | ||
| genobject.c | ||
| iterobject.c | ||
| listobject.c | ||
| listsort.txt | ||
| lnotab_notes.txt | ||
| locations.md | ||
| longobject.c | ||
| memoryobject.c | ||
| methodobject.c | ||
| moduleobject.c | ||
| namespaceobject.c | ||
| object.c | ||
| object_layout.md | ||
| object_layout_312.gv | ||
| object_layout_312.png | ||
| object_layout_full_312.gv | ||
| object_layout_full_312.png | ||
| obmalloc.c | ||
| odictobject.c | ||
| picklebufobject.c | ||
| rangeobject.c | ||
| README | ||
| setobject.c | ||
| sliceobject.c | ||
| structseq.c | ||
| tupleobject.c | ||
| typeobject.c | ||
| typeslots.inc | ||
| typeslots.py | ||
| typevarobject.c | ||
| unicodectype.c | ||
| unicodeobject.c | ||
| unicodetype_db.h | ||
| unionobject.c | ||
| weakrefobject.c | ||
Source files for various builtin objects