Uh oh!
There was an error while loading. Please reload this page.
rustc: split FnAbi's into definitions/direct calls ("of_instance") and indirect calls ("of_fn_ptr"). - #65947
Conversation
rust-highfive
commented
Oct 29, 2019
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
eddyb
commented
Oct 30, 2019
@bors try @rust-timer queue |
rust-timer
commented
Oct 30, 2019
Awaiting bors try build completion |
bors
commented
Oct 30, 2019
⌛ Trying commit a3153cb25e0c2eca2a987433763f40383a774cf8 with merge 924ec06b909e3054669b8cec62e173ff2e962a06... |
Uh oh!
There was an error while loading. Please reload this page.
bors
commented
Oct 30, 2019
☀️ Try build successful - checks-azure |
rust-timer
commented
Oct 30, 2019
Queued 924ec06b909e3054669b8cec62e173ff2e962a06 with parent 0b7e28a, future comparison URL. |
Uh oh!
There was an error while loading. Please reload this page.
rust-timer
commented
Oct 30, 2019
Finished benchmarking try commit 924ec06b909e3054669b8cec62e173ff2e962a06, comparison URL. |
varkor
commented
Nov 8, 2019
I've looked through, and while the changes look sensible to me, I'm not familiar enough to be sure I haven't missed some detail, so I'm going to reassign. r? @nagisa |
varkor
commented
Nov 8, 2019
Does this mean #15694 could be addressed? |
eddyb
commented
Nov 8, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nagisa
left a comment
There was a problem hiding this comment.
Overall LGTM.
r=me once you’re comfortable with landing this.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
eddyb
commented
Nov 27, 2019
eddyb
commented
Dec 3, 2019
@bors r=oli-obk,nagisa |
bors
commented
Dec 3, 2019
📌 Commit c2f4c57 has been approved by |
bors
commented
Dec 4, 2019
rustc: split FnAbi's into definitions/direct calls ("of_instance") and indirect calls ("of_fn_ptr").
After this PR:
* `InstanceDef::Virtual` is only used for "direct" virtual calls, and shims around those calls use `InstanceDef::ReifyShim` (i.e. for `<dyn Trait as Trait>::f as fn(_)`)
* this could easily be done for intrinsics as well, to allow their reification, but I didn't do it
* `FnAbi::of_instance` is **always** used for declaring/defining an `fn`, and for direct calls to an `fn`
* this is great for e.g. #65881 (`#[track_caller]`), which can introduce the "caller location" argument into "codegen signatures" by only changing `FnAbi::of_instance`, after this PR
* `FnAbi::of_fn_ptr` is used primarily for indirect calls, i.e. to `fn` pointers
* *not* virtual calls (which use `FnAbi::of_instance` with `InstanceDef::Virtual`)
* there's also a couple uses where the `rustc_codegen_llvm` needs to declare (i.e. FFI-import) an LLVM function that has no Rust declaration available at all
* at least one of them could probably be a "weak lang item" instead
As there are many steps, this PR is best reviewed commit by commit - some of which arguably should be in their own PRs, I may have gotten carried away a bit.
cc @nagisa@rkruppe@oli-obk@anpbors
commented
Dec 4, 2019
☀️ Test successful - checks-azure |
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in rust-lang#65947) cc @eddyb@oli-obk
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in rust-lang#65947) cc @eddyb@oli-obk
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in rust-lang#65947) cc @eddyb@oli-obk
After this PR:
InstanceDef::Virtualis only used for "direct" virtual calls, and shims around those calls useInstanceDef::ReifyShim(i.e. for<dyn Trait as Trait>::f as fn(_))FnAbi::of_instanceis always used for declaring/defining anfn, and for direct calls to anfn#[track_caller]), which can introduce the "caller location" argument into "codegen signatures" by only changingFnAbi::of_instance, after this PRFnAbi::of_fn_ptris used primarily for indirect calls, i.e. tofnpointersFnAbi::of_instancewithInstanceDef::Virtual)rustc_codegen_llvmneeds to declare (i.e. FFI-import) an LLVM function that has no Rust declaration available at allAs there are many steps, this PR is best reviewed commit by commit - some of which arguably should be in their own PRs, I may have gotten carried away a bit.
cc @nagisa@rkruppe@oli-obk@anp