Rare input argument types cause us to generate pessimistic code
Categories
(Core :: JavaScript Engine: JIT, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox63 | --- | wontfix |
firefox64 | --- | wontfix |
firefox65 | --- | fix-optional |
People
(Reporter: pbone, Unassigned)
References
(Blocks 1 open bug, )
Details
Updated•7 years ago
|
![]() |
||
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment 8•7 years ago
|
||
Reporter | ||
Comment 9•7 years ago
|
||
Updated•7 years ago
|
Updated•3 years ago
|
Comment 10•1 year ago
|
||
I got consistent numbers each time I run this : https://share.firefox.dev/45rj5By
Bug 1375495 is resolved as WORKSFORSOME.
:pbone , :iain : is there anything more to do here?
Comment 11•1 year ago
|
||
With WarpBuilder, this testcase ends up compiling an IonScript that only handles Int32 arguments to fib
, and bailing out on a string input. The first 9 bailouts are ignored. Once numFixableBailouts hits 10, we invalidate and recompile with slightly worse code. The cliff is smaller than before (~1200 -> 1450 instead of 400 -> 900), although it might be because we're generating slightly worse code in the fast case than we did with IonBuilder.
In some cases, trial inlining could deal with this kind of pattern. That's basically equivalent to the solution proposed in bug 1375495. In this particular case, we don't inline because the function is recursive.
The reason the pessimized codegen feels bad here is that we only need it in a tiny fraction of the invocations of fib
. Right now we have a static threshold for the number of bailouts before invalidating. If we could scale that threshold to be a fraction of the overall invocations, we could avoid this problem, at the cost of having to track the total number of invocations for Ion functions. It's not obvious to me that this problem is common enough to justify the overhead.
Description
•