summaryrefslogtreecommitdiffstats
path: root/Lib/dis.py
Commit message (Collapse)AuthorAgeFilesLines
* GH-100923: Embed jump mask in `COMPARE_OP` oparg (GH-100924)Mark Shannon2023-01-111-1/+1
|
* Remove unused variable from `dis._find_imports` (#100396)Nikita Sobolev2022-12-211-1/+0
|
* GH-98686: Get rid of "adaptive" and "quick" instructions (GH-99182)Brandt Bucher2022-11-091-3/+2
|
* bpo-40222: Mark exception table function in the dis module as private (#95961)Pablo Galindo Salgado2022-08-141-8/+8
|
* gh-94216: add pseudo instructions to the dis/opcodes modules (GH-94241)Irit Katriel2022-07-011-1/+1
|
* GH-91432: Specialize FOR_ITER (GH-91713)Dennis Sweeney2022-06-211-3/+9
| | | | | * Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations. * Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
* GH-91389: Fix dis position information for CACHEs (GH-93663)Brandt Bucher2022-06-161-10/+22
|
* GH-93429: Merge `LOAD_METHOD` back into `LOAD_ATTR` (GH-93430)Ken Jin2022-06-141-0/+5
|
* gh-92932: dis._unpack_opargs should handle EXTENDED_ARG_QUICK (gh-92945)Dong-hee Na2022-06-031-1/+1
|
* gh-90997: Move `CACHE` handling into `_unpack_opargs` (#92409)Brandt Bucher2022-05-061-7/+9
| | | | | | | * Move CACHE handling into _unpack_opargs * Remove auto-added import * blurb add
* gh-90997: Show cached inline values in `dis` output (#92360)Brandt Bucher2022-05-061-5/+19
|
* gh-91276: revert the increase of dis output width (GH-92126)Irit Katriel2022-05-021-1/+1
|
* gh-90997: bpo-46841: Disassembly of quickened code (GH-32099)penguin_wwy2022-04-191-36/+63
|
* gh-91276: make space for longer opcodes in dis output (GH-91444)Irit Katriel2022-04-121-1/+1
|
* bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)Irit Katriel2022-04-111-2/+5
|
* bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD ↵Irit Katriel2022-03-311-1/+5
| | | | (GH-32115)
* Use low bit of LOAD_GLOBAL's oparg to indicate whether it should push an ↵Mark Shannon2022-03-171-1/+7
| | | | additional NULL. (GH-31933)
* bpo-46841: Use *inline* caching for `BINARY_OP` (GH-31543)Brandt Bucher2022-02-251-24/+41
|
* bpo-46724: Fix dis support for overflow args (GH-31285)Saul Shanabrook2022-02-181-0/+11
|
* bpo-46422: use `dis.Positions` in `dis.Instruction` (GH-30716)Nikita Sobolev2022-01-241-4/+1
| | | Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* bpo-45636: Merge all numeric operators (GH-29482)Brandt Bucher2021-11-111-0/+4
|
* bpo-45757: Fix bug where dis produced an incorrect oparg on EXTENDED_ARG ↵Irit Katriel2021-11-091-0/+1
| | | | before a no-arg opcode (GH-29480)
* bpo-45152: refactor the dis module to make handling of hasconst opcodes more ↵Irit Katriel2021-09-151-19/+35
| | | | generic (GH-28258)
* bpo-45168: change dis output to omit missing values rather than replacing ↵Irit Katriel2021-09-141-9/+16
| | | | them by their index (GH-28313)
* bpo-45017: move opcode-related logic from modulefinder to dis (GH-28246)Irit Katriel2021-09-091-0/+36
|
* bpo-43950: support positions for dis.Instructions created through ↵Batuhan Taskaya2021-09-031-1/+2
| | | | dis.Bytecode (GH-28142)
* bpo-43950: include position in dis.Instruction (GH-27015)Batuhan Taskaya2021-07-041-9/+44
| | | Automerge-Triggered-By: GH:isidentical
* bpo-43693: Un-revert commits 2c1e258 and b2bf2bc. (gh-26577)Eric Snow2021-06-071-26/+27
| | | | | | | | | | 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
* bpo-43693: Revert commits 2c1e2583fdc4db6b43d163239ea42b0e8394171f and ↵Pablo Galindo2021-06-041-27/+26
| | | | | | | | | | | | | 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.
* bpo-43693: Compute deref offsets in compiler (gh-25152)Mark Shannon2021-06-041-4/+1
| | | | | | 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
* bpo-43693: Add new internal code objects fields: co_fastlocalnames and ↵Eric Snow2021-06-031-24/+28
| | | | | | | | | | | | | | | | | 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-40222: "Zero cost" exception handling (GH-25729)Mark Shannon2021-05-071-7/+49
| | | | | | | | "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-27129: Use instruction offsets, not byte offsets, in bytecode and ↵Mark Shannon2021-04-011-3/+6
| | | | | | | 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
* bpo-42562: Fix issue when dis failed to parse function that has no line ↵Yurii Karabas2020-12-041-1/+1
| | | | | | numbers (GH-23632) Fix issue when dis failed to parse function that has only annotations
* bpo-42246: Partial implementation of PEP 626. (GH-23113)Mark Shannon2020-11-121-25/+8
| | | * Implement new line number table format, as defined in PEP 626.
* bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757)Konge2020-08-081-1/+1
|
* bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079)T. Wouters2019-09-281-0/+5
| | | | | | | | | | Document that lnotab can contain invalid bytecode offsets (because of terrible reasons that are difficult to fix). Make dis.findlinestarts() ignore invalid offsets in lnotab. All other uses of lnotab in CPython (various reimplementations of addr2line or line2addr in Python, C and gdb) already ignore this, because they take an address to look for, instead. Add tests for the result of dis.findlinestarts() on wacky constructs in test_peepholer.py, because it's the easiest place to add them.
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* bpo-32970: Improve disassembly of the MAKE_FUNCTION instruction. (GH-5937)Serhiy Storchaka2018-03-111-2/+14
|
* bpo-31183: `dis` now handles coroutines & async generators (GH-3077)syncosmic2017-08-181-12/+30
| | | | | | | | | | | | | | Coroutines and async generators use a distinct attribute name for their code objects, so this updates the `dis` module to correctly disassemble objects with those attributes. Due to the increase in the test module length, it also fixes some latent defects in the tests related to how the displayed source line numbers are extracted. https://bugs.python.org/issue31230 is a follow-up issue suggesting we may want to solve this a different way, by instead giving all these object types a common `__code__` attribute, avoiding the need for special casing in the `dis` module.
* bpo-11822: Improve disassembly to show embedded code objects. (#1844)Serhiy Storchaka2017-06-111-6/+17
| | | The depth argument limits recursion.
* bpo-22352: Adjust widths in the output of dis.dis() for large line numbers ↵Serhiy Storchaka2017-04-191-7/+23
| | | | | | | and (#1153) instruction offsets. Add tests for widths of opcode names.
* bpo-29762: More use "raise from None". (#569)Serhiy Storchaka2017-04-051-1/+1
| | | This hides unwanted implementation details from tracebacks.
* Issue #28317: The disassembler now decodes FORMAT_VALUE argument.Serhiy Storchaka2016-10-081-0/+9
|
* Issue #27213: Fixed different issues with reworked CALL_FUNCTION* opcodes.Serhiy Storchaka2016-09-111-2/+0
| | | | | | | | | | | * BUILD_TUPLE_UNPACK and BUILD_MAP_UNPACK_WITH_CALL no longer generated with single tuple or dict. * Restored more informative error messages for incorrect var-positional and var-keyword arguments. * Removed code duplications in _PyEval_EvalCodeWithName(). * Removed redundant runtime checks and parameters in _PyStack_AsDict(). * Added a workaround and enabled previously disabled test in test_traceback. * Removed dead code from the dis module.
* Rework CALL_FUNCTION* opcodesVictor Stinner2016-09-091-1/+1
| | | | | | | | | | | | | | | | | | | Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more efficient bytecode: * CALL_FUNCTION now only accepts position arguments * CALL_FUNCTION_KW accepts position arguments and keyword arguments, but keys of keyword arguments are packed into a constant tuple. * CALL_FUNCTION_EX is the most generic, it expects a tuple and a dict for positional and keyword arguments. CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW opcodes have been removed. 2 tests of test_traceback are currently broken: skip test, the issue #28050 was created to track the issue. Patch by Demur Rumed, design by Serhiy Storchaka, reviewed by Serhiy Storchaka and Victor Stinner.
* Issue #28003: Implement PEP 525 -- Asynchronous Generators.Yury Selivanov2016-09-091-0/+1
|
* Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode.Serhiy Storchaka2016-05-241-22/+13
| | | | Patch by Demur Rumed.
* Issue #26881: The modulefinder module now supports extended opcode arguments.Serhiy Storchaka2016-05-081-29/+26
|\
| * Issue #26881: The modulefinder module now supports extended opcode arguments.Serhiy Storchaka2016-05-081-29/+26
| |