-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Description
The TIER_ONE and TIER_TWO macros cause a few problems:
Their presence in the bytecode definitions means that anyone maintaining the interpreter or adding new instructions needs to understand the internals of the multiple execution layers and how they differ.
This makes the entry barrier for contribution, which is already high for these components, even higher.
It makes reasoning about the correctness of optimizations harder.
It prevents the addition of new execution tiers, or changing the design of the current tiers much harder.
We can remove the TIER_ONE and TIER_TWO macros by making modifications to internal execution engine state explicit, without describing how that state is implemented.
For example, rather than modifying next_instr in the tier 1 interpreter, we can use JUMP_BY or SAVE_IP macros.
See faster-cpython/ideas#618
Linked PRs
- GH-108614: Add
RESUME_CHECKinstruction #108630 - GH-108614: Remove non-debug uses of
#if TIER_ONEand#if TIER_TWOfrom_POP_FRAMEop. #108685 - GH-108614: Remove
TIER_ONEandTIER_TWOfrom_PUSH_FRAME#108725 - GH-108614: Unbreak emscripten build #109132
- GH-108614: Increase importlib MAGIC for RESUME_CHECK instruction #109247