Bug 1551813: Integrate compacting into tracing. r=jonco

Compartment::fixupAfterMovingGC is only used in compacting, so we could
pass MovingTracer into fixupAfterMovingGC and use the trace function.

Differential Revision: https://phabricator.services.mozilla.com/D39856

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Yoshi Cheng-Hao Huang 2019-07-30 09:44:26 +00:00
parent 32e32e8cea
commit 00d787d7a8
5 changed files with 11 additions and 11 deletions

View File

@ -3004,7 +3004,7 @@ void GCRuntime::updateZonePointersToRelocatedCells(Zone* zone) {
// Fixup compartment global pointers as these get accessed during marking.
for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next()) {
comp->fixupAfterMovingGC();
comp->fixupAfterMovingGC(&trc);
}
zone->externalStringCache().purge();

View File

@ -493,11 +493,11 @@ void Compartment::fixupCrossCompartmentWrappersAfterMovingGC(JSTracer* trc) {
}
}
void Compartment::fixupAfterMovingGC() {
void Compartment::fixupAfterMovingGC(JSTracer* trc) {
MOZ_ASSERT(zone()->isGCCompacting());
for (RealmsInCompartmentIter r(this); !r.done(); r.next()) {
r->fixupAfterMovingGC();
r->fixupAfterMovingGC(trc);
}
// Sweep the wrapper map to update values (wrapper objects) in this

View File

@ -652,7 +652,7 @@ class JS::Compartment {
void sweepCrossCompartmentWrappers();
static void fixupCrossCompartmentWrappersAfterMovingGC(JSTracer* trc);
void fixupAfterMovingGC();
void fixupAfterMovingGC(JSTracer* trc);
MOZ_MUST_USE bool findSweepGroupEdges();
};

View File

@ -475,11 +475,11 @@ void Realm::sweepTemplateObjects() {
}
}
void Realm::fixupAfterMovingGC() {
void Realm::fixupAfterMovingGC(JSTracer* trc) {
purge();
fixupGlobal();
objectGroups_.fixupTablesAfterMovingGC();
fixupScriptMapsAfterMovingGC();
fixupScriptMapsAfterMovingGC(trc);
}
void Realm::fixupGlobal() {
@ -489,15 +489,15 @@ void Realm::fixupGlobal() {
}
}
void Realm::fixupScriptMapsAfterMovingGC() {
void Realm::fixupScriptMapsAfterMovingGC(JSTracer* trc) {
// Map entries are removed by JSScript::finalize, but we need to update the
// script pointers here in case they are moved by the GC.
if (scriptCountsMap) {
for (ScriptCountsMap::Enum e(*scriptCountsMap); !e.empty(); e.popFront()) {
JSScript* script = e.front().key();
if (!IsAboutToBeFinalizedUnbarriered(&script) &&
script != e.front().key()) {
TraceManuallyBarrieredEdge(trc, &script, "Realm::scriptCountsMap::key");
if (script != e.front().key()) {
e.rekeyFront(script);
}
}

View File

@ -562,8 +562,8 @@ class JS::Realm : public JS::shadow::Realm {
void purge();
void fixupAfterMovingGC();
void fixupScriptMapsAfterMovingGC();
void fixupAfterMovingGC(JSTracer* trc);
void fixupScriptMapsAfterMovingGC(JSTracer* trc);
#ifdef JSGC_HASH_TABLE_CHECKS
void checkObjectGroupTablesAfterMovingGC() {