| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
* bpo-44771: Apply changes from importlib_resources@3b24bd6307
* Add blurb
* Exclude namespacedata01 from eol conversion.
|
| |
|
|
|
|
|
| |
(GH-27299)" (GH-27331)
This reverts commit 8072a1181dd64135f700b44372fbf7bf91e68072.
|
|
|
|
|
| |
Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR is part of PEP 657 and augments the compiler to emit ending
line numbers as well as starting and ending columns from the AST
into compiled code objects. This allows bytecodes to be correlated
to the exact source code ranges that generated them.
This information is made available through the following public APIs:
* The `co_positions` method on code objects.
* The C API function `PyCode_Addr2Location`.
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
|
| |
|
|
|
|
| |
(GH-26677)
|
|
|
|
|
| |
(#26807)
Sync with importlib_metadata 4.6.
|
|
|
| |
Managing it as a bare pointer to malloc'ed bytes is just too awkward in a few places.
|
| |
|
|
|
|
|
| |
Currently, if an arg value escapes (into the closure for an inner function) we end up allocating two indices in the fast locals even though only one gets used. Additionally, using the lower index would be better in some cases, such as with no-arg `super()`. To address this, we update the compiler to fix the offsets so each variable only gets one "fast local". As a consequence, now some cell offsets are interspersed with the locals (only when an arg escapes to an inner function).
https://bugs.python.org/issue43693
|
|
|
| |
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
|
|
|
|
|
|
|
|
| |
This was reverted in GH-26596 (commit 6d518bb) due to some bad memory accesses.
* Add the MAKE_CELL opcode. (gh-26396)
The memory accesses have been fixed.
https://bugs.python.org/issue43693
|
|
|
|
|
| |
offsets. (gh-26396)" (GH-26597)
This reverts commit 631f9938b1604d4f893417ec339b9e0fa9196fb1.
|
|
|
|
|
|
|
| |
(gh-26396)
This moves logic out of the frame initialization code and into the compiler and eval loop. Doing so simplifies the runtime code and allows us to optimize it better.
https://bugs.python.org/issue43693
|
|
|
|
|
|
|
|
|
|
| |
These were reverted in gh-26530 (commit 17c4edc) due to refleaks.
* 2c1e258 - Compute deref offsets in compiler (gh-25152)
* b2bf2bc - Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388)
This change fixes the refleaks.
https://bugs.python.org/issue43693
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
b2bf2bc1ece673d387341e06c8d3c2bc6e259747 (GH-26530)
* Revert "bpo-43693: Compute deref offsets in compiler (gh-25152)"
This reverts commit b2bf2bc1ece673d387341e06c8d3c2bc6e259747.
* Revert "bpo-43693: Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388)"
This reverts commit 2c1e2583fdc4db6b43d163239ea42b0e8394171f.
These two commits are breaking the refleak buildbots.
|
|
|
|
|
|
| |
Merges locals and cells into a single array.
Saves a pointer in the interpreter and means that we don't need the LOAD_CLOSURE opcode any more
https://bugs.python.org/issue43693
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
co_fastlocalkinds. (gh-26388)
A number of places in the code base (notably ceval.c and frameobject.c) rely on mapping variable names to indices in the frame "locals plus" array (AKA fast locals), and thus opargs. Currently the compiler indirectly encodes that information on the code object as the tuples co_varnames, co_cellvars, and co_freevars. At runtime the dependent code must calculate the proper mapping from those, which isn't ideal and impacts performance-sensitive sections. This is something we can easily address in the compiler instead.
This change addresses the situation by replacing internal use of co_varnames, etc. with a single combined tuple of names in locals-plus order, along with a minimal array mapping each to its kind (local vs. cell vs. free). These two new PyCodeObject fields, co_fastlocalnames and co_fastllocalkinds, are not exposed to Python code for now, but co_varnames, etc. are still available with the same values as before (though computed lazily).
Aside from the (mild) performance impact, there are a number of other benefits:
* there's now a clear, direct relationship between locals-plus and variables
* code that relies on the locals-plus-to-name mapping is simpler
* marshaled code objects are smaller and serialize/de-serialize faster
Also note that we can take this approach further by expanding the possible values in co_fastlocalkinds to include specific argument types (e.g. positional-only, kwargs). Doing so would allow further speed-ups in _PyEval_MakeFrameVector(), which is where args get unpacked into the locals-plus array. It would also allow us to shrink marshaled code objects even further.
https://bugs.python.org/issue43693
|
|
|
|
|
|
|
| |
* bpo-44246: Entry points performance improvements.
From importlib_metadata 4.3.1.
* bpo-44246: Sync with importlib_metadata 4.4
|
|
|
| |
From importlib_metadata 4.3.1.
|
|
|
|
|
| |
This is an internal-only API that helps us manage the many values used to create a code object.
https://bugs.python.org/issue43693
|
|
|
|
|
| |
5.0.6). (GH-26387)
Automerge-Triggered-By: GH:jaraco
|
|
|
| |
Automerge-Triggered-By: GH:jaraco
|
| |
|
|
|
|
|
| |
Signed-off-by: Filipe Laíns <lains@riseup.net>
Automerge-Triggered-By: GH:jaraco
|
|
|
|
| |
* bpo-43643: Sync with python/importlib_resources@c17a610aad.
* Sync with python/importlib_resources@89fd5e961a.
|
|
|
|
|
|
|
|
|
| |
keywords (GH-26014)
* Add CALL_METHOD_KW
* Make CALL_METHOD branchless too since it shares the same code
* Place parentheses in STACK_SHRINK
|
|
|
|
|
|
|
|
| |
"Zero cost" exception handling.
* Uses a lookup table to determine how to handle exceptions.
* Removes SETUP_FINALLY and POP_TOP block instructions, eliminating (most of) the runtime overhead of try statements.
* Reduces the size of the frame object by about 60%.
|
|
|
|
|
|
|
|
|
| |
* bpo-43926: Cleaner metadata with PEP 566 JSON support.
* Add blurb
* Add versionchanged and versionadded declarations for changes to metadata.
* Use descriptor for PEP 566
|
| |
|
|
|
|
|
| |
* Add length parameter to PyLineTable_InitAddressRange and doen't use sentinel values at end of table. Makes the line number table more robust.
* Update PyCodeAddressRange to match PEP 626.
|
|
|
|
|
|
|
| |
* bpo-43780: Sync with importlib_metadata 3.10.
* Add blurb
* Apply changes from importlib_metadata 3.10.1.
|
|
|
|
|
|
| |
(GH-25490)
This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it.
|
| |
|
|
|
|
| |
objects from file locations (GH-25121)
|
| |
|
|
|
|
| |
(GH-25169)
|
|
|
|
|
|
| |
* Handle check for sending None to starting generator and coroutine into bytecode.
* Document new bytecode and make it fail gracefully if mis-compiled.
|
|
|
|
|
|
|
| |
* Update magic numbers and bootstrapping for GH-25069
* add blurb
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
|
|
|
| |
will be removed in Python 3.12 (GH-25167)
|
| |
|
|
|
|
|
|
|
| |
internally. (GH-25069)
* Use instruction offset, rather than bytecode offset. Streamlines interpreter dispatch a bit, and removes most EXTENDED_ARGs for jumps.
* Change some uses of PyCode_Addr2Line to PyFrame_GetLineNumber
|
|
|
|
| |
system (GH-25044)
|
| |
|
|
|
|
|
| |
(GH-24953)
This is to work towards the removal of the use of module_repr() in Python 3.12 (documented as deprecated since 3.4).
|
|
|
|
|
|
|
| |
* bpo-43428: Sync with importlib_metadata 3.7.3 (16ac3a95)
* Add 'versionadded' for importlib.metadata.packages_distributions
* Add section in what's new for Python 3.10 highlighting most salient changes and relevant backport.
|
|
|
|
|
|
|
| |
* bpo-43428: Sync with importlib_metadata 3.7.2 (67234b6)
* Add blurb
* Reformat blurb to create separate paragraphs for each change included.
|
|
|
|
|
| |
* Unify behavior in ResourceReaderDefaultsTests and align with the behavior found in importlib_resources.
* Equip NamespaceLoader with a NamespaceReader.
* Apply changes from importlib_resources 5.0.4
|