Commit 47d4ac12 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Make page promotion infrastructure aware of large objects.

Bug: chromium:852420
Change-Id: I869ee5d6b705da0dab3c78dfd01eff9aca469d01
Reviewed-on: https://chromium-review.googlesource.com/c/1354886
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57936}
parent 6c8b4102
...@@ -302,8 +302,7 @@ int MarkingVisitor<fixed_array_mode, retaining_path_mode, MarkingState>:: ...@@ -302,8 +302,7 @@ int MarkingVisitor<fixed_array_mode, retaining_path_mode, MarkingState>::
MemoryChunk* chunk = MemoryChunk::FromHeapObject(object); MemoryChunk* chunk = MemoryChunk::FromHeapObject(object);
int object_size = FixedArray::BodyDescriptor::SizeOf(map, object); int object_size = FixedArray::BodyDescriptor::SizeOf(map, object);
if (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) { if (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) {
DCHECK(!FLAG_use_marking_progress_bar || DCHECK(!FLAG_use_marking_progress_bar || heap_->IsLargeObject(object));
chunk->owner()->identity() == LO_SPACE);
// When using a progress bar for large fixed arrays, scan only a chunk of // When using a progress bar for large fixed arrays, scan only a chunk of
// the array and try to push it onto the marking deque again until it is // the array and try to push it onto the marking deque again until it is
// fully scanned. Fall back to scanning it through to the end in case this // fully scanned. Fall back to scanning it through to the end in case this
......
...@@ -1100,10 +1100,10 @@ class RecordMigratedSlotVisitor : public ObjectVisitor { ...@@ -1100,10 +1100,10 @@ class RecordMigratedSlotVisitor : public ObjectVisitor {
DCHECK_IMPLIES(p->InToSpace(), DCHECK_IMPLIES(p->InToSpace(),
p->IsFlagSet(Page::PAGE_NEW_NEW_PROMOTION)); p->IsFlagSet(Page::PAGE_NEW_NEW_PROMOTION));
RememberedSet<OLD_TO_NEW>::Insert<AccessMode::NON_ATOMIC>( RememberedSet<OLD_TO_NEW>::Insert<AccessMode::NON_ATOMIC>(
Page::FromAddress(slot), slot); MemoryChunk::FromHeapObject(host), slot);
} else if (p->IsEvacuationCandidate()) { } else if (p->IsEvacuationCandidate()) {
RememberedSet<OLD_TO_OLD>::Insert<AccessMode::NON_ATOMIC>( RememberedSet<OLD_TO_OLD>::Insert<AccessMode::NON_ATOMIC>(
Page::FromAddress(slot), slot); MemoryChunk::FromHeapObject(host), slot);
} }
} }
} }
...@@ -2780,13 +2780,22 @@ void LiveObjectVisitor::VisitBlackObjectsNoFail(MemoryChunk* chunk, ...@@ -2780,13 +2780,22 @@ void LiveObjectVisitor::VisitBlackObjectsNoFail(MemoryChunk* chunk,
IterationMode iteration_mode) { IterationMode iteration_mode) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"), TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"LiveObjectVisitor::VisitBlackObjectsNoFail"); "LiveObjectVisitor::VisitBlackObjectsNoFail");
for (auto object_and_size : DCHECK_NE(chunk->owner()->identity(), NEW_LO_SPACE);
LiveObjectRange<kBlackObjects>(chunk, marking_state->bitmap(chunk))) { if (chunk->owner()->identity() == LO_SPACE) {
HeapObject* const object = object_and_size.first; HeapObject* object = reinterpret_cast<LargePage*>(chunk)->GetObject();
DCHECK(marking_state->IsBlack(object)); DCHECK(marking_state->IsBlack(object));
const bool success = visitor->Visit(object, object_and_size.second); const bool success = visitor->Visit(object, object->Size());
USE(success); USE(success);
DCHECK(success); DCHECK(success);
} else {
for (auto object_and_size :
LiveObjectRange<kBlackObjects>(chunk, marking_state->bitmap(chunk))) {
HeapObject* const object = object_and_size.first;
DCHECK(marking_state->IsBlack(object));
const bool success = visitor->Visit(object, object_and_size.second);
USE(success);
DCHECK(success);
}
} }
if (iteration_mode == kClearMarkbits) { if (iteration_mode == kClearMarkbits) {
marking_state->ClearLiveness(chunk); marking_state->ClearLiveness(chunk);
......
...@@ -112,7 +112,7 @@ class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor { ...@@ -112,7 +112,7 @@ class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor {
if (result == KEEP_SLOT) { if (result == KEEP_SLOT) {
SLOW_DCHECK(target->IsHeapObject()); SLOW_DCHECK(target->IsHeapObject());
RememberedSet<OLD_TO_NEW>::Insert(Page::FromAddress(slot.address()), RememberedSet<OLD_TO_NEW>::Insert(MemoryChunk::FromHeapObject(host),
slot.address()); slot.address());
} }
SLOW_DCHECK(!MarkCompactCollector::IsOnEvacuationCandidate( SLOW_DCHECK(!MarkCompactCollector::IsOnEvacuationCandidate(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment