Closed Bug 1405121 Opened 7 years ago Closed 7 years ago

Add a fast path for native objects to TestIntegrityLevel

Categories

(Core :: JavaScript: Standard Library, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

This makes Object.isFrozen/isSealed much faster, because we no longer need to collect all property ids.
Attached patch bug1405121.patchSplinter Review
TestIntegrityLevel can be improved for native objects when we directly iterate over all shapes instead of calling |GetPropertyKeys| + |GetOwnPropertyDescriptor|.  AFAICS we only need to first resolve lazy properties, have a special case for typed/dense elements, and then we can directly iterate over all shapes. 

Test262 doesn't have any tests for calling TestIntegrityLevel on typed arrays, so I've also added two test cases to cover TestIntegrityLevel on non-detached and on detached typed arrays.
Attachment #8914676 - Flags: review?(jdemooij)
Comment on attachment 8914676 [details] [diff] [review]
bug1405121.patch

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

Sweet.
Attachment #8914676 - Flags: review?(jdemooij) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c5c5b9eff4c0
Add fast path for native objects to TestIntegrityLevel. r=jandem
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c5c5b9eff4c0
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: