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

Unified Diff: src/heap/incremental-marking.cc

Issue 1027463002: Revert "Merge old data and pointer space." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/heap-inl.h ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
index e01c50b849a0bb99053fa4f0b57f635280ae755c..b3609e4adcf7db1baa16dde096f9ee48d5290045 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -135,6 +135,16 @@ static void MarkObjectGreyDoNotEnqueue(Object* obj) {
}
+static inline void MarkBlackOrKeepGrey(HeapObject* heap_object,
+ MarkBit mark_bit, int size) {
+ DCHECK(!Marking::IsImpossible(mark_bit));
+ if (mark_bit.Get()) return;
+ mark_bit.Set();
+ MemoryChunk::IncrementLiveBytesFromGC(heap_object->address(), size);
+ DCHECK(Marking::IsBlack(mark_bit));
+}
+
+
static inline void MarkBlackOrKeepBlack(HeapObject* heap_object,
MarkBit mark_bit, int size) {
DCHECK(!Marking::IsImpossible(mark_bit));
@@ -346,7 +356,8 @@ void IncrementalMarking::DeactivateIncrementalWriteBarrierForSpace(
void IncrementalMarking::DeactivateIncrementalWriteBarrier() {
- DeactivateIncrementalWriteBarrierForSpace(heap_->old_space());
+ DeactivateIncrementalWriteBarrierForSpace(heap_->old_pointer_space());
+ DeactivateIncrementalWriteBarrierForSpace(heap_->old_data_space());
DeactivateIncrementalWriteBarrierForSpace(heap_->cell_space());
DeactivateIncrementalWriteBarrierForSpace(heap_->map_space());
DeactivateIncrementalWriteBarrierForSpace(heap_->code_space());
@@ -379,7 +390,8 @@ void IncrementalMarking::ActivateIncrementalWriteBarrier(NewSpace* space) {
void IncrementalMarking::ActivateIncrementalWriteBarrier() {
- ActivateIncrementalWriteBarrier(heap_->old_space());
+ ActivateIncrementalWriteBarrier(heap_->old_pointer_space());
+ ActivateIncrementalWriteBarrier(heap_->old_data_space());
ActivateIncrementalWriteBarrier(heap_->cell_space());
ActivateIncrementalWriteBarrier(heap_->map_space());
ActivateIncrementalWriteBarrier(heap_->code_space());
@@ -642,7 +654,9 @@ void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) {
void IncrementalMarking::MarkObject(Heap* heap, HeapObject* obj) {
MarkBit mark_bit = Marking::MarkBitFrom(obj);
- if (Marking::IsWhite(mark_bit)) {
+ if (mark_bit.data_only()) {
+ MarkBlackOrKeepGrey(obj, mark_bit, obj->Size());
+ } else if (Marking::IsWhite(mark_bit)) {
heap->incremental_marking()->WhiteToGreyAndPush(obj, mark_bit);
}
}
« no previous file with comments | « src/heap/heap-inl.h ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698