Summary: | WebAssembly: Implement the WebAssembly.instantiate API | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Saam Barati <saam> | ||||||||||
Component: | JavaScriptCore | Assignee: | Saam Barati <saam> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | benjamin, commit-queue, fpizlo, ggaren, gskachkov, jfbastien, keith_miller, mark.lam, msaboff, oliver, ticaiolima, webkit-bug-importer, ysuzuki | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 169187 | ||||||||||||
Attachments: |
|
Description
Saam Barati
2016-12-16 18:31:19 PST
Created attachment 303376 [details]
WIP
Created attachment 303461 [details]
WIP
Need to write tests still. I think the API is done.
Created attachment 303462 [details]
WIP
Now with tests. I need to write a changelog still.
Created attachment 303464 [details]
patch
Attachment 303464 [details] did not pass style-queue:
ERROR: Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp:73: Missing space inside { }. [whitespace/braces] [5]
Total errors found: 1 in 8 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 303464 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=303464&action=review r=me with some comments. > Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp:117 > + throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("import must be an object"), defaultSourceAppender, runtimeTypeForValue(importModuleValue))); > + return nullptr; you could make a lambda like auto throw = [&] (Error* error) { throwException(exec, throwScope, error); return nullptr; }; then do: if (!importModuleValue.isObject()) return throw(createTypeError(exec, ASCIILiteral("import must be an object"), defaultSourceAppender, runtimeTypeForValue(importModuleValue))); Comment on attachment 303464 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=303464&action=review > Source/JavaScriptCore/wasm/JSWebAssembly.cpp:102 > + module = WebAssemblyModuleConstructor::createModule(exec, firstArgument, exec->lexicalGlobalObject()->WebAssemblyModuleStructure()); I think we should pass the mode here if we are given a memory import. (In reply to comment #8) > Comment on attachment 303464 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=303464&action=review > > > Source/JavaScriptCore/wasm/JSWebAssembly.cpp:102 > > + module = WebAssemblyModuleConstructor::createModule(exec, firstArgument, exec->lexicalGlobalObject()->WebAssemblyModuleStructure()); > > I think we should pass the mode here if we are given a memory import. We should do this in a follow up since it's non trivial. I filed: https://bugs.webkit.org/show_bug.cgi?id=169218 Comment on attachment 303464 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=303464&action=review >> Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp:117 >> + return nullptr; > > you could make a lambda like > > auto throw = [&] (Error* error) { > throwException(exec, throwScope, error); > return nullptr; > }; > > then do: > > if (!importModuleValue.isObject()) > return throw(createTypeError(exec, ASCIILiteral("import must be an object"), defaultSourceAppender, runtimeTypeForValue(importModuleValue))); Sounds good. Will do. landed in: https://trac.webkit.org/changeset/213506 |