WeakRefs and FinalizationRegistries use CCWs that don't work with symbol targets
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox144 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(3 external files)
Currently our implementation for these wraps the WeakRef/FinalizationRegistry object into the target zone. That doesn't work for symbol targets as the target zone is the atoms zone and we don't support allocating CCWs (or any object) in the atoms zone.
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
Elements are added to these list on the main thread and removed by foreground
finalizers (also main thread). The elements will be WeakRefObjects and
FinalizationRecordObjcts (referred to as finalization observers).
Using this list removes the need to use cross compartment wrappers to refer to
these observers which is a problem because we can't create wrappers in the
atoms zone, where symbol targets live.
It also removes the need to have observers and targets in the same sweep group
which makes incremental sweeping less effective.
Finally it removes the overhead of allocating these extra wrapper objects.
| Assignee | ||
Comment 2•1 year ago
|
||
This removes wrapper creation, updating the cross-zone wrapper map for weak
refs and handling nuking of the wrappers.
| Assignee | ||
Comment 3•1 year ago
|
||
One effect of this change is to make this test code throw an exception when it
didn't before. I think what's happening is that nuking CCWs previously stopped
the finalization registry from calling the cleanup callback, whereas now this
happens and an exception is correctly thrown. This doesn't have any effect on
the original purpose of the testcase which was to trigger an over-eager
assertion, or correctness of the finalization regisry implementation.
Comment 5•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/3cb12b48b1c5
https://hg.mozilla.org/mozilla-central/rev/72fcb6edb68a
https://hg.mozilla.org/mozilla-central/rev/064fe5443ae5
https://hg.mozilla.org/mozilla-central/rev/70117386c757
| Assignee | ||
Comment 7•1 year ago
|
||
This bug is preparatory work. The actual change is in bug 1863140, and will be preffed off to start with. But thanks for reminding me, I will send an intent to ship before turning this on.
| Assignee | ||
Updated•9 months ago
|
Description
•