OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/store-buffer.h" | 5 #include "src/heap/store-buffer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/counters.h" | 9 #include "src/counters.h" |
10 #include "src/heap/incremental-marking.h" | 10 #include "src/heap/incremental-marking.h" |
11 #include "src/isolate.h" | 11 #include "src/isolate.h" |
12 #include "src/objects-inl.h" | 12 #include "src/objects-inl.h" |
13 #include "src/v8.h" | 13 #include "src/v8.h" |
14 | 14 |
15 namespace v8 { | 15 namespace v8 { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 StoreBuffer::StoreBuffer(Heap* heap) | 18 StoreBuffer::StoreBuffer(Heap* heap) |
19 : heap_(heap), top_(nullptr), current_(0), virtual_memory_(nullptr) { | 19 : heap_(heap), |
| 20 top_(nullptr), |
| 21 current_(0), |
| 22 mode_(NOT_IN_GC), |
| 23 virtual_memory_(nullptr) { |
20 for (int i = 0; i < kStoreBuffers; i++) { | 24 for (int i = 0; i < kStoreBuffers; i++) { |
21 start_[i] = nullptr; | 25 start_[i] = nullptr; |
22 limit_[i] = nullptr; | 26 limit_[i] = nullptr; |
23 lazy_top_[i] = nullptr; | 27 lazy_top_[i] = nullptr; |
24 } | 28 } |
25 task_running_ = false; | 29 task_running_ = false; |
26 insertion_callback = &InsertDuringRuntime; | 30 insertion_callback = &InsertDuringRuntime; |
27 deletion_callback = &DeleteDuringRuntime; | 31 deletion_callback = &DeleteDuringRuntime; |
28 } | 32 } |
29 | 33 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 141 |
138 void StoreBuffer::ConcurrentlyProcessStoreBuffer() { | 142 void StoreBuffer::ConcurrentlyProcessStoreBuffer() { |
139 base::LockGuard<base::Mutex> guard(&mutex_); | 143 base::LockGuard<base::Mutex> guard(&mutex_); |
140 int other = (current_ + 1) % kStoreBuffers; | 144 int other = (current_ + 1) % kStoreBuffers; |
141 MoveEntriesToRememberedSet(other); | 145 MoveEntriesToRememberedSet(other); |
142 task_running_ = false; | 146 task_running_ = false; |
143 } | 147 } |
144 | 148 |
145 } // namespace internal | 149 } // namespace internal |
146 } // namespace v8 | 150 } // namespace v8 |
OLD | NEW |