Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 267f474a3af4fe8946dcf3e0974a7cd682d18217..dac5d73723b5c32ac5edd66f093b225ce73c9a58 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -4229,7 +4229,25 @@ void Heap::RegisterReservationsForBlackAllocation(Reservation* reservations) { |
// TODO(hpayer): We do not have to iterate reservations on black objects |
// for marking. We just have to execute the special visiting side effect |
// code that adds objects to global data structures, e.g. for array buffers. |
+ |
+ // Code space, map space, and large object space do not use black pages. |
+ // Hence we have to color all objects of the reservation first black to avoid |
+ // unnecessary marking deque load. |
if (incremental_marking()->black_allocation()) { |
+ for (int i = CODE_SPACE; i < Serializer::kNumberOfSpaces; i++) { |
+ const Heap::Reservation& res = reservations[i]; |
+ for (auto& chunk : res) { |
+ Address addr = chunk.start; |
+ while (addr < chunk.end) { |
+ HeapObject* obj = HeapObject::FromAddress(addr); |
+ if (i != OLD_SPACE) { |
ulan
2016/04/06 16:44:43
DCHECK_NE(i, OLD_SPACE) because loop starts from C
Hannes Payer (out of office)
2016/04/06 21:23:51
Done.
|
+ Marking::MarkBlack(Marking::MarkBitFrom(obj)); |
+ MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size()); |
+ } |
+ addr += obj->Size(); |
+ } |
+ } |
+ } |
for (int i = OLD_SPACE; i < Serializer::kNumberOfSpaces; i++) { |
const Heap::Reservation& res = reservations[i]; |
for (auto& chunk : res) { |