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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 if (T == kBlackObjects && (current_cell_ & second_bit_index)) { | 176 if (T == kBlackObjects && (current_cell_ & second_bit_index)) { |
177 object = HeapObject::FromAddress(addr); | 177 object = HeapObject::FromAddress(addr); |
178 } else if (T == kGreyObjects && !(current_cell_ & second_bit_index)) { | 178 } else if (T == kGreyObjects && !(current_cell_ & second_bit_index)) { |
179 object = HeapObject::FromAddress(addr); | 179 object = HeapObject::FromAddress(addr); |
180 } else if (T == kAllLiveObjects) { | 180 } else if (T == kAllLiveObjects) { |
181 object = HeapObject::FromAddress(addr); | 181 object = HeapObject::FromAddress(addr); |
182 } else if (T == kGreyObjectsOnBlackPage) { | 182 } else if (T == kGreyObjectsOnBlackPage) { |
183 object = HeapObject::FromAddress(addr); | 183 object = HeapObject::FromAddress(addr); |
184 } | 184 } |
185 // Clear the second bit of the found object. | 185 |
186 current_cell_ &= ~second_bit_index; | 186 if (T != kGreyObjectsOnBlackPage) { |
| 187 // Clear the second bit of the found object. |
| 188 current_cell_ &= ~second_bit_index; |
| 189 } |
187 | 190 |
188 // We found a live object. | 191 // We found a live object. |
189 if (object != nullptr) break; | 192 if (object != nullptr) break; |
190 } | 193 } |
191 if (current_cell_ == 0) { | 194 if (current_cell_ == 0) { |
192 if (!it_.Done()) { | 195 if (!it_.Done()) { |
193 it_.Advance(); | 196 it_.Advance(); |
194 cell_base_ = it_.CurrentCellBase(); | 197 cell_base_ = it_.CurrentCellBase(); |
195 current_cell_ = *it_.CurrentCell(); | 198 current_cell_ = *it_.CurrentCell(); |
196 } | 199 } |
197 } | 200 } |
198 if (object != nullptr) return object; | 201 if (object != nullptr) return object; |
199 } | 202 } |
200 return nullptr; | 203 return nullptr; |
201 } | 204 } |
202 | 205 |
203 } // namespace internal | 206 } // namespace internal |
204 } // namespace v8 | 207 } // namespace v8 |
205 | 208 |
206 #endif // V8_HEAP_MARK_COMPACT_INL_H_ | 209 #endif // V8_HEAP_MARK_COMPACT_INL_H_ |
OLD | NEW |