Open Bug 1316817 Opened 3 years ago Updated 4 months ago

Wasm baseline: Avoid a full sync to cope with a setLocal to a local on the value stack (investigation)


(Core :: Javascript: WebAssembly, task, P5)






(Reporter: lth, Unassigned)


(Blocks 1 open bug)


Currently, a setLocal/teeLocal that affects a local for which there is a latent getLocal on the value stack causes a full sync(); see hasLocal() and syncLocal().

We can clearly do better: at the point of the setLocal, instead of doing a sync we can instead load the value from the local and install it in the value stack.

It's not obvious that this will be difficult, and if it is not we should probably just do it, as it will reduce the frequency of sync() and can only lead to better code.  If it turns out to be difficult we will need benchmark data to drive a decision.
Currently this is an absolutely negligible concern, causing 575 syncs when compiling Angrybots (out of almost 400K).  We might revisit later.

Stats from a run of AngryBots today (see bug 1316818 for some code that generates this and explanation):

[Profiling] WASM BASELINE SYNC: total=377856 capacity=7 specific=10521 local=575 join=181835 call=184918
Priority: P3 → P5
Per policy at If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Closed: Last year
Resolution: --- → INACTIVE
Resolution: INACTIVE → ---
Component: JavaScript Engine: JIT → Javascript: Web Assembly
Type: defect → task
You need to log in before you can comment on or make changes to this bug.