Closed
Bug 1874373
Opened 2 years ago
Closed 2 years ago
Mark String.prototype.{codePointAt,at} and StringIterator.prototype.next as always inlinable
Categories
(Core :: JavaScript Engine: JIT, enhancement, P1)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
124 Branch
| Tracking | Status | |
|---|---|---|
| firefox124 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(3 files, 1 obsolete file)
String.prototype.codePointAtandString.prototype.atare slightly too large to be inlinable, so they're noticeably slower when compared toString.prototype.charCodeAtresp.String.prototype.charAt.StringIteratorNextis also too large to be inlined by default, which means scalar replacement of the iterator and the result object doesn't work.
| Assignee | ||
Comment 1•2 years ago
|
||
String.prototype.codePointAtandString.prototype.atare slightly too large
to be inlinable, so they're noticeably slower when compared to
String.prototype.charCodeAtresp.String.prototype.charAt.StringIteratorNextis also too large to be inlined by default, which means
scalar replacement of the iterator and the result object doesn't work.
| Assignee | ||
Comment 2•2 years ago
|
||
Reorder the operations to match js::unicode::UTF16Decode, which allows the
frontend to constant fold the right most operand into a single constant. This
also saves two subtractions:
(first - 0xd800) * 0x400 + (second - 0xdc00) + 0x10000
= (first * 0x400) - (0xd800 * 0x400) + (second - 0xdc00) + 0x10000
= (first * 0x400) + second - (0xd800 * 0x400) - 0xdc00 + 0x10000
= (first << 10) + second + (0x10000 - (0xd800 << 10) - 0xdc00)
Depends on D198360
Updated•2 years ago
|
Severity: -- → N/A
Priority: -- → P1
Updated•2 years ago
|
Attachment #9372438 -
Attachment is obsolete: true
Updated•2 years ago
|
Attachment #9372437 -
Attachment description: Bug 1874373 - Part 1: Mark String.p.{codePointAt,at} and StringIterator.p.next as inlinable. r=jandem! → Bug 1874373 - Part 1: Mark StringIterator.p.next as inlinable. r=jandem!
| Assignee | ||
Comment 3•2 years ago
|
||
Directly call String.p.codePointAt instead of manually computing the code
point in StringIteratorNext.
Depends on D198360
| Assignee | ||
Comment 4•2 years ago
|
||
Directly call String.p.codePointAt instead of manually computing the code
point in AdvanceStringIndex. This also makes AdvanceStringIndex small
enough to be inlined by default.
Depends on D199350
Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/26beade9b70b
Part 1: Mark StringIterator.p.next as inlinable. r=jandem
https://hg.mozilla.org/integration/autoland/rev/43b98212a7d0
Part 2: Call String.p.codePointAt in StringIteratorNext. r=jandem
https://hg.mozilla.org/integration/autoland/rev/e48b625ffa25
Part 3: Call String.p.codePointAt in AdvanceStringIndex. r=jandem
Comment 6•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/26beade9b70b
https://hg.mozilla.org/mozilla-central/rev/43b98212a7d0
https://hg.mozilla.org/mozilla-central/rev/e48b625ffa25
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox124:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•