Closed Bug 1380087 Opened 7 years ago Closed 7 years ago

Add IsMapObject and IsSetObject intrinsic for self-hosted code

Categories

(Core :: JavaScript: Standard Library, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

So we don't need to call Map|Set.prototype.has within a try-catch block.


Improves this µ-benchmark from 270ms to ~160ms (*) for me:

    var s = new Set(Array(100).fill(0).map((v, k) => k + 1));
    var q = 0;
    function fn() { ++q; }
    var t = Date.now();
    for (var i = 0; i < 100000; ++i) {
        s.forEach(fn);
    }
    print(Date.now() - t, q);


(*) Interestingly I also get ~160ms when testing with v8/jsc/chakra!
Attached patch bug1380087.patchSplinter Review
Attachment #8885399 - Flags: review?(till)
Comment on attachment 8885399 [details] [diff] [review]
bug1380087.patch

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

Huh, I had forgotten about these ugly hacks :( Thank you for fixing them.
Attachment #8885399 - Flags: review?(till) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/4e27c8cad5d1
Add an intrinsic to test for Map and Set objects. r=till
Keywords: checkin-needed
Backout by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/812f0d47226f
Backed out changeset 4e27c8cad5d1
The latests try (https://treeherder.mozilla.org/#/jobs?repo=try&revision=baaf2d8b31d38b5fc5d32fdec94dc884673bc770) didn't show any failures in test_available_free_space.js, so I guess it's one of these known intermittent bugs (bug 1368219, bug 1380607, bug 1378088), therefore requesting checkin-needed again.
Flags: needinfo?(andrebargull)
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8ff407adc162
Add an intrinsic to test for Map and Set objects. r=till
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8ff407adc162
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: