| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 84 } | 84 } | 
| 85 | 85 | 
| 86 void StoreBuffer::FlipStoreBuffers() { | 86 void StoreBuffer::FlipStoreBuffers() { | 
| 87   base::LockGuard<base::Mutex> guard(&mutex_); | 87   base::LockGuard<base::Mutex> guard(&mutex_); | 
| 88   int other = (current_ + 1) % kStoreBuffers; | 88   int other = (current_ + 1) % kStoreBuffers; | 
| 89   MoveEntriesToRememberedSet(other); | 89   MoveEntriesToRememberedSet(other); | 
| 90   lazy_top_[current_] = top_; | 90   lazy_top_[current_] = top_; | 
| 91   current_ = other; | 91   current_ = other; | 
| 92   top_ = start_[current_]; | 92   top_ = start_[current_]; | 
| 93 | 93 | 
| 94   if (!task_running_ && FLAG_concurrent_sweeping) { | 94   if (!task_running_ && FLAG_concurrent_store_buffer) { | 
| 95     task_running_ = true; | 95     task_running_ = true; | 
| 96     Task* task = new Task(heap_->isolate(), this); | 96     Task* task = new Task(heap_->isolate(), this); | 
| 97     V8::GetCurrentPlatform()->CallOnBackgroundThread( | 97     V8::GetCurrentPlatform()->CallOnBackgroundThread( | 
| 98         task, v8::Platform::kShortRunningTask); | 98         task, v8::Platform::kShortRunningTask); | 
| 99   } | 99   } | 
| 100 } | 100 } | 
| 101 | 101 | 
| 102 void StoreBuffer::MoveEntriesToRememberedSet(int index) { | 102 void StoreBuffer::MoveEntriesToRememberedSet(int index) { | 
| 103   if (!lazy_top_[index]) return; | 103   if (!lazy_top_[index]) return; | 
| 104   DCHECK_GE(index, 0); | 104   DCHECK_GE(index, 0); | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 137 | 137 | 
| 138 void StoreBuffer::ConcurrentlyProcessStoreBuffer() { | 138 void StoreBuffer::ConcurrentlyProcessStoreBuffer() { | 
| 139   base::LockGuard<base::Mutex> guard(&mutex_); | 139   base::LockGuard<base::Mutex> guard(&mutex_); | 
| 140   int other = (current_ + 1) % kStoreBuffers; | 140   int other = (current_ + 1) % kStoreBuffers; | 
| 141   MoveEntriesToRememberedSet(other); | 141   MoveEntriesToRememberedSet(other); | 
| 142   task_running_ = false; | 142   task_running_ = false; | 
| 143 } | 143 } | 
| 144 | 144 | 
| 145 }  // namespace internal | 145 }  // namespace internal | 
| 146 }  // namespace v8 | 146 }  // namespace v8 | 
| OLD | NEW | 
|---|