Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: src/heap/spaces.cc

Issue 1420423009: [heap] Black allocation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 64bd2300c82b52ee8f86cedee143eb5806607bfc..f7cce1430e55eee5e436f9b49639efcfaebb858b 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1196,6 +1196,16 @@ bool PagedSpace::Expand() {
// Pages created during bootstrapping may contain immortal immovable objects.
if (!heap()->deserialization_complete()) p->MarkNeverEvacuate();
+ // When incremental marking was activated, old generation pages are allocated
+ // black.
+ if (heap()->incremental_marking()->black_allocation()) {
+ Bitmap::SetAllBits(p);
+ p->SetFlag(Page::BLACK_PAGE);
+ if (FLAG_trace_incremental_marking) {
+ PrintIsolate(heap()->isolate(), "Added black page %p\n", p);
+ }
+ }
+
DCHECK(Capacity() <= heap()->MaxOldGenerationSize());
p->InsertAfter(anchor_.prev_page());
@@ -1297,7 +1307,8 @@ void PagedSpace::Verify(ObjectVisitor* visitor) {
// All the interior pointers should be contained in the heap.
int size = object->Size();
object->IterateBody(map->instance_type(), size, visitor);
- if (Marking::IsBlack(Marking::MarkBitFrom(object))) {
+ if (!page->IsFlagSet(Page::BLACK_PAGE) &&
+ Marking::IsBlack(Marking::MarkBitFrom(object))) {
black_size += size;
}
@@ -3011,7 +3022,11 @@ AllocationResult LargeObjectSpace::AllocateRaw(int object_size,
}
HeapObject* object = page->GetObject();
-
+ if (heap()->incremental_marking()->black_allocation()) {
+ MarkBit mark_bit = Marking::MarkBitFrom(object);
+ Marking::MarkBlack(mark_bit);
+ page->SetFlag(Page::BLACK_PAGE);
+ }
MSAN_ALLOCATED_UNINITIALIZED_MEMORY(object->address(), object_size);
if (Heap::ShouldZapGarbage()) {
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698