-
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
cranelift: Implement pinned reg in interpreter #4375
Merged
Merged
Conversation
This file contains 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
github-actions
bot
added
the
cranelift
Issues related to the Cranelift code generator
label
Jul 4, 2022
afonso360
force-pushed
the
interp-pinned-reg
branch
from
July 4, 2022 20:59
22b89e0
to
f198ab0
Compare
cfallin
approved these changes
Jul 5, 2022
Happy to merge after merge-conflict is fixed! |
afonso360
force-pushed
the
interp-pinned-reg
branch
from
July 5, 2022 18:45
f198ab0
to
c51c9d5
Compare
It looks like there have been again merge conflicts. |
afonso360
force-pushed
the
interp-pinned-reg
branch
from
August 9, 2022 20:22
c51c9d5
to
9fb688f
Compare
Thanks for the reminder! |
cfallin
approved these changes
Aug 9, 2022
auto-merge was automatically disabled
August 10, 2022 19:36
Head branch was pushed to by a user without write access
afonso360
force-pushed
the
interp-pinned-reg
branch
from
August 10, 2022 19:36
9fb688f
to
e1d2b0e
Compare
jameysharp
approved these changes
Aug 10, 2022
abrown
added a commit
to abrown/wasmtime
that referenced
this pull request
Aug 11, 2022
In bytecodealliance#4375 we introduced a code pattern that appears as a warning when building the `cranelift-interpreter` crate: ``` warning: cannot borrow `*state` as mutable because it is also borrowed as immutable --> cranelift/interpreter/src/step.rs:412:13 | 47 | let arg = |index: usize| -> Result<V, StepError> { | -------------------------------------- immutable borrow occurs here 48 | let value_ref = inst_context.args()[index]; 49 | state | ----- first borrow occurs due to use of `*state` in closure ... 412 | state.set_pinned_reg(arg(0)?); | ^^^^^^^^^^^^^^^^^^^^^---^^^^^ | | | | | immutable borrow later used here | mutable borrow occurs here | = note: `#[warn(mutable_borrow_reservation_conflict)]` on by default = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future = note: for more information, see issue #59159 <rust-lang/rust#59159> ``` This change fixes the warning.
jameysharp
pushed a commit
that referenced
this pull request
Aug 11, 2022
In #4375 we introduced a code pattern that appears as a warning when building the `cranelift-interpreter` crate: ``` warning: cannot borrow `*state` as mutable because it is also borrowed as immutable --> cranelift/interpreter/src/step.rs:412:13 | 47 | let arg = |index: usize| -> Result<V, StepError> { | -------------------------------------- immutable borrow occurs here 48 | let value_ref = inst_context.args()[index]; 49 | state | ----- first borrow occurs due to use of `*state` in closure ... 412 | state.set_pinned_reg(arg(0)?); | ^^^^^^^^^^^^^^^^^^^^^---^^^^^ | | | | | immutable borrow later used here | mutable borrow occurs here | = note: `#[warn(mutable_borrow_reservation_conflict)]` on by default = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future = note: for more information, see issue #59159 <rust-lang/rust#59159> ``` This change fixes the warning.
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.
👋 Hey,
This implements pinned reg instructions in the interpreter and adds some tests for it.