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

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

Issue 1773203002: Version 4.9.385.29 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.9
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 unified diff | Download patch
« no previous file with comments | « include/v8-version.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/gc-idle-time-handler.h" 10 #include "src/heap/gc-idle-time-handler.h"
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 void IncrementalMarking::MarkObject(Heap* heap, HeapObject* obj) { 840 void IncrementalMarking::MarkObject(Heap* heap, HeapObject* obj) {
841 MarkBit mark_bit = Marking::MarkBitFrom(obj); 841 MarkBit mark_bit = Marking::MarkBitFrom(obj);
842 if (Marking::IsWhite(mark_bit)) { 842 if (Marking::IsWhite(mark_bit)) {
843 heap->incremental_marking()->WhiteToGreyAndPush(obj, mark_bit); 843 heap->incremental_marking()->WhiteToGreyAndPush(obj, mark_bit);
844 } 844 }
845 } 845 }
846 846
847 847
848 intptr_t IncrementalMarking::ProcessMarkingDeque(intptr_t bytes_to_process) { 848 intptr_t IncrementalMarking::ProcessMarkingDeque(intptr_t bytes_to_process) {
849 intptr_t bytes_processed = 0; 849 intptr_t bytes_processed = 0;
850 Map* filler_map = heap_->one_pointer_filler_map(); 850 Map* one_pointer_filler_map = heap_->one_pointer_filler_map();
851 Map* two_pointer_filler_map = heap_->two_pointer_filler_map();
851 MarkingDeque* marking_deque = 852 MarkingDeque* marking_deque =
852 heap_->mark_compact_collector()->marking_deque(); 853 heap_->mark_compact_collector()->marking_deque();
853 while (!marking_deque->IsEmpty() && bytes_processed < bytes_to_process) { 854 while (!marking_deque->IsEmpty() && bytes_processed < bytes_to_process) {
854 HeapObject* obj = marking_deque->Pop(); 855 HeapObject* obj = marking_deque->Pop();
855 856
856 // Explicitly skip one word fillers. Incremental markbit patterns are 857 // Explicitly skip one and two word fillers. Incremental markbit patterns
857 // correct only for objects that occupy at least two words. 858 // are correct only for objects that occupy at least two words.
859 // Moreover, slots filtering for left-trimmed arrays works only when
860 // the distance between the old array start and the new array start
861 // is greater than two if both starts are marked.
858 Map* map = obj->map(); 862 Map* map = obj->map();
859 if (map == filler_map) continue; 863 if (map == one_pointer_filler_map || map == two_pointer_filler_map)
864 continue;
860 865
861 int size = obj->SizeFromMap(map); 866 int size = obj->SizeFromMap(map);
862 unscanned_bytes_of_large_object_ = 0; 867 unscanned_bytes_of_large_object_ = 0;
863 VisitObject(map, obj, size); 868 VisitObject(map, obj, size);
864 bytes_processed += size - unscanned_bytes_of_large_object_; 869 bytes_processed += size - unscanned_bytes_of_large_object_;
865 } 870 }
866 return bytes_processed; 871 return bytes_processed;
867 } 872 }
868 873
869 874
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1251 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1247 idle_marking_delay_counter_++; 1252 idle_marking_delay_counter_++;
1248 } 1253 }
1249 1254
1250 1255
1251 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1256 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1252 idle_marking_delay_counter_ = 0; 1257 idle_marking_delay_counter_ = 0;
1253 } 1258 }
1254 } // namespace internal 1259 } // namespace internal
1255 } // namespace v8 1260 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698