Mark Shannon
fe23f8ed97
GH-122821: Simplify compilation of while statements to ensure consistency of offsets for sys.monitoring (GH-122934)
2024-08-13 10:25:44 +01:00
Mark Shannon
2e14a52cce
GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164)
2024-07-25 16:24:29 +01:00
Jelle Zijlstra
e8e151d471
gh-120780: Show attribute name for LOAD_SPECIAL in dis output ( #120781 )
2024-06-20 07:07:24 -07:00
Mark Shannon
9cefcc0ee7
GH-120507: Lower the `BEFORE_WITH` and `BEFORE_ASYNC_WITH` instructions. ( #120640 )
...
* Remove BEFORE_WITH and BEFORE_ASYNC_WITH instructions.
* Add LOAD_SPECIAL instruction
* Reimplement `with` and `async with` statements using LOAD_SPECIAL
2024-06-18 12:17:46 +01:00
Jelle Zijlstra
9b8611eeea
gh-119180: PEP 649 compiler changes ( #119361 )
2024-06-11 13:06:49 +00:00
Irit Katriel
016a46ab57
gh-93554: add test for quickening of code in loops ending with conditional statement ( #119485 )
2024-05-29 11:44:04 +01:00
Jelle Zijlstra
98e855fcc1
gh-119180: Add LOAD_COMMON_CONSTANT opcode ( #119321 )
...
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.
This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-05-22 00:46:39 +00:00
Mark Shannon
1ab6356ebe
GH-118095: Use broader specializations of CALL in tier 1, for better tier 2 support of calls. (GH-118322)
...
* Add CALL_PY_GENERAL, CALL_BOUND_METHOD_GENERAL and call CALL_NON_PY_GENERAL specializations.
* Remove CALL_PY_WITH_DEFAULTS specialization
* Use CALL_NON_PY_GENERAL in more cases when otherwise failing to specialize
2024-05-04 12:11:11 +01:00
Irit Katriel
d610d821fd
gh-112383: teach dis how to interpret ENTER_EXECUTOR ( #117171 )
2024-03-23 22:32:33 +00:00
Irit Katriel
74e6f4b32f
gh-112720: make it easier to subclass and modify dis.ArgResolver's jump arg resolution ( #115564 )
2024-02-16 19:25:19 +00:00
Mark Shannon
981d172f7f
GH-112354: `END_FOR` instruction to only pop one value. (GH-114247)
...
* Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
2024-01-24 15:10:17 +00:00
Irit Katriel
7e49f27b41
gh-114265: move line number propagation before cfg optimization, remove guarantee_lineno_for_exits ( #114267 )
2024-01-19 14:49:26 +00:00
Irit Katriel
0d8fec79ca
gh-107901: jump leaving an exception handler doesn't need an eval break check ( #113943 )
2024-01-11 14:27:41 +00:00
Irit Katriel
d36a365118
gh-107901: synthetic jumps which are not at end of loop no longer check the eval breaker ( #113721 )
2024-01-06 14:20:08 +00:00
Brandt Bucher
d07483292b
GH-112383: Fix test_loop_quicken when an executor is installed (GH-113153)
2023-12-15 17:27:57 +00:00
Irit Katriel
55ef998a8d
gh-112720: Move dis's cache output code to the Formatter, labels lookup to the arg_resolver. Reduce the number of parameters passed around. ( #113108 )
2023-12-15 12:28:22 +00:00
Irit Katriel
428c9812cb
gh-112962: in dis module, put cache information in the Instruction instead of creating fake Instructions to represent it ( #113016 )
2023-12-13 12:00:21 +00:00
Irit Katriel
c98c40227e
gh-112720: Move instruction formatting from the dis.Instruction class to a new class dis.InstructionFormatter. Add the ArgResolver class. ( #112722 )
2023-12-09 10:03:02 +00:00
Irit Katriel
162d3d428a
gh-112620: Fix dis error on show_cache with labels ( #112621 )
2023-12-03 12:12:49 +00:00
Irit Katriel
89ddea4886
gh-112137: change dis output to show no-lineno as -- instead of None ( #112335 )
2023-11-23 14:34:27 +00:00
Irit Katriel
10e1a0c916
gh-112137: change dis output to display labels instead of offsets ( #112138 )
2023-11-22 22:36:55 +00:00
Irit Katriel
b2af50cb02
gh-111969: refactor to make it easier to construct a dis.Instruction object ( #111970 )
2023-11-12 14:06:02 +00:00
Irit Katriel
d49aba5a7a
gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and frame state ( #111648 )
2023-11-03 10:01:36 +00:00
Irit Katriel
52cc4af6ae
gh-111354: simplify detection of RESUME after YIELD_VALUE at except-depth 1 ( #111459 )
2023-11-02 10:18:43 +00:00
Irit Katriel
ea285ad8b6
gh-109923: set line number on the POP_TOP that follows a RETURN_GENERATOR ( #109924 )
2023-09-27 13:24:33 +01:00
Irit Katriel
4a54074a0f
gh-105658: fix excess trace events for except block ending with a conditional block ( #109384 )
2023-09-14 17:06:08 +01:00
Brandt Bucher
22e65eecaa
GH-105848: Replace KW_NAMES + CALL with LOAD_CONST + CALL_KW (GH-109300)
2023-09-13 10:25:45 -07:00
Irit Katriel
8b55adfa8f
gh-109256: allocate opcode IDs for internal opcodes in their own range ( #109269 )
2023-09-12 10:36:17 +00:00
Guido van Rossum
bcce5e2718
gh-109039: Branch prediction for Tier 2 interpreter ( #109038 )
...
This adds a 16-bit inline cache entry to the conditional branch instructions POP_JUMP_IF_{FALSE,TRUE,NONE,NOT_NONE} and their instrumented variants, which is used to keep track of the branch direction.
Each time we encounter these instructions we shift the cache entry left by one and set the bottom bit to whether we jumped.
Then when it's time to translate such a branch to Tier 2 uops, we use the bit count from the cache entry to decided whether to continue translating the "didn't jump" branch or the "jumped" branch.
The counter is initialized to a pattern of alternating ones and zeros to avoid bias.
The .pyc file magic number is updated. There's a new test, some fixes for existing tests, and a few miscellaneous cleanups.
2023-09-11 18:20:24 +00:00
Mark Shannon
0858328ca2
GH-108614: Add `RESUME_CHECK` instruction (GH-108630)
2023-09-07 14:39:03 +01:00
Mark Shannon
bc2f9e6258
gh-107932: Fix merge conflict in test_dis (GH-108478)
...
Fix merge conflict in test_dis
2023-08-25 13:02:10 +01:00
Corvin
24aa249a66
gh-107932: Fix dis module for bytecode that does not have an associated source line (GH-107988)
2023-08-25 09:31:26 +01:00
Irit Katriel
665a4391e1
gh-105481: generate op IDs from bytecode.c instead of hard coding them in opcode.py ( #107971 )
2023-08-16 22:25:18 +00:00
Brandt Bucher
a9caf9cf90
GH-105848: Simplify the arrangement of CALL's stack (GH-107788)
2023-08-09 18:19:39 +00:00
Brandt Bucher
214a25dd81
GH-104584: Miscellaneous fixes for -Xuops (GH-106908)
2023-07-20 16:35:39 +00:00
Brandt Bucher
7b2d94d875
GH-106008: Make implicit boolean conversions explicit (GH-106003)
2023-06-29 13:49:54 -07:00
hms
8bff940ad6
gh-105775: Convert LOAD_CLOSURE to a pseudo-op ( #106059 )
...
This enables super-instruction formation,
removal of checks for uninitialized variables,
and frees up an instruction.
2023-06-29 09:34:00 -07:00
Mark Shannon
1d857da7f0
GH-77273: Better bytecodes for f-strings (GH-6132)
2023-06-14 16:15:08 +01:00
Mark Shannon
09ffa69e2e
GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE (GH-105680)
2023-06-13 09:51:05 +01:00
Tomas R
18d16e93b6
gh-102676: Add more convenience properties to `dis.Instruction` ( #103969 )
...
Adds start_offset, cache_offset, end_offset, baseopcode,
baseopname, jump_target and oparg to dis.Instruction.
Also slightly improves the disassembly output by allowing
opnames to overflow into the space reserved for opargs.
2023-06-11 08:50:34 -07:00
Dong-hee Na
aa5b762bd3
gh-104635: Eliminate redundant STORE_FAST instructions in the compiler (gh-105320)
2023-06-08 08:39:56 +09:00
Mark Shannon
0689340366
GH-105229: Replace some superinstructions with single instruction equivalent. (GH-105230)
2023-06-05 11:07:04 +01:00
Mark Shannon
4bfa01b9d9
GH-104584: Plugin optimizer API (GH-105100)
2023-06-02 11:46:18 +01:00
Carl Meyer
c3b595e73e
gh-97933: (PEP 709) inline list/dict/set comprehensions ( #101441 )
...
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-09 11:02:14 -06:00
Juhi Chandalia
872cbc6132
GH-103963: Make dis display names of args for intrinsics opcodes ( #104029 )
2023-05-02 19:00:17 -07:00
Juhi Chandalia
81387fe36e
GH-103804: Add test for dis.disco ( #103901 )
2023-04-28 12:11:21 +01:00
Juhi Chandalia
d45225bd66
GH-99944: Make dis display the value of oparg of KW_NAMES ( #103856 )
...
Co-authored-by: chilaxan <chilaxan@gmail.com>
2023-04-26 19:00:36 +01:00
Juhi Chandalia
86aa8a5e98
GH-103804: Add test for dis.findlinestarts ( #103806 )
2023-04-25 22:23:35 +01:00
chgnrdv
2b6f5c3483
gh-102114: Make dis print more concise tracebacks for syntax errors in str inputs ( #102115 )
2023-04-15 06:53:31 +01:00
Mark Shannon
411b169281
GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython (GH-103083)
...
* The majority of the monitoring code is in instrumentation.c
* The new instrumentation bytecodes are in bytecodes.c
* legacy_tracing.c adapts the new API to the old sys.setrace and sys.setprofile APIs
2023-04-12 12:04:55 +01:00