Closed Bug 1986862 Opened 1 year ago Closed 1 year ago

Refactor FinalizationRegistry implementation by removing global record set

Categories

(Core :: JavaScript: GC, task)

task

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox144 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 external file)

Following on from recent work in bug 1984091 we can simplify the FinalizationRegistry implementation by removing the set of finalization records associated with each global.

Depends on: 1984091

This simplifies the finalization registry implementation by removing
FinalizationRegistryGlobalData, a data structure that currently holds a set of
all registered FinalizationRecordObjects for each global. This is replaced with
a vector held by the finalization registy itself.

This means that the records are held alive by the registry they are registered
with. This simplifies sweeping because we don't need to check for unregistered
records as we now remove them when they are unregistered.

I updated the diagram of how this all works, which previously didn't include
the global data. I also updated the comments here which I missed in bug
1984091.

This has also restore the original behaviour of test gc/bug-1825936.js which
now no longer catches an error thrown in a separate global after nuking CCWs. I
don't exactly understand this but since this was the original behaviour before
the recent changes I assume it's OK.

Summary: Refactor FinalizationRegistry implemenation by removing global record set → Refactor FinalizationRegistry implementation by removing global record set
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/812f04c365aa https://hg.mozilla.org/integration/autoland/rev/af5d86afcfd7 Revert "Bug 1986862 - Refactor finalization registries to remove global data r=sfink" for causing dt assertion failures @ gray marking
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
Flags: needinfo?(jcoppeard)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: