-
Notifications
You must be signed in to change notification settings - Fork 3.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
[move-cm][closures] Refactor: Move type conversions out of Loader
into a trait
#15669
base: wrwg/clos_ability_move
Are you sure you want to change the base?
Conversation
⏱️ 50m total CI duration on this PR
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
34517a1
to
7862e77
Compare
4972a5c
to
2fed681
Compare
7862e77
to
ee49138
Compare
2fed681
to
9c0814c
Compare
ee49138
to
9fbe74f
Compare
9c0814c
to
8b11451
Compare
…nto a trait Type conversions from runtime types to `MoveTypeLayout` and `TypeTag` currently are associated with the `Loader` type. However, they are needed for the `FunctionValueExtension` trait which needs to be constructed in contexts where no loader but only `ModuleStorage` exists. This PR moves the conversion functions into a new trait `TypeConverter`. The trait is then implemented two times based on `ModuleStorage` only and based on the existing `Loader`, for downwards compatibility.
8b11451
to
dcb6bc5
Compare
} | ||
|
||
/// Converts a runtime type to a type tag. | ||
fn type_to_type_tag(&self, ty: &Type) -> PartialVMResult<TypeTag> { |
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.
FYI, I have a PR to move type tag conversion outside of loader as well...: #15676. We should probably sync changes for this one.
Description
[PR 3/n vm closures]
Type conversions from runtime types to
MoveTypeLayout
andTypeTag
currently are associated with theLoader
type. However, they are needed for theFunctionValueExtension
trait which needs to be constructed in contexts where no loader but onlyModuleStorage
exists.This PR moves the conversion functions into a new trait
TypeConverter
. The trait is then implemented two times, once based onModuleStorage
only and once based on the existingLoader
, for downwards compatibility.How Has This Been Tested?
Refactoring only, existing tests
Type of Change
Which Components or Systems Does This Change Impact?