Skip to content
Snippets Groups Projects
Commit 23d70bab authored by Jon Coppeard's avatar Jon Coppeard Committed by Pier Angelo Vendrame
Browse files

Bug 1904011 - Ignore finalized scripts when iterating code covarage tables r=iain

parent c5c98c2e
Branches
Tags
1 merge request!1462BB/TB 43584: Rebased stable again onto 128.9.0esr build2
......@@ -906,7 +906,13 @@ void Zone::clearScriptCounts(Realm* realm) {
// Clear all hasScriptCounts_ flags of BaseScript, in order to release all
// ScriptCounts entries of the given realm.
for (auto i = scriptCountsMap->modIter(); !i.done(); i.next()) {
BaseScript* script = i.get().key();
const HeapPtr<BaseScript*>& script = i.get().key();
if (IsAboutToBeFinalized(script)) {
// Dead scripts may be present during incremental GC until script
// finalizers have been run.
continue;
}
if (script->realm() != realm) {
continue;
}
......@@ -927,7 +933,13 @@ void Zone::clearScriptLCov(Realm* realm) {
}
for (auto i = scriptLCovMap->modIter(); !i.done(); i.next()) {
BaseScript* script = i.get().key();
const HeapPtr<BaseScript*>& script = i.get().key();
if (IsAboutToBeFinalized(script)) {
// Dead scripts may be present during incremental GC until script
// finalizers have been run.
continue;
}
if (script->realm() == realm) {
i.remove();
}
......
......
// |jit-test| --fuzzing-safe; --ion-offthread-compile=off
gczeal(0);
let g = newGlobal({newCompartment: true});
let dbg = new Debugger(g);
dbg.collectCoverageInfo = true;
g.eval("0");
// Start a GC in the debugger's zone and yield after sweeping objects.
schedulezone(g);
gczeal(22);
startgc(100);
dbg.collectCoverageInfo = false;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment