| Index: src/heap/remembered-set.cc
|
| diff --git a/src/heap/remembered-set.cc b/src/heap/remembered-set.cc
|
| index 403c99b05712ec53d2920b40e5ee6ff9e3a2f84c..c79871d915065c7144d706e175dc92625e6c7a9d 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,16 +17,38 @@ namespace internal {
|
| template <PointerDirection direction>
|
| void RememberedSet<direction>::ClearInvalidSlots(Heap* heap) {
|
| STATIC_ASSERT(direction == OLD_TO_NEW);
|
| - PageIterator it(heap->old_space());
|
| - MemoryChunk* chunk;
|
| - while (it.has_next()) {
|
| - chunk = it.next();
|
| - 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;
|
| - });
|
| + {
|
| + PageIterator it(heap->old_space());
|
| + MemoryChunk* chunk;
|
| + while (it.has_next()) {
|
| + chunk = it.next();
|
| + {
|
| + 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;
|
| + });
|
| + }
|
| + }
|
| + }
|
| + }
|
| + {
|
| + PageIterator it(heap->code_space());
|
| + MemoryChunk* chunk;
|
| + while (it.has_next()) {
|
| + chunk = it.next();
|
| + 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;
|
| + }
|
| + });
|
| + }
|
| }
|
| }
|
| }
|
|
|