Lots of bailouts when showing suggestions in the awesomebar
Categories
(Core :: JavaScript Engine: JIT, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: florian, Assigned: jandem)
References
Details
Attachments
(1 file)
A profile shared in bug 1579334 shows lots of 'Bailout' markers while running code that displays suggestions in the awesomebar. This feels like a bug. I'm not sure if it's a JS engine bug or a bug in the way the front-end code is implemented, but I'm hoping someone here can clarify what's happening. See this profile: https://perfht.ml/2W1sbRR
Comment 1•5 years ago
|
||
The bailouts happen in this line when evaluating the template string expression. Template strings use the jsop_tostring
byte code op, which Ion compiles to MToString
. MToString
is lowered to LValueToString
, which always bails out for objects.
As a workaround "UrlbarMuxerUnifiedComplete.jsm" could be changed to use
logger.debug(`Buckets: ${String(buckets)}`);
or if buckets
is known to be an array with a toString
method (this option should be faster than calling String
):
logger.debug(`Buckets: ${buckets.toString()}`);
Comment 2•5 years ago
|
||
(In reply to Florian Quèze [:florian] from comment #0)
This feels like a bug. I'm not sure if it's a JS engine bug [...]
Yes, repeated bailouts are generally considered a JS engine bug.
Assignee | ||
Updated•5 years ago
|
Comment 3•5 years ago
|
||
(In reply to André Bargull [:anba] from comment #1)
or if
buckets
is known to be an array with atoString
method (this option should be faster than callingString
):
yes, buckets should always be an Array.
Assignee | ||
Comment 4•5 years ago
|
||
In these stand-alone cases we can handle objects/symbols by calling ToStringSlow.
The TypePolicy uses of MToString will still bail out to Baseline.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/45d661faa404 Avoid repeated bailouts when MToString is used for jsop_tostring or the ToString intrinsic. r=anba
Comment 7•5 years ago
|
||
bugherder |
Description
•