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>::
MemoryChunk* chunk = MemoryChunk::FromHeapObject(object);
int object_size = FixedArray::BodyDescriptor::SizeOf(map, object);
if (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) {
DCHECK(!FLAG_use_marking_progress_bar ||
chunk->owner()->identity() == LO_SPACE);
DCHECK(!FLAG_use_marking_progress_bar || heap_->IsLargeObject(object));
// 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
// fully scanned. Fall back to scanning it through to the end in case this
......
......@@ -1100,10 +1100,10 @@ class RecordMigratedSlotVisitor : public ObjectVisitor {
DCHECK_IMPLIES(p->InToSpace(),
p->IsFlagSet(Page::PAGE_NEW_NEW_PROMOTION));
RememberedSet<OLD_TO_NEW>::Insert<AccessMode::NON_ATOMIC>(
Page::FromAddress(slot), slot);
MemoryChunk::FromHeapObject(host), slot);
} else if (p->IsEvacuationCandidate()) {
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,
IterationMode iteration_mode) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"LiveObjectVisitor::VisitBlackObjectsNoFail");
for (auto object_and_size :
LiveObjectRange<kBlackObjects>(chunk, marking_state->bitmap(chunk))) {
HeapObject* const object = object_and_size.first;
DCHECK_NE(chunk->owner()->identity(), NEW_LO_SPACE);
if (chunk->owner()->identity() == LO_SPACE) {
HeapObject* object = reinterpret_cast<LargePage*>(chunk)->GetObject();
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);
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) {
marking_state->ClearLiveness(chunk);
......
......@@ -112,7 +112,7 @@ class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor {
if (result == KEEP_SLOT) {
SLOW_DCHECK(target->IsHeapObject());
RememberedSet<OLD_TO_NEW>::Insert(Page::FromAddress(slot.address()),
RememberedSet<OLD_TO_NEW>::Insert(MemoryChunk::FromHeapObject(host),
slot.address());
}
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