-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
interpret: refactor function call handling to be better-abstracted #128687
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri The Miri subtree was changed cc @rust-lang/miri |
b3caa1b
to
498d687
Compare
This comment has been minimized.
This comment has been minimized.
721ee9b
to
b02aa4f
Compare
☔ The latest upstream changes (presumably #128707) made this pull request unmergeable. Please resolve the merge conflicts. |
57f9d09
to
5783e73
Compare
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.
The changes generally look good, but I have a few nits/questions
src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.stderr
Show resolved
Hide resolved
r? WaffleLapkin |
ca0af71
to
1c2705c
Compare
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.
r=me with green CI
@bors r=WaffleLapkin |
…r=WaffleLapkin interpret: refactor function call handling to be better-abstracted Add a new function `init_stack_frame` that pushes a stack frame and passes the arguments, and use that basically everywhere that the raw underlying `push_stack_frame` used to be called. This splits the previous monster function `eval_fn_call` into two parts: figuring out the MIR to call and the arguments to pass, and then actually setting up the stack frame. Also re-organize the files a bit: - The previous `terminator.rs` is split into a new `call.rs` with all the argument-passing logic, and the rest goes into `step.rs` where the other main dispatcher functions already live (in particular, `eval_statement`). - All the stack frame handling from `eval_context.rs` is moved to a new `stack.rs`.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#125048 (PinCoerceUnsized trait into core) - rust-lang#128273 (Improve `Ord` violation help) - rust-lang#128406 (implement BufReader::peek) - rust-lang#128539 (Forbid unused unsafe in vxworks-specific std modules) - rust-lang#128687 (interpret: refactor function call handling to be better-abstracted) - rust-lang#128692 (Add a triagebot mention for `library/Cargo.lock`) - rust-lang#128710 (Don't ICE when getting an input file name's stem fails) - rust-lang#128718 (Consider `cfg_attr` checked by `CheckAttrVisitor`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#125048 (PinCoerceUnsized trait into core) - rust-lang#128273 (Improve `Ord` violation help) - rust-lang#128406 (implement BufReader::peek) - rust-lang#128539 (Forbid unused unsafe in vxworks-specific std modules) - rust-lang#128687 (interpret: refactor function call handling to be better-abstracted) - rust-lang#128692 (Add a triagebot mention for `library/Cargo.lock`) - rust-lang#128710 (Don't ICE when getting an input file name's stem fails) - rust-lang#128718 (Consider `cfg_attr` checked by `CheckAttrVisitor`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#124944 (On trait bound mismatch, detect multiple crate versions in dep tree) - rust-lang#125048 (PinCoerceUnsized trait into core) - rust-lang#128406 (implement BufReader::peek) - rust-lang#128539 (Forbid unused unsafe in vxworks-specific std modules) - rust-lang#128687 (interpret: refactor function call handling to be better-abstracted) - rust-lang#128692 (Add a triagebot mention for `library/Cargo.lock`) - rust-lang#128710 (Don't ICE when getting an input file name's stem fails) - rust-lang#128718 (Consider `cfg_attr` checked by `CheckAttrVisitor`) - rust-lang#128751 (std::thread: set_name implementation proposal for vxWorks.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128687 - RalfJung:interpret-call-refactor, r=WaffleLapkin interpret: refactor function call handling to be better-abstracted Add a new function `init_stack_frame` that pushes a stack frame and passes the arguments, and use that basically everywhere that the raw underlying `push_stack_frame` used to be called. This splits the previous monster function `eval_fn_call` into two parts: figuring out the MIR to call and the arguments to pass, and then actually setting up the stack frame. Also re-organize the files a bit: - The previous `terminator.rs` is split into a new `call.rs` with all the argument-passing logic, and the rest goes into `step.rs` where the other main dispatcher functions already live (in particular, `eval_statement`). - All the stack frame handling from `eval_context.rs` is moved to a new `stack.rs`.
Add a new function
init_stack_frame
that pushes a stack frame and passes the arguments, and use that basically everywhere that the raw underlyingpush_stack_frame
used to be called. This splits the previous monster functioneval_fn_call
into two parts: figuring out the MIR to call and the arguments to pass, and then actually setting up the stack frame.Also re-organize the files a bit:
terminator.rs
is split into a newcall.rs
with all the argument-passing logic, and the rest goes intostep.rs
where the other main dispatcher functions already live (in particular,eval_statement
).eval_context.rs
is moved to a newstack.rs
.