-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-104584: Support most jumping instructions #106393
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d31d003
Hacky way to implement jump ops
gvanrossum b886ca6
Make JUMP_BACKWARD[_NO_INTERRUPT] viable
gvanrossum 28b3951
Replace ENTER_EXECUTOR with the original in trace projection
gvanrossum 0825696
Make POP_JUMP_IF_FALSE/TRUE conditionally jump
gvanrossum 1df7b84
Implement JUMP_TO_TOP special uop
gvanrossum d6235ee
Cleanup some commented-out lines
gvanrossum 6cd5719
Tweak FOR_ITER so it's viable
gvanrossum b33a1a2
Check room available for JUMP_TO_TOP
gvanrossum f5e18d8
A stray JUMP_BACKWARD also ends the trace
gvanrossum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Replace ENTER_EXECUTOR with the original in trace projection
- Loading branch information
commit 28b3951b4b4a8039ca4f0ee01b76b4772182903b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than special case individual instructions, can we test on flags?
That way, this will continue to work if we add
LOAD_FAST_LOAD_CONST.Something like
if (_Py_OpcodeMetadata[opcode].is_super_instruction)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do something where the code generator encodes this in the
sizefield of the expansions, in the switch (currently) at line 405 below. E.g.-1meansoperand >> 4and-2meansoperand & 0xF. Should probably switch to an enum. The generator would have to work a little harder but that seems doable (e.g. it could detect the use ofoparg1andoparg2and then parse the instruction name into two pieces).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should work, although I was thinking of the dumber approach of just annotating
LOAD_FAST_LOAD_FAST, etc as a superinstruction in bytecodes.c. Something like adding/* superinstruction */