-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Description
Currently, we allow micro-ops to push temporary non-object pointers to the stack to be consumed by the following micro-op.
This has a number of disadvantages. We originally allowed this for a number of reasons, most of which are not true any more.
The original advantages:
- Allows more instructions to be handled in the JIT as micro-ops could only have one operand. Micro-ops can now have two operands, so this isn't true any more
- Would allow simpler optimizations be removing guards and leaving actions. In fact, the pair of micro-ops that push then pop are often so tightly coupled that there are best optimized as a single unit.
- It reduces code duplication, by allowing common patterns such as
PUSH_FRAME
to be re-used. This is still true, so we may still want to allowPUSH_FRAME
. But sincePUSH_FRAME
needs special treatment anyway, there may be a better way to do this.
The disadvantages:
- It complicates the code generator
- Having non-object pointers on the stack is fragile, e.g. Crash with
PYTHON_LLTRACE=4
due to presence ofPyDictKeysObject
on stack #129432
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement