Chromium Code Reviews| Index: src/heap/remembered-set.cc |
| diff --git a/src/heap/remembered-set.cc b/src/heap/remembered-set.cc |
| index 0bc5e6e32401de0e4566cf81e37e9d23ab67ab04..64ee6beaedc4ec58a55746fb2a89584d02be83b2 100644 |
| --- a/src/heap/remembered-set.cc |
| +++ b/src/heap/remembered-set.cc |
| @@ -9,6 +9,7 @@ |
| #include "src/heap/slot-set.h" |
| #include "src/heap/spaces.h" |
| #include "src/heap/store-buffer.h" |
| +#include "src/macro-assembler.h" |
| namespace v8 { |
| namespace internal { |
| @@ -16,13 +17,32 @@ namespace internal { |
| template <PointerDirection direction> |
| void RememberedSet<direction>::ClearInvalidSlots(Heap* heap) { |
| STATIC_ASSERT(direction == OLD_TO_NEW); |
| - for (MemoryChunk* chunk : *heap->old_space()) { |
| - SlotSet* slots = GetSlotSet(chunk); |
| - if (slots != nullptr) { |
| - slots->Iterate([heap, chunk](Address addr) { |
| - Object** slot = reinterpret_cast<Object**>(addr); |
| - return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT; |
| - }); |
| + { |
| + for (MemoryChunk* chunk : *heap->old_space()) { |
| + { |
|
Michael Lippautz
2016/06/23 11:51:12
nit: I too like building pyramids but there's no n
ahaas
2016/06/23 12:42:21
done.
|
| + SlotSet* slots = GetSlotSet(chunk); |
| + if (slots != nullptr) { |
| + slots->Iterate([heap, chunk](Address addr) { |
| + Object** slot = reinterpret_cast<Object**>(addr); |
| + return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT; |
| + }); |
| + } |
| + } |
| + } |
| + } |
|
Michael Lippautz
2016/06/23 11:51:12
nit: You can also get rid of the outer scopes, so
ahaas
2016/06/23 12:42:21
done.
|
| + { |
| + for (MemoryChunk* chunk : *heap->code_space()) { |
| + TypedSlotSet* slots = GetTypedSlotSet(chunk); |
| + if (slots != nullptr) { |
| + slots->Iterate( |
| + [heap, chunk](SlotType type, Address host_addr, Address addr) { |
| + if (Marking::IsBlack(Marking::MarkBitFrom(host_addr))) { |
| + return KEEP_SLOT; |
| + } else { |
| + return REMOVE_SLOT; |
| + } |
| + }); |
| + } |
| } |
| } |
| } |