-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
winch(x64): Add support for loop
, br
and br_if
#6603
winch(x64): Add support for loop
, br
and br_if
#6603
Conversation
Subscribe to Label Action
This issue or pull request has been labeled: "fuzzing", "winch"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
That's totally fine; we'll have to review it anyway and IMHO when closely coupled it's better to see the pieces together. I'll try to get to this today! |
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.
A few thoughts but overall I like how this is turning out -- the abstractions around the ControlStackFrame
are very clean!
60e9959
to
348cf72
Compare
@cfallin I've addressed all of your comments, I think this is ready for another pass. Regarding the visitor vs match-on-op discussion above, I've updated the approach to rely only on the visitor approach, by extending the existing |
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.
Nice! Seems good to me but I'd defer to @cfallin still for other technical review bits
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.
Generally LGTM, thanks! A few comments below but feel free to merge when addressed.
This change adds support for the `loop`, `br` and `br_if` instructions as well as unreachable code handling. Whenever an instruction that affects reachability is emitted (`br` in the case of this PR), the compiler will enter into an unreachable code state, essentially ignoring most of the subsequent instructions. When handling the unreachable code state some instructions are still observed, in order to determine if reachability should be restored. This change, particulary the handling of unreachable code, adds all the necessary building blocks to the compiler to emit other instructions that affect reachability (e.g `unreachable`, `return`). Address review feedback * Rename `branch_target` to `is_branch_target` * Use the visitor pattern to handle unreachable code Avoid string comparison and split unreachable handling functions
74b64d0
to
9e00fd5
Compare
Seems that the Fuzz Targets step is having issues trying to fetch OCaml:
|
Seems to be fixed! |
This change adds support for the `return` and `unreachable` instructions. This change builds on top of the control flow building blocks introduced in bytecodealliance#6603
This change adds support for the `return` and `unreachable` instructions. This change builds on top of the control flow building blocks introduced in #6603
Part of #6528
This change adds support for the
loop
,br
andbr_if
instructions as well as unreachable code handling. Whenever an instruction that affects reachability is emitted (br
in the case of this PR), the compiler will enter into an unreachable code state, essentially ignoring most of the subsequent instructions. When handling the unreachable code state some instructions are still observed, in order to determine if reachability should be restored.This change, particulary the handling of unreachable code, adds all the necessary building blocks to the compiler to emit other instructions that affect reachability (e.g
unreachable
,return
).I decided to bundle these instructions together to be able to test more complex scenarios with
loop
, but I'm happy to split this change into two (or more).