Skip to content
Snippets Groups Projects
Verified Commit c5ac1a5f 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 81867153
No related branches found
No related tags found
No related merge requests found
......@@ -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 register or to comment