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" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 void StoreBuffer::FlipStoreBuffers() { | 80 void StoreBuffer::FlipStoreBuffers() { |
81 base::LockGuard<base::Mutex> guard(&mutex_); | 81 base::LockGuard<base::Mutex> guard(&mutex_); |
82 int other = (current_ + 1) % kStoreBuffers; | 82 int other = (current_ + 1) % kStoreBuffers; |
83 MoveEntriesToRememberedSet(other); | 83 MoveEntriesToRememberedSet(other); |
84 lazy_top_[current_] = top_; | 84 lazy_top_[current_] = top_; |
85 current_ = other; | 85 current_ = other; |
86 top_ = start_[current_]; | 86 top_ = start_[current_]; |
87 | 87 |
88 if (!task_running_) { | 88 if (!task_running_ && FLAG_concurrent_sweeping) { |
89 task_running_ = true; | 89 task_running_ = true; |
90 Task* task = new Task(heap_->isolate(), this); | 90 Task* task = new Task(heap_->isolate(), this); |
91 V8::GetCurrentPlatform()->CallOnBackgroundThread( | 91 V8::GetCurrentPlatform()->CallOnBackgroundThread( |
92 task, v8::Platform::kShortRunningTask); | 92 task, v8::Platform::kShortRunningTask); |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 void StoreBuffer::MoveEntriesToRememberedSet(int index) { | 96 void StoreBuffer::MoveEntriesToRememberedSet(int index) { |
97 if (!lazy_top_[index]) return; | 97 if (!lazy_top_[index]) return; |
98 DCHECK_GE(index, 0); | 98 DCHECK_GE(index, 0); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 StoreBufferOverflow(heap_->isolate()); | 142 StoreBufferOverflow(heap_->isolate()); |
143 } | 143 } |
144 *top_ = MarkDeletionAddress(start); | 144 *top_ = MarkDeletionAddress(start); |
145 top_++; | 145 top_++; |
146 *top_ = end; | 146 *top_ = end; |
147 top_++; | 147 top_++; |
148 } | 148 } |
149 | 149 |
150 } // namespace internal | 150 } // namespace internal |
151 } // namespace v8 | 151 } // namespace v8 |
OLD | NEW |