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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 } | 814 } |
815 HeapObject* dest = map_word.ToForwardingAddress(); | 815 HeapObject* dest = map_word.ToForwardingAddress(); |
816 if (ObjectMarking::IsBlack<kAtomicity>(dest, marking_state(dest))) { | 816 if (ObjectMarking::IsBlack<kAtomicity>(dest, marking_state(dest))) { |
817 // The object is already processed by the marker. | 817 // The object is already processed by the marker. |
818 return nullptr; | 818 return nullptr; |
819 } | 819 } |
820 DCHECK(ObjectMarking::IsGrey<kAtomicity>(obj, marking_state(obj)) || | 820 DCHECK(ObjectMarking::IsGrey<kAtomicity>(obj, marking_state(obj)) || |
821 (obj->IsFiller() && | 821 (obj->IsFiller() && |
822 ObjectMarking::IsWhite<kAtomicity>(obj, marking_state(obj)))); | 822 ObjectMarking::IsWhite<kAtomicity>(obj, marking_state(obj)))); |
823 return dest; | 823 return dest; |
| 824 } else if (heap_->InToSpace(obj)) { |
| 825 // The object may be on a page that was moved in new space. |
| 826 DCHECK( |
| 827 Page::FromAddress(obj->address())->IsFlagSet(Page::SWEEP_TO_ITERATE)); |
| 828 return ObjectMarking::IsBlack<kAtomicity>(obj, |
| 829 MarkingState::External(obj)) |
| 830 ? obj |
| 831 : nullptr; |
824 } else { | 832 } else { |
| 833 // The object may be on a page that was moved from new to old space. |
| 834 if (Page::FromAddress(obj->address()) |
| 835 ->IsFlagSet(Page::SWEEP_TO_ITERATE)) { |
| 836 return ObjectMarking::IsBlack<kAtomicity>(obj, |
| 837 MarkingState::External(obj)) |
| 838 ? obj |
| 839 : nullptr; |
| 840 } |
825 DCHECK(ObjectMarking::IsGrey<kAtomicity>(obj, marking_state(obj)) || | 841 DCHECK(ObjectMarking::IsGrey<kAtomicity>(obj, marking_state(obj)) || |
826 (obj->IsFiller() && | 842 (obj->IsFiller() && |
827 ObjectMarking::IsWhite<kAtomicity>(obj, marking_state(obj))) || | 843 ObjectMarking::IsWhite<kAtomicity>(obj, marking_state(obj))) || |
828 (MemoryChunk::FromAddress(obj->address()) | 844 (MemoryChunk::FromAddress(obj->address()) |
829 ->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR) && | 845 ->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR) && |
830 ObjectMarking::IsBlack<kAtomicity>(obj, marking_state(obj)))); | 846 ObjectMarking::IsBlack<kAtomicity>(obj, marking_state(obj)))); |
831 // Skip one word filler objects that appear on the | 847 // Skip one word filler objects that appear on the |
832 // stack when we perform in place array shift. | 848 // stack when we perform in place array shift. |
833 return (obj->map() == filler_map) ? nullptr : obj; | 849 return (obj->map() == filler_map) ? nullptr : obj; |
834 } | 850 } |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 idle_marking_delay_counter_++; | 1215 idle_marking_delay_counter_++; |
1200 } | 1216 } |
1201 | 1217 |
1202 | 1218 |
1203 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1219 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1204 idle_marking_delay_counter_ = 0; | 1220 idle_marking_delay_counter_ = 0; |
1205 } | 1221 } |
1206 | 1222 |
1207 } // namespace internal | 1223 } // namespace internal |
1208 } // namespace v8 | 1224 } // namespace v8 |
OLD | NEW |