Commit ff010282 authored by hpayer's avatar hpayer Committed by Commit bot

[heap] Don't clear black areas when deserializing, they will be marked black later anyway.

BUG=chromium:630386

Review-Url: https://codereview.chromium.org/2264493002
Cr-Commit-Position: refs/heads/master@{#38737}
parent 8dd835c2
......@@ -1162,7 +1162,7 @@ bool Heap::ReserveSpace(Reservation* reservations, List<Address>* maps) {
// deserializing.
Address free_space_address = free_space->address();
CreateFillerObjectAt(free_space_address, Map::kSize,
ClearRecordedSlots::kNo);
ClearRecordedSlots::kNo, ClearBlackArea::kNo);
maps->Add(free_space_address);
} else {
perform_gc = true;
......@@ -1192,7 +1192,7 @@ bool Heap::ReserveSpace(Reservation* reservations, List<Address>* maps) {
// deserializing.
Address free_space_address = free_space->address();
CreateFillerObjectAt(free_space_address, size,
ClearRecordedSlots::kNo);
ClearRecordedSlots::kNo, ClearBlackArea::kNo);
DCHECK(space < SerializerDeserializer::kNumberOfPreallocatedSpaces);
chunk.start = free_space_address;
chunk.end = free_space_address + size;
......@@ -3081,8 +3081,8 @@ AllocationResult Heap::AllocateBytecodeArray(int length,
return result;
}
void Heap::CreateFillerObjectAt(Address addr, int size,
ClearRecordedSlots mode) {
void Heap::CreateFillerObjectAt(Address addr, int size, ClearRecordedSlots mode,
ClearBlackArea black_area_mode) {
if (size == 0) return;
HeapObject* filler = HeapObject::FromAddress(addr);
if (size == kPointerSize) {
......@@ -3103,7 +3103,8 @@ void Heap::CreateFillerObjectAt(Address addr, int size,
// If the location where the filler is created is within a black area we have
// to clear the mark bits of the filler space.
if (incremental_marking()->black_allocation() &&
if (black_area_mode == ClearBlackArea::kYes &&
incremental_marking()->black_allocation() &&
Marking::IsBlackOrGrey(ObjectMarking::MarkBitFrom(addr))) {
Page* page = Page::FromAddress(addr);
page->markbits()->ClearRange(page->AddressToMarkbitIndex(addr),
......
......@@ -450,6 +450,8 @@ enum ArrayStorageAllocationMode {
enum class ClearRecordedSlots { kYes, kNo };
enum class ClearBlackArea { kYes, kNo };
class Heap {
public:
// Declare all the root indices. This defines the root list order.
......@@ -673,8 +675,12 @@ class Heap {
// Initialize a filler object to keep the ability to iterate over the heap
// when introducing gaps within pages. If slots could have been recorded in
// the freed area, then pass ClearRecordedSlots::kYes as the mode. Otherwise,
// pass ClearRecordedSlots::kNo.
void CreateFillerObjectAt(Address addr, int size, ClearRecordedSlots mode);
// pass ClearRecordedSlots::kNo. If the filler was created in a black area
// we may want to clear the corresponding mark bits with ClearBlackArea::kYes,
// which is the default. ClearBlackArea::kNo does not clear the mark bits.
void CreateFillerObjectAt(
Address addr, int size, ClearRecordedSlots mode,
ClearBlackArea black_area_mode = ClearBlackArea::kYes);
bool CanMoveObjectStart(HeapObject* object);
......
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