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

Side by Side Diff: src/heap/incremental-marking.cc

Issue 2853323003: [heap] Prepare IncrementalMarking::VisitObject for concurrent marking. (Closed)
Patch Set: rebase Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/incremental-marking.h" 5 #include "src/heap/incremental-marking.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/compilation-cache.h" 8 #include "src/compilation-cache.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/heap/concurrent-marking.h" 10 #include "src/heap/concurrent-marking.h"
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 (MemoryChunk::FromAddress(obj->address()) 819 (MemoryChunk::FromAddress(obj->address())
820 ->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR) && 820 ->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR) &&
821 ObjectMarking::IsBlack<kAtomicity>(obj, marking_state(obj)))); 821 ObjectMarking::IsBlack<kAtomicity>(obj, marking_state(obj))));
822 // Skip one word filler objects that appear on the 822 // Skip one word filler objects that appear on the
823 // stack when we perform in place array shift. 823 // stack when we perform in place array shift.
824 return (obj->map() == filler_map) ? nullptr : obj; 824 return (obj->map() == filler_map) ? nullptr : obj;
825 } 825 }
826 }); 826 });
827 } 827 }
828 828
829 bool IncrementalMarking::IsFixedArrayWithProgressBar(HeapObject* obj) {
830 if (!obj->IsFixedArray()) return false;
831 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address());
832 return chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR);
833 }
829 834
830 void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) { 835 void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) {
831 WhiteToGreyAndPush(map);
832
833 IncrementalMarkingMarkingVisitor::IterateBody(map, obj);
834
835 #if ENABLE_SLOW_DCHECKS 836 #if ENABLE_SLOW_DCHECKS
836 MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj, marking_state(obj)); 837 MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj, marking_state(obj));
837 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); 838 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address());
838 SLOW_DCHECK(Marking::IsGrey<kAtomicity>(mark_bit) || 839 SLOW_DCHECK(Marking::IsGrey<kAtomicity>(mark_bit) ||
839 (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR) && 840 (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR) &&
840 Marking::IsBlack<kAtomicity>(mark_bit))); 841 Marking::IsBlack<kAtomicity>(mark_bit)));
841 #endif 842 #endif
842 ObjectMarking::GreyToBlack<kAtomicity>(obj, marking_state(obj)); 843 if (ObjectMarking::GreyToBlack<kAtomicity>(obj, marking_state(obj))) {
844 WhiteToGreyAndPush(map);
845 IncrementalMarkingMarkingVisitor::IterateBody(map, obj);
846 } else if (IsFixedArrayWithProgressBar(obj)) {
847 DCHECK(ObjectMarking::IsBlack<kAtomicity>(obj, marking_state(obj)));
848 IncrementalMarkingMarkingVisitor::VisitFixedArrayIncremental(map, obj);
849 }
843 } 850 }
844 851
845 intptr_t IncrementalMarking::ProcessMarkingDeque( 852 intptr_t IncrementalMarking::ProcessMarkingDeque(
846 intptr_t bytes_to_process, ForceCompletionAction completion) { 853 intptr_t bytes_to_process, ForceCompletionAction completion) {
847 intptr_t bytes_processed = 0; 854 intptr_t bytes_processed = 0;
848 while (!marking_deque()->IsEmpty() && (bytes_processed < bytes_to_process || 855 while (!marking_deque()->IsEmpty() && (bytes_processed < bytes_to_process ||
849 completion == FORCE_COMPLETION)) { 856 completion == FORCE_COMPLETION)) {
850 HeapObject* obj = marking_deque()->Pop(); 857 HeapObject* obj = marking_deque()->Pop();
851 858
852 // Left trimming may result in white, grey, or black filler objects on the 859 // Left trimming may result in white, grey, or black filler objects on the
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 idle_marking_delay_counter_++; 1190 idle_marking_delay_counter_++;
1184 } 1191 }
1185 1192
1186 1193
1187 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1194 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1188 idle_marking_delay_counter_ = 0; 1195 idle_marking_delay_counter_ = 0;
1189 } 1196 }
1190 1197
1191 } // namespace internal 1198 } // namespace internal
1192 } // namespace v8 1199 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698