-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Refactor vtable codegen #86291
Refactor vtable codegen #86291
Conversation
Some changes occured to rustc_codegen_cranelift cc @bjorn3 Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
7fd6b81
to
d8937cb
Compare
This comment has been minimized.
This comment has been minimized.
d8937cb
to
80a6cef
Compare
Would it be possible to have miri create an |
This comment has been minimized.
This comment has been minimized.
80a6cef
to
7b237e7
Compare
r? @bjorn3 |
This comment has been minimized.
This comment has been minimized.
That seems like it is a miscompilation. |
Indeed, i'll try to investigate. |
} | ||
} | ||
}) | ||
.collect::<Result<Vec<_>, _>>()?; |
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.
This is very elegant. :)
7b237e7
to
7be091e
Compare
Seems i found the bug. I need to add an initial 3 in function |
This comment has been minimized.
This comment has been minimized.
…ternal representation.
7be091e
to
a86d3a7
Compare
I think i've found the bug and got it fixed... let's wait to see if the test suite has anything more to say here. |
I think that would be nice, but it seems orthogonal to this PR so should probably be done separately. I know very little about the codegen backends so I don't think I can do much mentoring for this refactor... |
@bors r+ |
📌 Commit a86d3a7 has been approved by |
The first step would be to refactor the vtable generation in miri to create an |
Thanks! I've recorded this in #86324 to avoid forgetting about it. |
☀️ Test successful - checks-actions |
Refactor vtable codegen This refactor the codegen of vtables of miri interpreter, llvm, cranelift codegen backends. This is preparation for the implementation of trait upcasting feature. cc rust-lang#65991 Note that aside from code reorganization, there's an internal behavior change here that now InstanceDef::Virtual's index now include the three metadata slots, and now the first method is with index 3. cc `@RalfJung` `@bjorn3`
This refactor the codegen of vtables of miri interpreter, llvm, cranelift codegen backends.
This is preparation for the implementation of trait upcasting feature. cc #65991
Note that aside from code reorganization, there's an internal behavior change here that now InstanceDef::Virtual's index now include the three metadata slots, and now the first method is with index 3.
cc @RalfJung @bjorn3