OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_REMEMBERED_SET_H | 5 #ifndef V8_REMEMBERED_SET_H |
6 #define V8_REMEMBERED_SET_H | 6 #define V8_REMEMBERED_SET_H |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
10 #include "src/heap/slot-set.h" | 10 #include "src/heap/slot-set.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 while ((chunk = it.next()) != nullptr) { | 195 while ((chunk = it.next()) != nullptr) { |
196 chunk->ReleaseOldToOldSlots(); | 196 chunk->ReleaseOldToOldSlots(); |
197 chunk->ReleaseTypedOldToOldSlots(); | 197 chunk->ReleaseTypedOldToOldSlots(); |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 // Eliminates all stale slots from the remembered set, i.e. | 201 // Eliminates all stale slots from the remembered set, i.e. |
202 // slots that are not part of live objects anymore. This method must be | 202 // slots that are not part of live objects anymore. This method must be |
203 // called after marking, when the whole transitive closure is known and | 203 // called after marking, when the whole transitive closure is known and |
204 // must be called before sweeping when mark bits are still intact. | 204 // must be called before sweeping when mark bits are still intact. |
| 205 static void ClearInvalidSlots(Heap* heap); |
| 206 |
| 207 static void ClearInvalidSlots(Heap* heap, MemoryChunk* chunk); |
205 static void ClearInvalidTypedSlots(Heap* heap, MemoryChunk* chunk); | 208 static void ClearInvalidTypedSlots(Heap* heap, MemoryChunk* chunk); |
206 | 209 |
| 210 static void VerifyValidSlots(Heap* heap); |
| 211 |
207 private: | 212 private: |
208 static SlotSet* GetSlotSet(MemoryChunk* chunk) { | 213 static SlotSet* GetSlotSet(MemoryChunk* chunk) { |
209 if (direction == OLD_TO_OLD) { | 214 if (direction == OLD_TO_OLD) { |
210 return chunk->old_to_old_slots(); | 215 return chunk->old_to_old_slots(); |
211 } else { | 216 } else { |
212 return chunk->old_to_new_slots(); | 217 return chunk->old_to_new_slots(); |
213 } | 218 } |
214 } | 219 } |
215 | 220 |
216 static TypedSlotSet* GetTypedSlotSet(MemoryChunk* chunk) { | 221 static TypedSlotSet* GetTypedSlotSet(MemoryChunk* chunk) { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 return DEBUG_TARGET_SLOT; | 382 return DEBUG_TARGET_SLOT; |
378 } | 383 } |
379 UNREACHABLE(); | 384 UNREACHABLE(); |
380 return CLEARED_SLOT; | 385 return CLEARED_SLOT; |
381 } | 386 } |
382 | 387 |
383 } // namespace internal | 388 } // namespace internal |
384 } // namespace v8 | 389 } // namespace v8 |
385 | 390 |
386 #endif // V8_REMEMBERED_SET_H | 391 #endif // V8_REMEMBERED_SET_H |
OLD | NEW |