Closed
Bug 1316447
Opened 8 years ago
Closed 8 years ago
Baldr: add recent JS API additions
Categories
(Core :: JavaScript Engine: JIT, defect, P1)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: luke, Assigned: luke)
References
Details
Attachments
(3 files, 1 obsolete file)
17.88 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
4.45 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
32.03 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
Namely WebAssembly.Module.(imports|exports) and WebAssembly.instantiate.
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8809192 -
Flags: review?(bbouvier)
Assignee | ||
Comment 2•8 years ago
|
||
Little bit of code motion to enable code sharing in next patch.
Attachment #8809276 -
Flags: review?(bbouvier)
Assignee | ||
Comment 3•8 years ago
|
||
WebAssembly.instantiate is also pretty easy; mostly just refactoring existing code so that it can be reused.
Attachment #8809277 -
Flags: review?(bbouvier)
Comment 4•8 years ago
|
||
Comment on attachment 8809192 [details] [diff] [review] Module.imports and exports Review of attachment 8809192 [details] [diff] [review]: ----------------------------------------------------------------- Nice! ::: js/src/wasm/WasmJS.cpp @@ +526,5 @@ > + } > + > + *module = &unwrapped->as<WasmModuleObject>().module(); > + return true; > + nit: blank line @@ +532,5 @@ > + > +struct KindNames > +{ > + RootedPropertyName kind; > + RootedPropertyName function; I think this is unused (since you can use cx->names().function)?
Attachment #8809192 -
Flags: review?(bbouvier) → review+
Comment 5•8 years ago
|
||
Comment on attachment 8809276 [details] [diff] [review] hoist-sync-execute Review of attachment 8809276 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/builtin/Promise.h @@ +166,5 @@ > // calling finishPromise(). > virtual void execute() = 0; > + > + // May be called in the absence of helper threads to synchronously execute > + // and finish a PromiseTask. Is it called if and only if there are no helper threads (in which case we could assert)? (I guess I'll figure out in the next patch)
Attachment #8809276 -
Flags: review?(bbouvier) → review+
Comment 6•8 years ago
|
||
Comment on attachment 8809277 [details] [diff] [review] instantiate Review of attachment 8809277 [details] [diff] [review]: ----------------------------------------------------------------- Found one non-nit, I think: instantiate should return Instance *and* Module, per the design repo wording. This and the wrapped question have me want a second look. The Promise code is very clean and easy to understand! ::: js/src/wasm/WasmJS.cpp @@ +1794,5 @@ > + RootedWasmInstanceObject instanceObj(cx); > + if (!Instantiate(cx, *module, importObj, &instanceObj)) > + return RejectWithPendingException(cx, promise); > + > + RootedValue resolutionValue(cx, ObjectValue(*instanceObj)); This is not correct, per https://github.com/WebAssembly/design/blob/master/JS.md: On success, the Promise is fulfilled with a plain JavaScript object pair {module, instance} containing the resulting WebAssembly.Module and WebAssembly.Instance @@ +1822,5 @@ > + RootedObject importObj(cx); > + if (!GetInstantiateArgs(cx, callArgs, &firstArg, &importObj)) > + return RejectWithPendingException(cx, promise, callArgs); > + > + if (firstArg->is<WasmModuleObject>()) { It's a bit strange that the type checking of the first arg is made in two different functions. Could a wrapped Module be passed to this Instantiate? If so, I think it might be considered a bad arg in this impl.
Attachment #8809277 -
Flags: review?(bbouvier) → review+
Comment 7•8 years ago
|
||
Comment on attachment 8809277 [details] [diff] [review] instantiate Review of attachment 8809277 [details] [diff] [review]: ----------------------------------------------------------------- (oops, so used to r+ your patches...)
Attachment #8809277 -
Flags: review+
Comment 8•8 years ago
|
||
I assume this is P1, based on the fact that we want WebAssembly in FF52.
Priority: -- → P1
Assignee | ||
Comment 9•8 years ago
|
||
Phew, great catch!
Attachment #8809277 -
Attachment is obsolete: true
Attachment #8809432 -
Flags: review?(bbouvier)
Comment 10•8 years ago
|
||
Comment on attachment 8809432 [details] [diff] [review] instantiate Review of attachment 8809432 [details] [diff] [review]: ----------------------------------------------------------------- Great, thanks!
Attachment #8809432 -
Flags: review?(bbouvier) → review+
Comment 11•8 years ago
|
||
Pushed by lwagner@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/f290780813ad Baldr: add Module.{imports,exports} (r=bbouvier) https://hg.mozilla.org/integration/mozilla-inbound/rev/4b46d55b13bd Baldr: hoist CanUseExtraThreads promise logic (r=bbouvier) https://hg.mozilla.org/integration/mozilla-inbound/rev/bfd4da2301e5 Baldr: add WebAssembly.instantiate (r=bbouvier)
Comment 12•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f290780813ad https://hg.mozilla.org/mozilla-central/rev/4b46d55b13bd https://hg.mozilla.org/mozilla-central/rev/bfd4da2301e5
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in
before you can comment on or make changes to this bug.
Description
•