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/concurrent-marking.h" | 10 #include "src/heap/concurrent-marking.h" |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 | 866 |
867 void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) { | 867 void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) { |
868 MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj, marking_state(obj)); | 868 MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj, marking_state(obj)); |
869 DCHECK(Marking::IsGrey<kAtomicity>(mark_bit) || | 869 DCHECK(Marking::IsGrey<kAtomicity>(mark_bit) || |
870 Marking::IsBlack<kAtomicity>(mark_bit)); | 870 Marking::IsBlack<kAtomicity>(mark_bit)); |
871 USE(mark_bit); | 871 USE(mark_bit); |
872 // The object can already be black in two cases: | 872 // The object can already be black in two cases: |
873 // 1. The object is a fixed array with the progress bar. | 873 // 1. The object is a fixed array with the progress bar. |
874 // 2. The object is a JSObject that was colored black before | 874 // 2. The object is a JSObject that was colored black before |
875 // unsafe layout change. | 875 // unsafe layout change. |
| 876 // 3. The object is a string that was colored black before |
| 877 // unsafe layout change. |
876 if (!ObjectMarking::GreyToBlack<kAtomicity>(obj, marking_state(obj))) { | 878 if (!ObjectMarking::GreyToBlack<kAtomicity>(obj, marking_state(obj))) { |
877 DCHECK(IsFixedArrayWithProgressBar(obj) || obj->IsJSObject()); | 879 DCHECK(IsFixedArrayWithProgressBar(obj) || obj->IsJSObject() || |
| 880 obj->IsString()); |
878 } | 881 } |
879 DCHECK(ObjectMarking::IsBlack<kAtomicity>(obj, marking_state(obj))); | 882 DCHECK(ObjectMarking::IsBlack<kAtomicity>(obj, marking_state(obj))); |
880 WhiteToGreyAndPush(map); | 883 WhiteToGreyAndPush(map); |
881 IncrementalMarkingMarkingVisitor::IterateBody(map, obj); | 884 IncrementalMarkingMarkingVisitor::IterateBody(map, obj); |
882 } | 885 } |
883 | 886 |
884 intptr_t IncrementalMarking::ProcessMarkingDeque( | 887 intptr_t IncrementalMarking::ProcessMarkingDeque( |
885 intptr_t bytes_to_process, ForceCompletionAction completion) { | 888 intptr_t bytes_to_process, ForceCompletionAction completion) { |
886 intptr_t bytes_processed = 0; | 889 intptr_t bytes_processed = 0; |
887 while (!marking_deque()->IsEmpty() && (bytes_processed < bytes_to_process || | 890 while (!marking_deque()->IsEmpty() && (bytes_processed < bytes_to_process || |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 idle_marking_delay_counter_++; | 1227 idle_marking_delay_counter_++; |
1225 } | 1228 } |
1226 | 1229 |
1227 | 1230 |
1228 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1231 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1229 idle_marking_delay_counter_ = 0; | 1232 idle_marking_delay_counter_ = 0; |
1230 } | 1233 } |
1231 | 1234 |
1232 } // namespace internal | 1235 } // namespace internal |
1233 } // namespace v8 | 1236 } // namespace v8 |
OLD | NEW |