Closed Bug 1969269 Opened 3 months ago Closed 3 months ago

Inline string character access built-ins when no arguments are passed

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

JSC recently added this optimisation: https://github.com/WebKit/WebKit/commit/b6c35f4cd18125c7d3acb54ace62b9d74a67a45c

It looks like V8 already optimises for this pattern. Note that str.charAt(null), str.charAt(undefined), or str.charAt(NaN) aren't optimised in JSC and V8, so we don't have to worry about optimising for this case.

str.charAt() is sometimes used as a shorthand for str.charAt(0). The same
applies to str.charCodeAt(), str.codePointAt(), and str.at().

Pushed by andre.bargull@gmail.com: https://github.com/mozilla-firefox/firefox/commit/38ee6a959828 https://hg.mozilla.org/integration/autoland/rev/c73094ad1da9 Support inlining String character built-ins when index argument is absent. r=jandem
Blocks: sm-jits
Severity: -- → N/A
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
Assignee: andrebargull → nobody
QA Whiteboard: [qa-triage-done-c142/b141]
Assignee: nobody → andrebargull
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: