Closed Bug 1917516 Opened 3 months ago Closed 3 months ago

Improve generated code for PropertyKey::isAtom

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

We use both JS::PropertyKey::isAtom(JSAtom*) and NameToId(PropertyName*) == to compare property names against property key, but the latter actually produces better codegen. Change JS::PropertyKey::isAtom(JSAtom*) to allow producing the same assembly when compared to using NameToId.

Improves the generated code from:

xor     rsi, rdi
and     edi, 7
or      rsi, rdi
sete    al

to:

cmp     rsi, rdi
sete    al

Prefer NameToId per doc-comments for PropertyKey::NonIntAtom.

Drive-by change:

  • Remove unnecessary rooting in AddPrefix.
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/6e24c99504f6 Part 1: Allow better code generation for PropertyKey::isAtom. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/07da26c7d185 Part 2: Prefer NameToId over PropertyKey::NonIntAtom. r=spidermonkey-reviewers,jandem
Blocks: sm-jits
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: