Closed Bug 1536905 Opened 4 years ago Closed 4 years ago

Put instantiation in separate task from get-imports during async instantiation

Categories

(Core :: JavaScript: WebAssembly, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: luke, Assigned: luke)

Details

Attachments

(3 files)

As described in:
https://github.com/WebAssembly/spec/pull/745
Technically, this is just an experiment to confirm that nothing breaks, which we'll report back to the issue. Because it's such a corner case, I expect nothing will so we don't have to gate it on anything.

The change ends up being pretty simple once the preparatory (and independently useful) refactorings are made. Thank goodness some prescient engineer properly factored OffThreadPromiseTask so that it could be easily reused for "queueing a task".

This patch doesn't change behavior; it just splits out the compile and
instantiate paths so that the latter can be updated in a later patch.
This splitting also slightly simplifies the code. The bits of duplication
introduced here are refactored in the next patch.

This patch is also pure refactoring, replacing the N Rooted<GCVector>s with
one ImportValues struct that can be Rooted once and then passed around. This
reduces existing duplication and also simplifies the next patch.

Depends on D24241

Having this OffThreadPromiseTask in place may also be useful one day if we want
to do any non-trivial instantiation-time codegen (say of Web IDL Bindings stubs...).

Depends on D24242

Nice factoring...

Pushed by lwagner@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fb3b6f13c0a3
Baldr: split Resolve() into ResolveCompile() and AsyncInstance() (r=lth)
https://hg.mozilla.org/integration/mozilla-inbound/rev/00526b3f47ae
Baldr: factor out ImportValues struct (r=lth)
https://hg.mozilla.org/integration/mozilla-inbound/rev/4a546c424e47
Baldr: do instantiation in a separate task from the getting of imports (r=lth)
Assignee: nobody → luke
You need to log in before you can comment on or make changes to this bug.