Conversation
clonker
commented
Apr 18, 2026
|
|
||
| auto const& targetArg = _state.targetArg(offset); | ||
| // if the target arg is junk, we can simply push0 and it's fine | ||
| if (targetArg.isJunk()) |
Member
Author
There was a problem hiding this comment.
this condition should in the future, i think, be extended to "is it junk or a lit that is cheap to push or we don't care about bytecode size and simply want fast execution"
blishko
reviewed
Apr 18, 2026
Comment on lines
+1
to
+4
| initial: [lit1, lit1, v0, v0, lit0, v0, lit0, v0, v0, v0, lit0, v0, v0, v0, lit0, v0, lit0, lit0, v0] | ||
| targetStackTop: [JUNK, lit0, v0, lit0, v0, JUNK, v0, lit0, JUNK, v0, v0, lit0, v0, JUNK, lit0, v0, lit1] | ||
| targetStackTailSet: {v0} | ||
| targetStackSize: 20 |
Contributor
There was a problem hiding this comment.
I am a bit confused.
Why is it trying to reach for lit1 instead of just doing PUSH lit1?
This should be just one instruction, similar to the JUNK case.
Contributor
There was a problem hiding this comment.
Oh, now I understand your comment.
PUSH lit1 is potentially expensive, if lit1 is large.
As you say, at some point it would be good to come up with some heuristic to re-create the literal instead of trying to dup/swap existing one.
blishko
approved these changes
Apr 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added three tests, where the stack top is either a variable, a lit, or junk and the stack has to grow by one to populate it. For the first two, the shuffler pulls the var/lit out of the tail by shrinking and then growing back; for junk it should simply push0 (when it was previously oscillating).