WeakRefs don't work with cross-zone targets
Categories
(Core :: JavaScript: GC, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox99 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(4 files)
When investigating optimising the way we implement the kept objects set used by WeakRefs, I noticed they didn't work at all when their target is in another zone. Doing this results in the WeakRef returning undfined from the deref() method after GC, even if the target is still alive.
I don't know how often these are used with cross-zone targets or how to arrange this in the browser but I assume it's possible.
Updated•6 months ago
|
Assignee | ||
Comment 1•6 months ago
|
||
Assignee | ||
Comment 2•6 months ago
|
||
This renames crossZoneWarppers to crossZoneRecordWrappers and makes
add/RemoveCrossZoneWarpper take the set as an argument.
Depends on D139835
Assignee | ||
Comment 3•6 months ago
|
||
This fixes weak ref behaviour with cross zone targets. Previously the wrapper
died because there was nothing to keep it alive and the weak ref target was
cleared, even if the target was still alive.
Depends on D139836
Assignee | ||
Comment 4•6 months ago
|
||
Depends on D139837
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/59ae32a4a0a3 Part 1: Factor out crossZoneWrappers checks and do them before we calculate sweep groups r=sfink https://hg.mozilla.org/integration/autoland/rev/8e7816b5ea2a Part 2: Refactor FinalizationObservers in preparation to add a weak set for weak refs r=sfink https://hg.mozilla.org/integration/autoland/rev/eac621ee0ea8 Part 3: Add cross-zone WeakRef wrappers to a weak set to keep them alive r=sfink https://hg.mozilla.org/integration/autoland/rev/2f4c3dcd4a8d Part 4: Add WeakRef tests where the weak ref and its target are in different zones r=sfink
Comment 6•6 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/59ae32a4a0a3
https://hg.mozilla.org/mozilla-central/rev/8e7816b5ea2a
https://hg.mozilla.org/mozilla-central/rev/eac621ee0ea8
https://hg.mozilla.org/mozilla-central/rev/2f4c3dcd4a8d
Description
•