Use NameToId instead of AtomToId for known property names

RESOLVED FIXED in Firefox 57

Status

()

Core
JavaScript Engine
RESOLVED FIXED
10 months ago
10 months ago

People

(Reporter: anba, Assigned: anba)

Tracking

unspecified
mozilla57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

10 months ago
This avoids the extra indexed property check in AtomToId.

Comment 1

10 months ago
Could we catch this at compile time, passing PropertyName* to AtomToId? Maybe with a template + static_assert?
(Assignee)

Comment 2

10 months ago
Created attachment 8905951 [details] [diff] [review]
bug1398113.patch

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 3

10 months ago
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+

Comment 5

10 months ago
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
Last Resolved: 10 months ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.