| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // It doesn't matter whether the object is black, since it hasn't changed | 134 // It doesn't matter whether the object is black, since it hasn't changed |
| 135 // size, so the adjustment to the live data count will be zero anyway. | 135 // size, so the adjustment to the live data count will be zero anyway. |
| 136 if (from == to) return; | 136 if (from == to) return; |
| 137 | 137 |
| 138 MarkBit new_mark_bit = ObjectMarking::MarkBitFrom(to); | 138 MarkBit new_mark_bit = ObjectMarking::MarkBitFrom(to); |
| 139 MarkBit old_mark_bit = ObjectMarking::MarkBitFrom(from); | 139 MarkBit old_mark_bit = ObjectMarking::MarkBitFrom(from); |
| 140 | 140 |
| 141 if (Marking::IsBlack(old_mark_bit)) { | 141 if (Marking::IsBlack(old_mark_bit)) { |
| 142 Marking::MarkBlack(new_mark_bit); | 142 Marking::MarkBlack(new_mark_bit); |
| 143 } else if (Marking::IsGrey(old_mark_bit)) { | 143 } else if (Marking::IsGrey(old_mark_bit)) { |
| 144 Marking::MarkGrey(new_mark_bit); | 144 Marking::WhiteToGrey(new_mark_bit); |
| 145 heap->mark_compact_collector()->marking_deque()->Push(to); | 145 heap->mark_compact_collector()->marking_deque()->Push(to); |
| 146 heap->incremental_marking()->RestartIfNotMarking(); | 146 heap->incremental_marking()->RestartIfNotMarking(); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 class IncrementalMarkingMarkingVisitor | 150 class IncrementalMarkingMarkingVisitor |
| 151 : public StaticMarkingVisitor<IncrementalMarkingMarkingVisitor> { | 151 : public StaticMarkingVisitor<IncrementalMarkingMarkingVisitor> { |
| 152 public: | 152 public: |
| 153 static void Initialize() { | 153 static void Initialize() { |
| 154 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); | 154 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 idle_marking_delay_counter_++; | 1156 idle_marking_delay_counter_++; |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 | 1159 |
| 1160 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1160 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1161 idle_marking_delay_counter_ = 0; | 1161 idle_marking_delay_counter_ = 0; |
| 1162 } | 1162 } |
| 1163 | 1163 |
| 1164 } // namespace internal | 1164 } // namespace internal |
| 1165 } // namespace v8 | 1165 } // namespace v8 |
| OLD | NEW |