Closed Bug 1629796 Opened 2 years ago Closed 2 years ago

Replace finalization iterator with multiple callback calls

Categories

(Core :: JavaScript: GC, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

Implement the spec changes from https://github.com/tc39/proposal-weakrefs/pull/187.

Implements the spec changes from: https://github.com/tc39/proposal-weakrefs/pull/187

The spec change removes the FinalizationRegistryCleanupIterator in favour of
calling the clean-up callback for each finalised value. It also allows to call
cleanupSome() within the callback function.

FinalizationRegistryObject::cleanupQueuedRecords() has been changed to iterate
from back to front, because this allows us to call GCVector::popCopy(), which
makes it more efficient to remove entries from the records vector.

Depends on D70820

Priority: -- → P1

Hi Jon, just a quick NI, because I'm not sure if you've seen my response to https://phabricator.services.mozilla.com/D70821#inline-416401.

Flags: needinfo?(jcoppeard)

Replied on phabricator. Sorry for the delay.

Flags: needinfo?(jcoppeard)
Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c0c9d8211967
Replace finalization iterator with multiple callback calls. r=jonco

Backed out for mochitest failures on test_finalizationRegistry.html

backout: https://hg.mozilla.org/integration/autoland/rev/1e2ce9981292d4160a966f4aa4c54be5a155e136

push: Failures have appeared on a subsequent push: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&selectedTaskRun=Z4Lehi9MSPu4oognz6Pv2w-0&revision=d6525047e9415413285449e849c06c6630f1e53c&searchStr=mochitest-plain

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=302106694&repo=autoland&lineNumber=7692

[task 2020-05-13T13:24:04.104Z] 13:24:04 INFO - TEST-PASS | js/xpconnect/tests/mochitest/test_finalizationRegistry.html | undefined assertion name
[task 2020-05-13T13:24:04.104Z] 13:24:04 INFO - TEST-PASS | js/xpconnect/tests/mochitest/test_finalizationRegistry.html | undefined assertion name
[task 2020-05-13T13:24:04.104Z] 13:24:04 INFO - Buffered messages finished
[task 2020-05-13T13:24:04.104Z] 13:24:04 INFO - TEST-UNEXPECTED-FAIL | js/xpconnect/tests/mochitest/test_finalizationRegistry.html | uncaught exception - TypeError: i is not iterable at go/registry2<@http://mochi.test:8888/tests/js/xpconnect/tests/mochitest/test_finalizationRegistry.html:19:68
[task 2020-05-13T13:24:04.104Z] 13:24:04 INFO -
[task 2020-05-13T13:24:04.104Z] 13:24:04 INFO - simpletestOnerror@SimpleTest/SimpleTest.js:1950:18
[task 2020-05-13T13:24:04.104Z] 13:24:04 INFO - OnErrorEventHandlerNonNull*@SimpleTest/SimpleTest.js:1925:1
[task 2020-05-13T13:24:04.104Z] 13:24:04 INFO - GECKO(4477) | JavaScript error: http://mochi.test:8888/tests/js/xpconnect/tests/mochi

Flags: needinfo?(andrebargull)

Sorry about that, I didn't see that there are also mochi-tests which need to be updated to match the new API.

Flags: needinfo?(andrebargull)
Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cd6d298b0d89
Replace finalization iterator with multiple callback calls. r=jonco
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.