Add test code for weak map gray marking behaviour

RESOLVED FIXED in Firefox 54

Status

()

Core
JavaScript: GC
RESOLVED FIXED
10 months ago
10 months ago

People

(Reporter: jonco, Assigned: jonco)

Tracking

unspecified
mozilla54
Points:
---

Firefox Tracking Flags

(firefox54 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

10 months ago
Created attachment 8837546 [details] [diff] [review]
test-weakmap-gray-marking

Here's a patch to add test code for weak map gray marking behaviour.

The rules are:
 - a value is marked black if both the map and the key are black
 - a value is marked gray if both the map and key are marked, but either or both are gray
 - a key is marked black if it has a black delegate and the map is black
 - a key is marked gray if both the map and delegate are marked, but either or both are gray
Attachment #8837546 - Flags: review?(sphink)
(Assignee)

Comment 1

10 months ago
Created attachment 8837564 [details] [diff] [review]
test-ccw-gray-unmarking

This is probably a bit paranoid, but check that we unmark gray CCWs when we look them up in different situations.
Attachment #8837564 - Flags: review?(sphink)
One thing that might be nice would be some kind of generic template with the bits of weak map logic that we could reuse rather than having at least 3 copies of the logic scattered around.
Comment on attachment 8837546 [details] [diff] [review]
test-weakmap-gray-marking

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

That's very straightforward and nice.
Attachment #8837546 - Flags: review?(sphink) → review+

Updated

10 months ago
Attachment #8837564 - Flags: review?(sphink) → review+

Comment 4

10 months ago
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/208a7d1895d7
Add jsapi tests for weak map gray marking r=sfink
https://hg.mozilla.org/integration/mozilla-inbound/rev/9c921aea9d8e
Add tests for gray marking of CCWs r=sfink

Comment 5

10 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/208a7d1895d7
https://hg.mozilla.org/mozilla-central/rev/9c921aea9d8e
Status: NEW → RESOLVED
Last Resolved: 10 months ago
status-firefox54: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.