Closed Bug 1590120 Opened 5 years ago Closed 5 years ago

Lots of bailouts when showing suggestions in the awesomebar

Categories

(Core :: JavaScript Engine: JIT, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla72
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

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()}`);

(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.

See Also: → 1579334
Flags: needinfo?(jdemooij)

(In reply to André Bargull [:anba] from comment #1)

or if buckets is known to be an array with a toString method (this option should be faster than calling String):

yes, buckets should always be an Array.

In these stand-alone cases we can handle objects/symbols by calling ToStringSlow.
The TypePolicy uses of MToString will still bail out to Baseline.

Flags: needinfo?(jdemooij)
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Priority: -- → P1
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
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: