Wasm baseline: Avoid a sync() to free a specific register when a same-type register is available

NEW
Unassigned

Status

()

Core
JavaScript Engine: JIT
P5
normal
2 years ago
a year ago

People

(Reporter: lth, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
The specific-register allocator (the needI32(r), needI64(r) etc methods) can avoid syncing the value stack if the specific register is in use but there is a free register of the correct type to shuffle the specific register into.  (Doing so will also improve the generated code.)

The sync happens often enough to show up in profiles, because it is triggered by integer multiply and divide on x86-class systems, and reducing sync() cost is probably the most important optimization to compile time we can do inside the compiler.
(Reporter)

Updated

2 years ago
Summary: Wasm baseline: Reduce sync() costs → Wasm baseline: Avoid a sync() to free a specific register when a same-type register is available
(Reporter)

Comment 1

2 years ago
This problem accounts for a small number of the syncs: on AngryBots, 10K out of 380K syncs.  That's not negligble but we should address other concerns first:

Data from a run today on AngryBots, see bug 1316818 for some code and an explanation:

[Profiling] WASM BASELINE SYNC: total=377856 capacity=7 specific=10521 local=575 join=181835 call=184918
(Reporter)

Updated

2 years ago
Priority: P3 → P5
You need to log in before you can comment on or make changes to this bug.