-
Notifications
You must be signed in to change notification settings - Fork 11.6k
[move][move-vm][rewrite][cleanup 3/n] Replace index references with VM Pointers #21213
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
external-crates/move/crates/move-vm-runtime/src/execution/dispatch_tables.rs
Outdated
Show resolved
Hide resolved
external-crates/move/crates/move-vm-runtime/src/jit/execution/translate.rs
Show resolved
Hide resolved
DUPLICATE_NATIVE_FUNCTION = 2022, | ||
ARITHMETIC_OVERFLOW = 2023, | ||
DUPLICATE_TYPE_DEFINITION = 2050, | ||
VTABLE_KEY_LOOKUP_ERROR = 2033, |
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'd probably change this to a different number, it feels like 2024
or 2051
would fit better.
Also, why is there a jump from 2023
to 2050
... 🤔
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.
Changed to 2024
external-crates/move/crates/move-vm-runtime/src/jit/execution/ast.rs
Outdated
Show resolved
Hide resolved
module_name, | ||
member_name, | ||
}, | ||
match &self.datatype_info.inner_ref() { |
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.
Isn't this the same as qualified_name
above? Understandable if you don't want to remove this in this PR, but maybe add a TODO
for it (or reuse it)
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.
Removed
Datatype::Enum(ptr) => ptr.def_vtable_key.inner_pkg_key, | ||
Datatype::Struct(ptr) => ptr.def_vtable_key.inner_pkg_key, | ||
} |
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.
Consider rewriting in terms of qualified_name
possibly
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.
That would technically clone the whole key instead of just the inner key, which is a much larger copy.
3418245
to
5e0a343
Compare
Description
This refactors a large part of the execution AST in order to change every index in the bytecode to use a VM pointer instead. On the way, we also completely revised how types are stored in vtables and wrote down type definition IDs. The tracer and evaluator got much-simplified, but the translation had to change dramatically to accommodate.
Test plan
All the tests still pass. I plan to use ASAN / valgrind on this code in the coming days to ensure no memory is leaked.
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.