-
Notifications
You must be signed in to change notification settings - Fork 11.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
[move][move-vm][rewrite][cleanup] Replace type info with a datatype descriptor pointers in VTables #21132
base: cgsworsd/vm_rewrite_jit_opt
Are you sure you want to change the base?
[move][move-vm][rewrite][cleanup] Replace type info with a datatype descriptor pointers in VTables #21132
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
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.
Changes look overall good to me, although there are some debug_assert
issues that must get fixed before this is ready to go.
if let Ok(value) = self.0.try_alloc(item) { | ||
Ok(value) | ||
} else { | ||
Err(PartialVMError::new(StatusCode::PACKAGE_ARENA_LIMIT_REACHED)) | ||
} |
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.
Nit:
if let Ok(value) = self.0.try_alloc(item) { | |
Ok(value) | |
} else { | |
Err(PartialVMError::new(StatusCode::PACKAGE_ARENA_LIMIT_REACHED)) | |
} | |
self.0.try_alloc(item).map_err(|_| PartialVMError::new(StatusCode::PACKAGE_ARENA_LIMIT_REACHED)) | |
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.
I appreciate this is more-concise, but the next PR needs the code like this anyway -- it has a more-complicated Ok
case.
external-crates/move/crates/move-vm-runtime/src/execution/interpreter/state.rs
Outdated
Show resolved
Hide resolved
pub struct DatatypeDescriptor { | ||
pub abilities: AbilitySet, | ||
pub type_parameters: Vec<DatatypeTyParameter>, | ||
pub name: Identifier, |
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.
No needed for this PR, but just for future changes here this name
should probably be an IdentifierKey
eventually.
package_context, | ||
link_context, | ||
package_context.runtime_id, | ||
package_id, | ||
&module.compiled_module, | ||
)?; | ||
// NB: Note that this assumes the datatype descriptors will live at least as long as the | ||
// vtable -- if that is not true, we _will_ segfault. |
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.
Do we need to worry about drop order of fields possibly here?
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.
We do not: VMPointer
forms are only "dropped" in the sense that they are discarded -- the underlying pointer is unmodified. As such, dropping in either order will be safe.
Description
Toward arena values everywhere, and to mirror the current situation for the function pointers in the virtual tables, we swap out types with a
DatatypeDescriptor
.Two notes:
Arc
locks to do that. We no longer do this, and instead theVMDispatchTables
struct holds the formulae separately. This is toward future-proofing for signatures and type ugradability.Test plan
Tests all still pass.
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.