Closed Bug 1527563 Opened 5 years ago Closed 5 years ago

Remove defunct nested-call optimisation in WasmIonCompile.cpp

Categories

(Core :: JavaScript: WebAssembly, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: jseward, Assigned: jseward)

Details

Attachments

(2 files)

Translation of wasm into MIR is currently set up to handle multiple nested
function call instances simultaneously, using a stack of CallCompileState
records to keep track of the per-open-call state. This is an optimisation
intended to allow interleaved evaluation and pushing of stack-resident
outbound arguments. However, this was predicated on the assumption of
pre-order Wasm encoding, which is no longer valid -- encoding is post-order.

The compiler's operand (wasm) stack tracks MIR value nodes, which are by
definition already evaluated -- it doesn't track unevaluated expression trees.
Consequently, by the time we arrive at a wasm call instruction, we have to
hand the MIR nodes for all the arguments, so the possibility of evaluating
arguments whilst marshalling the arguments no longer exists.

Assignee: nobody → jseward
Attachment #9043550 - Flags: feedback?(luke)
Comment on attachment 9043550 [details] [diff] [review]
bug1527563-simplify-calls-1.diff

Review of attachment 9043550 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!  Nice to disentangle lineOrBytecode as well.

::: js/src/wasm/WasmIonCompile.cpp
@@ +71,5 @@
>    friend class FunctionCompiler;
>  
>   public:
> +  // JRS FIXME: why pass in |f| here?  Can this be rm'd?
> +  CallCompileState(FunctionCompiler& f) {}

Kill it; it was probably used to pluck out some field value at some time in the past.
Attachment #9043550 - Flags: feedback?(luke) → feedback+

This is the same as the previous version, but rebased to m-c current
and with the removal in comment 2 actioned.

Attachment #9043914 - Flags: review?(luke)
Comment on attachment 9043914 [details] [diff] [review]
bug1527563-simplify-calls-3.diff

Review of attachment 9043914 [details] [diff] [review]:
-----------------------------------------------------------------

Nice!
Attachment #9043914 - Flags: review?(luke) → review+
Pushed by jseward@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cd56d5e49b75
Remove defunct nested-call optimisation in WasmIonCompile.cpp.  r=luke.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: