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

Unified Diff: src/heap/spaces-inl.h

Issue 2562383002: [heap] Black areas are created for both linear and free list allocations. (Closed)
Patch Set: Created 4 years 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces-inl.h
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h
index 685611e8151527a150a952be9ce47d28b64c0167..03be9035b917e76512ee43e64fb52b858705eaf1 100644
--- a/src/heap/spaces-inl.h
+++ b/src/heap/spaces-inl.h
@@ -430,11 +430,10 @@ AllocationResult PagedSpace::AllocateRawUnaligned(
if (object == NULL) {
object = SlowAllocateRaw(size_in_bytes);
}
- if (object != NULL) {
- if (heap()->incremental_marking()->black_allocation()) {
- Marking::MarkBlack(ObjectMarking::MarkBitFrom(object));
- MemoryChunk::IncrementLiveBytes(object, size_in_bytes);
- }
+ if (object != NULL && heap()->incremental_marking()->black_allocation()) {
+ Address start = object->address();
+ Address end = object->address() + size_in_bytes;
+ Page::FromAllocationAreaAddress(start)->CreateBlackArea(start, end);
}
}
@@ -472,6 +471,11 @@ AllocationResult PagedSpace::AllocateRawAligned(int size_in_bytes,
object = free_list_.Allocate(allocation_size);
if (object == NULL) {
object = SlowAllocateRaw(allocation_size);
+ if (object != NULL && heap()->incremental_marking()->black_allocation()) {
+ Address start = object->address();
+ Address end = object->address() + size_in_bytes;
+ Page::FromAllocationAreaAddress(start)->CreateBlackArea(start, end);
+ }
}
if (object != NULL && filler_size != 0) {
object = heap()->AlignWithFiller(object, size_in_bytes, allocation_size,
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698