Update js::StaticStrings optimization to support $, _
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(1 file)
In the js::StaticStrings
optimization, we fast-path length-2 strings whose characters are matched by this. This covers the usual alpha-numeric ASCII set and also [
and ~
. In JS the rule for identifiers allows $
and _
and minifiers use this. We should change the the set of small-chars to match this. The lookup during atomization is table-based so this change does not have an impact on lookup complexity.
For example, on the cadmium_core bundle that Netflix loads, this change fast-paths 3000 atomize calls in the parser.
Assignee | ||
Comment 1•5 years ago
|
||
The $
and _
characters are legal JS identifiers and can show up a fair
bit in large minified code-bases. This changes the {to,from}SmallChar which
is used during StaticStrings::init
. We already use a table-based lookup
while atomizing so there isn't additional perf cost during atomization.
Comment 3•5 years ago
|
||
Backed out for valgrind bustages about ParserAtom.cpp.
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=315868064&repo=autoland&lineNumber=66784
Backout link: https://hg.mozilla.org/integration/autoland/rev/b2d8201169eaddec051abaae7685656b2bd2a3fb
Comment 6•5 years ago
|
||
bugherder |
Description
•