Skip to content

Commit

Permalink
Bug 1141563 - Don't update Shapes in parallel after compacting GC
Browse files Browse the repository at this point in the history
  • Loading branch information
rmottola committed Jul 11, 2019
1 parent f486501 commit 098af79
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions js/src/jsgc.cpp
Expand Up @@ -2398,6 +2398,8 @@ struct ArenasToUpdate
bool ArenasToUpdate::shouldProcessKind(AllocKind kind)
{
MOZ_ASSERT(kind < AllocKind::LIMIT);

// GC things that do not contain JSObject pointers don't need updating.
if (kind == AllocKind::FAT_INLINE_STRING ||
kind == AllocKind::STRING ||
kind == AllocKind::EXTERNAL_STRING ||
Expand All @@ -2406,10 +2408,19 @@ bool ArenasToUpdate::shouldProcessKind(AllocKind kind)
return false;
}

if (js::gc::IsBackgroundFinalized(kind))
// We try to update as many GC things in parallel as we can, but there are
// kinds for which this might not be safe:
// - we assume JSObjects that are foreground finalized are not safe to
// update in parallel
// - updating a shape touches child shapes in fixupShapeTreeAfterMovingGC()
if (js::gc::IsBackgroundFinalized(kind) &&
kind != AllocKind::SHAPE &&
kind != AllocKind::ACCESSOR_SHAPE)
{
return (kinds & BACKGROUND) != 0;
else
} else {
return (kinds & FOREGROUND) != 0;
}
}

ArenasToUpdate::ArenasToUpdate(JSRuntime *rt, KindsToUpdate kinds)
Expand Down

0 comments on commit 098af79

Please sign in to comment.