Closed Bug 1587096 Opened 6 months ago Closed 5 months ago

Implement FinalizationGroup objects in the shell

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

As part of bug 1561074, implement FinalizationGroup objects.

Assignee: nobody → jcoppeard

Depends on D49944

Attachment #9103009 - Attachment description: Bug 1587096 - WIP: Part 1 - Add JS FinalizationGroup class → Bug 1587096 - Part 1 - Add JS FinalizationGroupObject and related data structures r?sfink
Attachment #9103010 - Attachment description: Bug 1587096: WIP: Part 2 - Add GC data structures → Bug 1587096: Part 2 - Add an API to set the HostCleanupFinalizationGroup callback r?sfink
Attachment #9103013 - Attachment description: Bug 1587096 - WIP: Part 3 - Main implementation → Bug 1587096 - Part 3: Implmement FinalizationGroup r?sfink
Attachment #9103014 - Attachment description: Bug 1587096 - WIP: Part 4 - Support FinlalizationGroups in the shell and add tests → Bug 1587096 - Part 4 - Support FinlalizationGroups in the shell and add tests r?sfink
Summary: Implement FinalizationGroup objects → Implement FinalizationGroup objects in the shell
Attachment #9103009 - Attachment description: Bug 1587096 - Part 1 - Add JS FinalizationGroupObject and related data structures r?sfink → Bug 1587096 - Part 1: Add JS FinalizationGroupObject and related data structures r?sfink
Attachment #9103010 - Attachment description: Bug 1587096: Part 2 - Add an API to set the HostCleanupFinalizationGroup callback r?sfink → Bug 1587096 - Part 2: Add an API to set the HostCleanupFinalizationGroup callback r?sfink
Attachment #9103014 - Attachment description: Bug 1587096 - Part 4 - Support FinlalizationGroups in the shell and add tests r?sfink → Bug 1587096 - Part 4: Support FinlalizationGroups in the shell and add tests r?sfink
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e609f97c413
Part 1: Add JS FinalizationGroupObject and related data structures r=sfink
https://hg.mozilla.org/integration/autoland/rev/cefc0474e13c
Part 2: Add an API to set the HostCleanupFinalizationGroup callback r=sfink
https://hg.mozilla.org/integration/autoland/rev/b1117df3b91d
Part 3: Implmement FinalizationGroup r=sfink
https://hg.mozilla.org/integration/autoland/rev/ff865fdb64c3
Part 4: Support FinlalizationGroups in the shell and add tests r=sfink
Regressions: 1594061
Regressions: 1600238

Found a problem with the behavior of unregister. Opened Bug 1600488

Found another small quirk in jsshell, but I wouldn't call it a bug.

The FinalizationGroup cleanup callback may create new jobs, e.g. resolving a promise.
I would expect that if calling drainJobQueue() triggers the CleanupFinalizationGroup job, then it would drain any resulting new microtasks.

It's probably a matter of calling js::RunJobs a second time after MaybeRunFinalizationGroupCleanupTasks in RunShellJobs.

Regressions: 1602741

(In reply to Mathieu Hofman from comment #8)

Found another small quirk in jsshell, but I wouldn't call it a bug.

Thanks, that sounds close enough to me. Filed bug 1602741.

You need to log in before you can comment on or make changes to this bug.