Move allocation site creation to trial inlining
Categories
(Core :: JavaScript Engine: JIT, task, P2)
Tracking
()
People
(Reporter: iain, Unassigned)
References
(Blocks 1 open bug)
Details
We don't create allocation sites for IC stubs attached in blinterp. Instead, when we use a default allocation site. Then, when we baseline compile a script, we walk its IC chains and create real allocation sites.
Offthread baseline compilation will make the timing of baseline compilation less predictable. If thread scheduling hiccups, we might not finish our baseline compilation until shortly before Ion compilation. In bug 1960433, we already dealt with this problem for trial inlining by making it possible to trial inline while running in blinterp, which should ensure that we do trial inlining early-ish, well before Ion compilation. That's the same guarantee we would like for allocation site rewriting, and trial inlining is already walking the ICs for a given script, so we should consider moving the allocation site code inside trial inlining.
Comment 1•1 year ago
|
||
(In reply to Iain Ireland [:iain] from comment #0)
When does trial inlining occur relative to starting baseline compilation these days?
| Reporter | ||
Comment 2•1 year ago
|
||
Right now the default warmup threshold for baseline compilation is 100, and the trial inlining threshold is 500.
We haven't done the tuning to find good thresholds for offthread baseline compilation yet. In general, baseline compilation should always start before trial inlining, but might not finish. Right now we do the alloc site updates in finishCompile. I guess we could also move it to PrepareToCompile?
Comment 3•1 year ago
|
||
Moving allocation site creation later is potentially going to reduce the effectiveness of pretenuring and increase the number of invalidations when we discover we got the decision wrong after we've Ion compiled the script. I don't know how much difference this is going to make in practice though. Nursery sizes are petty large these days so we may be hitting this already.
Description
•