Add IsMapObject and IsSetObject intrinsic for self-hosted code

RESOLVED FIXED in Firefox 56

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: anba, Assigned: anba)

Tracking

Trunk
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment)

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!
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: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.