Closed Bug 1536905 Opened 4 years ago Closed 4 years ago

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


(Core :: JavaScript: WebAssembly, enhancement)

Not set



Tracking Status
firefox68 --- fixed


(Reporter: luke, Assigned: luke)



(3 files)

As described in:
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
Baldr: split Resolve() into ResolveCompile() and AsyncInstance() (r=lth)
Baldr: factor out ImportValues struct (r=lth)
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.