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 DCHECK(!heap_->code_space()->Contains(*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)); |
105 Address addr = *current; | 108 Address addr = *current; |
106 Page* page = Page::FromAnyPointerAddress(heap_, addr); | 109 Page* page = Page::FromAnyPointerAddress(heap_, addr); |
107 if (IsDeletionAddress(addr)) { | 110 if (IsDeletionAddress(addr)) { |
108 current++; | 111 current++; |
109 Address end = *current; | 112 Address end = *current; |
110 DCHECK(!IsDeletionAddress(end)); | 113 DCHECK(!IsDeletionAddress(end)); |
111 addr = UnmarkDeletionAddress(addr); | 114 addr = UnmarkDeletionAddress(addr); |
112 if (end) { | 115 if (end) { |
113 RememberedSet<OLD_TO_NEW>::RemoveRange(page, addr, end, | 116 RememberedSet<OLD_TO_NEW>::RemoveRange(page, addr, end, |
114 SlotSet::PREFREE_EMPTY_BUCKETS); | 117 SlotSet::PREFREE_EMPTY_BUCKETS); |
(...skipping 19 matching lines...) Expand all Loading... |
134 | 137 |
135 void StoreBuffer::ConcurrentlyProcessStoreBuffer() { | 138 void StoreBuffer::ConcurrentlyProcessStoreBuffer() { |
136 base::LockGuard<base::Mutex> guard(&mutex_); | 139 base::LockGuard<base::Mutex> guard(&mutex_); |
137 int other = (current_ + 1) % kStoreBuffers; | 140 int other = (current_ + 1) % kStoreBuffers; |
138 MoveEntriesToRememberedSet(other); | 141 MoveEntriesToRememberedSet(other); |
139 task_running_ = false; | 142 task_running_ = false; |
140 } | 143 } |
141 | 144 |
142 } // namespace internal | 145 } // namespace internal |
143 } // namespace v8 | 146 } // namespace v8 |
OLD | NEW |