| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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/concurrent-marking.h" | 5 #include "src/heap/concurrent-marking.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "src/heap/concurrent-marking-deque.h" | 10 #include "src/heap/concurrent-marking-deque.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 base::Semaphore* on_finish_; | 229 base::Semaphore* on_finish_; |
| 230 DISALLOW_COPY_AND_ASSIGN(Task); | 230 DISALLOW_COPY_AND_ASSIGN(Task); |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 ConcurrentMarking::ConcurrentMarking(Heap* heap, ConcurrentMarkingDeque* deque) | 233 ConcurrentMarking::ConcurrentMarking(Heap* heap, ConcurrentMarkingDeque* deque) |
| 234 : heap_(heap), | 234 : heap_(heap), |
| 235 pending_task_semaphore_(0), | 235 pending_task_semaphore_(0), |
| 236 deque_(deque), | 236 deque_(deque), |
| 237 visitor_(new ConcurrentMarkingVisitor(deque_)), | 237 visitor_(new ConcurrentMarkingVisitor(deque_)), |
| 238 is_task_pending_(false) { | 238 is_task_pending_(false) { |
| 239 // Concurrent marking does not work with double unboxing. | |
| 240 STATIC_ASSERT(!(V8_CONCURRENT_MARKING && V8_DOUBLE_FIELDS_UNBOXING)); | |
| 241 // The runtime flag should be set only if the compile time flag was set. | 239 // The runtime flag should be set only if the compile time flag was set. |
| 242 CHECK(!FLAG_concurrent_marking || V8_CONCURRENT_MARKING); | 240 #ifndef V8_CONCURRENT_MARKING |
| 241 CHECK(!FLAG_concurrent_marking); |
| 242 #endif |
| 243 } | 243 } |
| 244 | 244 |
| 245 ConcurrentMarking::~ConcurrentMarking() { delete visitor_; } | 245 ConcurrentMarking::~ConcurrentMarking() { delete visitor_; } |
| 246 | 246 |
| 247 void ConcurrentMarking::Run() { | 247 void ConcurrentMarking::Run() { |
| 248 double time_ms = heap_->MonotonicallyIncreasingTimeInMs(); | 248 double time_ms = heap_->MonotonicallyIncreasingTimeInMs(); |
| 249 size_t bytes_marked = 0; | 249 size_t bytes_marked = 0; |
| 250 base::Mutex* relocation_mutex = heap_->relocation_mutex(); | 250 base::Mutex* relocation_mutex = heap_->relocation_mutex(); |
| 251 { | 251 { |
| 252 TimedScope scope(&time_ms); | 252 TimedScope scope(&time_ms); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 278 } | 278 } |
| 279 | 279 |
| 280 void ConcurrentMarking::EnsureTaskCompleted() { | 280 void ConcurrentMarking::EnsureTaskCompleted() { |
| 281 if (IsTaskPending()) { | 281 if (IsTaskPending()) { |
| 282 WaitForTaskToComplete(); | 282 WaitForTaskToComplete(); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace internal | 286 } // namespace internal |
| 287 } // namespace v8 | 287 } // namespace v8 |
| OLD | NEW |