-
Notifications
You must be signed in to change notification settings - Fork 322
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
feat: Add v8::CompiledWasmModule
#776
Conversation
In order for |
`v8::CompiledWasmModule` is a representation of a compiled WebAssembly module, which can be shared by multiple `v8::WasmModuleObject`s. Closes denoland#759.
291ff09
to
29b601e
Compare
let foo_bs = foo_ab.get_backing_store(); | ||
let foo_section = unsafe { | ||
std::slice::from_raw_parts(foo_bs.data() as *mut u8, foo_bs.byte_length()) | ||
}; |
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.
Maybe just do the conversation to string in JavaScript?
let ab = WebAssembly.Module.customSections(module, 'foo')[0];
let ui8 = new Uint8Array(ab);
new TextDecoder().decode(ui8)
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.
TextDecoder
is a web API, not a v8 built-in.
|
||
// TODO(andreubotella): Safety??? | ||
unsafe impl Send for CompiledWasmModule {} | ||
unsafe impl Sync for CompiledWasmModule {} |
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'm not sure about this either. If you don't need it, can we leave them out for now?
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.
They're gonna be needed for denoland/deno#11823 though.
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.
LGTM - nice implementation - these are useful bindings to have!
v8::CompiledWasmModule
is a representation of a compiled WebAssembly module, which can be shared by multiplev8::WasmModuleObject
s.Closes #759.