Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing temporary, non-object pointers to the stack between micro-ops is counter-productive #130296

Open
markshannon opened this issue Feb 19, 2025 · 0 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@markshannon
Copy link
Member

markshannon commented Feb 19, 2025

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 allow PUSH_FRAME. But since PUSH_FRAME needs special treatment anyway, there may be a better way to do this.

The disadvantages:

Linked PRs

@encukou encukou added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Feb 19, 2025
@picnixz picnixz added the type-feature A feature request or enhancement label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants