Skip to content
Snippets Groups Projects
Verified Commit e2d05e0a authored by Jon Coppeard's avatar Jon Coppeard Committed by ma1
Browse files

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

parent 76fd6391
Branches
No related tags found
No related merge requests found
......@@ -918,7 +918,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;
}
......@@ -939,7 +945,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