-
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
[6/n][vm-rewrite][sui-execution] Update object runtime to use type tags instead of runtime VM types #21070
base: tzakian/vm-rewrite-adapter-5
Are you sure you want to change the base?
[6/n][vm-rewrite][sui-execution] Update object runtime to use type tags instead of runtime VM types #21070
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
489397b
to
53ce0a8
Compare
2f24850
to
49f2c90
Compare
53ce0a8
to
04ed3db
Compare
49f2c90
to
b5ffa61
Compare
04ed3db
to
89b34cf
Compare
b5ffa61
to
fb777e6
Compare
89b34cf
to
208bdfc
Compare
let mut obj_runtime: RefMut<ObjectRuntime> = context | ||
.extensions() | ||
.get::<NativeContextMut<ObjectRuntime>>() | ||
.get_mut(); |
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.
let mut obj_runtime: RefMut<ObjectRuntime> = context | |
.extensions() | |
.get::<NativeContextMut<ObjectRuntime>>() | |
.get_mut(); | |
let obj_runtime = context.extensions_mut().get::<NativeContextMut<ObjectRuntime>>().borrow_mut(); |
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 the point of doing Deref :)
…gs instead of runtime VM types. Since the VM instance no longer will live across commands/the entire lifetime of the object runtime, this replaces all VM runtime `Type`s with `TypeTag`s or `MoveObjectType`s where appropriate. This also updates the natives and runtime to handle the new `NativeContextExtensions` model. NB: The code in the PR may not be working as future PRs will build on top of this.
…type tags instead of runtime VM types.
…to use type tags instead of runtime VM types.
fb777e6
to
a02ac4b
Compare
208bdfc
to
3f44124
Compare
// NB: We need to borrow the runtime and grab the mutable reference and then pass this into | ||
// `get_or_fetch_object` so that the lifetime of the returned object is tied to the lifetime of | ||
// the runtime reference we are creating here and the borrow checker will be happy with us. | ||
let object_runtime: &NativeContextMut<'_, ObjectRuntime<'_>> = context.extensions().get(); |
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.
let object_runtime: &NativeContextMut<'_, ObjectRuntime<'_>> = context.extensions().get(); | |
let object_runtime: &NativeContextMut<'_, ObjectRuntime<'_>> = context.extensions().get(); |
Bit of a nit, but let me message you a cleaner way for this. This seems a bit messy
Since the VM instance no longer will live across commands/the entire lifetime of the object runtime, this replaces all VM runtime
Type
s withTypeTag
s orMoveObjectType
s where appropriate. This also updates the natives and runtime to handle the newNativeContextExtensions
model.NB: The code in the PR may not be working as future PRs will build on top of this.