| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |