Support FinalizationGroup objects in the browser
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Following on from bug 1587096, add browser support for FinalizationGroup object.s
Assignee | ||
Comment 1•5 years ago
|
||
Add browser support for FinalizationGroup by setting the HostCleanupFinalizationGroupCallback in CycleCollectedJSContext. The callback adds groups pending cleanup to a vector stored in a PersistentRooted. A runnable is dispatched to call back into the JS engine and perform cleanup at a later time as a separate task. Using AutoEntryScript reports errors to the console.
I've tested this manually with test262 tests, which are currently not enabled in CI for this feature.
Assignee | ||
Comment 2•5 years ago
|
||
These are mochitests because there's currently no way to trigger a GC from WPT. I tried to do this with xpcshell tests but I couldn't get the pref to enable weak refs to work.
Depends on D53248
Updated•5 years ago
|
Comment 4•5 years ago
|
||
Backed out 4 changesets (Bug 1596756, Bug 1593698, Bug 1608069) for causing mochitest leakchecks.
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=284440348&repo=autoland&lineNumber=3619
[task 2020-01-10T19:06:19.706Z] 19:06:19 INFO - TEST-PASS | leakcheck | tab no leaks detected!
[task 2020-01-10T19:06:19.706Z] 19:06:19 INFO - leakcheck | Processing leak log file /tmp/tmpqrzFWB.mozrunner/runtests_leaks_tab_pid1656.log
[task 2020-01-10T19:06:19.707Z] 19:06:19 INFO -
[task 2020-01-10T19:06:19.707Z] 19:06:19 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1656
[task 2020-01-10T19:06:19.708Z] 19:06:19 INFO -
[task 2020-01-10T19:06:19.708Z] 19:06:19 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
[task 2020-01-10T19:06:19.709Z] 19:06:19 INFO - | | Per-Inst Leaked| Total Rem|
[task 2020-01-10T19:06:19.709Z] 19:06:19 INFO - 0 |TOTAL | 34 16| 4438547 1|
[task 2020-01-10T19:06:19.710Z] 19:06:19 INFO - 305 |JS Object | 16 16| 1 1|
[task 2020-01-10T19:06:19.712Z] 19:06:19 INFO -
[task 2020-01-10T19:06:19.713Z] 19:06:19 INFO - nsTraceRefcnt::DumpStatistics: 1264 entries
[task 2020-01-10T19:06:19.713Z] 19:06:19 INFO - TEST-INFO | leakcheck | tab leaked 1 JS Object
[task 2020-01-10T19:06:19.713Z] 19:06:19 INFO - TEST-UNEXPECTED-FAIL | leakcheck | tab 16 bytes leaked (JS Object)
[task 2020-01-10T19:06:19.713Z] 19:06:19 INFO -
[task 2020-01-10T19:06:19.713Z] 19:06:19 INFO - runtests.py | Running tests: end.
[task 2020-01-10T19:06:19.735Z] 19:06:19 INFO - Buffered messages finished
[task 2020-01-10T19:06:19.735Z] 19:06:19 INFO - Running manifest: layout/base/tests/mochitest.ini
[task 2020-01-10T19:06:19.736Z] 19:06:19 INFO - The following extra prefs will be set:
[task 2020-01-10T19:06:19.736Z] 19:06:19 INFO - plugin.load_flash_only=false
[task 2020-01-10T19:06:19.756Z] 19:06:19 INFO - Setting pipeline to PAUSED ...
[task 2020-01-10T19:06:19.757Z] 19:06:19 INFO - Pipeline is PREROLLING ...
[task 2020-01-10T19:06:19.757Z] 19:06:19 INFO - Pipeline is PREROLLED ...
[task 2020-01-10T19:06:19.757Z] 19:06:19 INFO - Setting pipeline to PLAYING ...
[task 2020-01-10T19:06:19.757Z] 19:06:19 INFO - New clock: GstSystemClock
[task 2020-01-10T19:06:19.793Z] 19:06:19 INFO - Got EOS from element "pipeline0".
[task 2020-01-10T19:06:19.793Z] 19:06:19 INFO - Execution ended after 33393731 ns.
[task 2020-01-10T19:06:19.793Z] 19:06:19 INFO - Setting pipeline to PAUSED ...
[task 2020-01-10T19:06:19.793Z] 19:06:19 INFO - Setting pipeline to READY ...
[task 2020-01-10T19:06:19.793Z] 19:06:19 INFO - Setting pipeline to NULL ...
[task 2020-01-10T19:06:19.793Z] 19:06:19 INFO - Freeing pipeline ...
[task 2020-01-10T19:06:20.101Z] 19:06:20 INFO - pk12util: PKCS12 IMPORT SUCCESSFUL
Assignee | ||
Comment 5•5 years ago
|
||
It doesn't make sense to queue callbacks at this point because they will never run, and without this we get leaks at shutdown. I also refactored GCRuntime::sweepFinalizationGroups a little.
Comment 7•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cad0b62c6074
https://hg.mozilla.org/mozilla-central/rev/9db35ebe3759
https://hg.mozilla.org/mozilla-central/rev/c71d1ca78e2d
Assignee | ||
Updated•5 years ago
|
Description
•