Chromium Code Reviews| 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 #ifndef V8_HEAP_INCREMENTAL_MARKING_H_ | 5 #ifndef V8_HEAP_INCREMENTAL_MARKING_H_ |
| 6 #define V8_HEAP_INCREMENTAL_MARKING_H_ | 6 #define V8_HEAP_INCREMENTAL_MARKING_H_ |
| 7 | 7 |
| 8 #include "src/cancelable-task.h" | 8 #include "src/cancelable-task.h" |
| 9 #include "src/execution.h" | 9 #include "src/execution.h" |
| 10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 void ClearIdleMarkingDelayCounter(); | 178 void ClearIdleMarkingDelayCounter(); |
| 179 | 179 |
| 180 bool IsIdleMarkingDelayCounterLimitReached(); | 180 bool IsIdleMarkingDelayCounterLimitReached(); |
| 181 | 181 |
| 182 static void MarkGrey(Heap* heap, HeapObject* object); | 182 static void MarkGrey(Heap* heap, HeapObject* object); |
| 183 | 183 |
| 184 static void MarkBlack(HeapObject* object, int size); | 184 static void MarkBlack(HeapObject* object, int size); |
| 185 | 185 |
| 186 static void TransferMark(Heap* heap, HeapObject* from, HeapObject* to); | 186 static void TransferMark(Heap* heap, HeapObject* from, HeapObject* to); |
| 187 | 187 |
| 188 template <MarkBit::AccessMode access_mode = MarkBit::NON_ATOMIC> | |
| 188 V8_INLINE static void TransferColor(HeapObject* from, HeapObject* to) { | 189 V8_INLINE static void TransferColor(HeapObject* from, HeapObject* to) { |
|
Michael Lippautz
2017/04/21 07:05:51
TransferColor might work concurrently in new space
Hannes Payer (out of office)
2017/04/21 14:46:26
I guess you do not need to synchronize.
Michael Lippautz
2017/04/24 13:15:08
We need to synchronize for live byte count which i
| |
| 189 if (ObjectMarking::IsBlack(to, MarkingState::Internal(to))) { | 190 if (ObjectMarking::IsBlack<access_mode>(to, MarkingState::Internal(to))) { |
| 190 DCHECK(to->GetHeap()->incremental_marking()->black_allocation()); | 191 DCHECK(to->GetHeap()->incremental_marking()->black_allocation()); |
| 191 return; | 192 return; |
| 192 } | 193 } |
| 193 | 194 |
| 194 DCHECK(ObjectMarking::IsWhite(to, MarkingState::Internal(to))); | 195 DCHECK(ObjectMarking::IsWhite<access_mode>(to, MarkingState::Internal(to))); |
| 195 if (ObjectMarking::IsGrey(from, MarkingState::Internal(from))) { | 196 if (ObjectMarking::IsGrey<access_mode>(from, |
| 196 ObjectMarking::WhiteToGrey(to, MarkingState::Internal(to)); | 197 MarkingState::Internal(from))) { |
| 197 } else if (ObjectMarking::IsBlack(from, MarkingState::Internal(from))) { | 198 ObjectMarking::WhiteToGrey<access_mode>(to, MarkingState::Internal(to)); |
| 198 ObjectMarking::WhiteToBlack(to, MarkingState::Internal(to)); | 199 } else if (ObjectMarking::IsBlack<access_mode>( |
| 200 from, MarkingState::Internal(from))) { | |
| 201 ObjectMarking::WhiteToBlack<access_mode>(to, MarkingState::Internal(to)); | |
| 199 } | 202 } |
| 200 } | 203 } |
| 201 | 204 |
| 202 void IterateBlackObject(HeapObject* object); | 205 void IterateBlackObject(HeapObject* object); |
| 203 | 206 |
| 204 Heap* heap() const { return heap_; } | 207 Heap* heap() const { return heap_; } |
| 205 | 208 |
| 206 IncrementalMarkingJob* incremental_marking_job() { | 209 IncrementalMarkingJob* incremental_marking_job() { |
| 207 return &incremental_marking_job_; | 210 return &incremental_marking_job_; |
| 208 } | 211 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 | 298 |
| 296 Observer new_generation_observer_; | 299 Observer new_generation_observer_; |
| 297 Observer old_generation_observer_; | 300 Observer old_generation_observer_; |
| 298 | 301 |
| 299 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 302 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
| 300 }; | 303 }; |
| 301 } // namespace internal | 304 } // namespace internal |
| 302 } // namespace v8 | 305 } // namespace v8 |
| 303 | 306 |
| 304 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 307 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
| OLD | NEW |