Compute LCov function name before finalization
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(2 files)
Currently we access script->functionNonDelazifying()->displayAtom() during finalization with code-coverage enabled. This is currently safe because we enforce GC ordering that JSScript is torn-down before js::Scope. In order to remove the dependency we should format the script name when run coverage::InitScriptCoverage instead of coverage::CollectScriptCoverage.
This will increase memory usage slightly running coverage to store the function name, but we recently removed the copy of filename() per-function that we were storing during coverage. The net impact should still be a memory savings versus a month ago.
Assignee | ||
Comment 1•5 years ago
|
||
An oversight I made here is that the displayAtom() isn't available when we call coverage::InitScriptCoverage. I'm considering handling this similarly to how I fixed off-thread recently in [1]. This would also get away from having to handle uncompleted scripts in coverage.
Assignee | ||
Comment 2•5 years ago
|
||
To allow InitScriptCoverage to be more flexible, we need to delay the call
until the JSScript is actually initialized. This moves the calls from
JSScript constructor until the JSScript is actually initialized. This is
similar to the debugger onNewScript call, but more cleanup would be needed to
unify these.
Depends on D51472
Assignee | ||
Comment 3•5 years ago
|
||
To avoid calling JSScript::function() from finalizer, we need to read the
name earlier in process.
Depends on D51473
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b3a76c2b11b3 Run InitScriptCoverage after initialization. r=jandem,nbp https://hg.mozilla.org/integration/autoland/rev/dfd48b94b745 Compute script name in InitScriptCoverage. r=nbp
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b3a76c2b11b3
https://hg.mozilla.org/mozilla-central/rev/dfd48b94b745
Description
•