| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 task, v8::Platform::kShortRunningTask); | 94 task, v8::Platform::kShortRunningTask); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 void StoreBuffer::MoveEntriesToRememberedSet(int index) { | 98 void StoreBuffer::MoveEntriesToRememberedSet(int index) { |
| 99 if (!lazy_top_[index]) return; | 99 if (!lazy_top_[index]) return; |
| 100 DCHECK_GE(index, 0); | 100 DCHECK_GE(index, 0); |
| 101 DCHECK_LT(index, kStoreBuffers); | 101 DCHECK_LT(index, kStoreBuffers); |
| 102 for (Address* current = start_[index]; current < lazy_top_[index]; | 102 for (Address* current = start_[index]; current < lazy_top_[index]; |
| 103 current++) { | 103 current++) { |
| 104 CHECK(!heap_->code_space()->Contains(*current)); | |
| 105 CHECK(heap_->old_space()->Contains(*current) || | |
| 106 heap_->map_space()->Contains(*current) || | |
| 107 heap_->lo_space()->ContainsSlow(*current)); | |
| 108 Address addr = *current; | 104 Address addr = *current; |
| 109 Page* page = Page::FromAnyPointerAddress(heap_, addr); | 105 Page* page = Page::FromAnyPointerAddress(heap_, addr); |
| 110 if (IsDeletionAddress(addr)) { | 106 if (IsDeletionAddress(addr)) { |
| 111 current++; | 107 current++; |
| 112 Address end = *current; | 108 Address end = *current; |
| 113 DCHECK(!IsDeletionAddress(end)); | 109 DCHECK(!IsDeletionAddress(end)); |
| 114 addr = UnmarkDeletionAddress(addr); | 110 addr = UnmarkDeletionAddress(addr); |
| 115 if (end) { | 111 if (end) { |
| 116 RememberedSet<OLD_TO_NEW>::RemoveRange(page, addr, end, | 112 RememberedSet<OLD_TO_NEW>::RemoveRange(page, addr, end, |
| 117 SlotSet::PREFREE_EMPTY_BUCKETS); | 113 SlotSet::PREFREE_EMPTY_BUCKETS); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 137 | 133 |
| 138 void StoreBuffer::ConcurrentlyProcessStoreBuffer() { | 134 void StoreBuffer::ConcurrentlyProcessStoreBuffer() { |
| 139 base::LockGuard<base::Mutex> guard(&mutex_); | 135 base::LockGuard<base::Mutex> guard(&mutex_); |
| 140 int other = (current_ + 1) % kStoreBuffers; | 136 int other = (current_ + 1) % kStoreBuffers; |
| 141 MoveEntriesToRememberedSet(other); | 137 MoveEntriesToRememberedSet(other); |
| 142 task_running_ = false; | 138 task_running_ = false; |
| 143 } | 139 } |
| 144 | 140 |
| 145 } // namespace internal | 141 } // namespace internal |
| 146 } // namespace v8 | 142 } // namespace v8 |
| OLD | NEW |