Closed Bug 1398113 Opened 7 years ago Closed 7 years ago

Use NameToId instead of AtomToId for known property names

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

This avoids the extra indexed property check in AtomToId.
Could we catch this at compile time, passing PropertyName* to AtomToId? Maybe with a template + static_assert?
Attached patch bug1398113.patchSplinter Review
I think the easiest solution to detect this at compile-time is to delete |AtomToId(PropertyName*)|. Alternatively we could use templates with std::enable_if, std::is_convertible, and static_asserts, but that adds quite a bit of boilerplate.
Attachment #8905951 - Flags: review?(jdemooij)
Comment on attachment 8905951 [details] [diff] [review]
bug1398113.patch

Review of attachment 8905951 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, thanks! I thought |= delete| only worked for class methods :)
Attachment #8905951 - Flags: review?(jdemooij) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c871d215b63b
Use NameToId for known property names to avoid the indexed property check in AtomToId. r=jandem
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c871d215b63b
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: