Skip to content
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: have miri create an Allocation for the vtable #86324

Closed
crlf0710 opened this issue Jun 15, 2021 · 0 comments · Fixed by #86475
Closed

Refactor: have miri create an Allocation for the vtable #86324

crlf0710 opened this issue Jun 15, 2021 · 0 comments · Fixed by #86475
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@crlf0710
Copy link
Member

This is mentioned by @bjorn3 in #86291 (comment) .

The goal is this:

have miri create an Allocation for the vtable and then handle it like a normal constant in cg_{clif,llvm}?

Here's the mentoring notes:

The first step would be to refactor the vtable generation in miri to create an Allocation outside of the context of a Machine. In the place of the vtable codegen in cg_{clif,ssa} this function could be called followed by a call to whatever method is used to lower Allocations to backend constants. It may also be nice to add a map from trait + type -> allocation to tcx.alloc_map or something like that to replace the interning done by the backends.

@crlf0710 crlf0710 added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jun 15, 2021
@RalfJung RalfJung added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Jun 15, 2021
@bors bors closed this as completed in e98897e Jun 29, 2021
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this issue Jun 30, 2021
Change vtable memory representation to use tcx allocated allocations.

This fixes rust-lang/rust#86324. However i suspect there's more to change before it can land.

r? `@bjorn3`
cc `@rust-lang/miri`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants