OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_HEAP_MARK_COMPACT_INL_H_ | 5 #ifndef V8_HEAP_MARK_COMPACT_INL_H_ |
6 #define V8_HEAP_MARK_COMPACT_INL_H_ | 6 #define V8_HEAP_MARK_COMPACT_INL_H_ |
7 | 7 |
8 #include "src/heap/mark-compact.h" | 8 #include "src/heap/mark-compact.h" |
9 #include "src/heap/remembered-set.h" | 9 #include "src/heap/remembered-set.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 | 189 |
190 // Clear all bits in current_cell, including the end index. | 190 // Clear all bits in current_cell, including the end index. |
191 current_cell_ &= ~(end_index_mask + end_index_mask - 1); | 191 current_cell_ &= ~(end_index_mask + end_index_mask - 1); |
192 } | 192 } |
193 | 193 |
194 if (T == kBlackObjects || T == kAllLiveObjects) { | 194 if (T == kBlackObjects || T == kAllLiveObjects) { |
195 object = black_object; | 195 object = black_object; |
196 } | 196 } |
197 } else if ((T == kGreyObjects || T == kAllLiveObjects)) { | 197 } else if ((T == kGreyObjects || T == kAllLiveObjects)) { |
| 198 map = base::NoBarrierAtomicValue<Map*>::FromAddress(addr)->Value(); |
198 object = HeapObject::FromAddress(addr); | 199 object = HeapObject::FromAddress(addr); |
199 } | 200 } |
200 | 201 |
201 // We found a live object. | 202 // We found a live object. |
202 if (object != nullptr) { | 203 if (object != nullptr) { |
203 if (map != nullptr && map == heap()->one_pointer_filler_map()) { | 204 if (map == heap()->one_pointer_filler_map()) { |
204 // Black areas together with slack tracking may result in black one | 205 // Black areas together with slack tracking may result in black one |
205 // word filler objects. We filter these objects out in the iterator. | 206 // word filler objects. We filter these objects out in the iterator. |
206 object = nullptr; | 207 object = nullptr; |
207 } else { | 208 } else { |
208 break; | 209 break; |
209 } | 210 } |
210 } | 211 } |
211 } | 212 } |
212 | 213 |
213 if (current_cell_ == 0) { | 214 if (current_cell_ == 0) { |
214 if (!it_.Done()) { | 215 if (!it_.Done()) { |
215 it_.Advance(); | 216 it_.Advance(); |
216 cell_base_ = it_.CurrentCellBase(); | 217 cell_base_ = it_.CurrentCellBase(); |
217 current_cell_ = *it_.CurrentCell(); | 218 current_cell_ = *it_.CurrentCell(); |
218 } | 219 } |
219 } | 220 } |
220 if (object != nullptr) return object; | 221 if (object != nullptr) return object; |
221 } | 222 } |
222 return nullptr; | 223 return nullptr; |
223 } | 224 } |
224 | 225 |
225 } // namespace internal | 226 } // namespace internal |
226 } // namespace v8 | 227 } // namespace v8 |
227 | 228 |
228 #endif // V8_HEAP_MARK_COMPACT_INL_H_ | 229 #endif // V8_HEAP_MARK_COMPACT_INL_H_ |
OLD | NEW |