Index: src/heap/spaces.cc |
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
index 4a565ac90747bea2c3f4bc4e15af1386ec13d778..5e98b826811cf022e7028d841c1fe3a88f17b34f 100644 |
--- a/src/heap/spaces.cc |
+++ b/src/heap/spaces.cc |
@@ -2923,6 +2923,19 @@ Address LargePage::GetAddressToShrink() { |
return 0; |
} |
+void LargePage::ClearOutOfLiveRangeSlots(Address free_start) { |
+ if (old_to_new_slots() != nullptr) { |
+ old_to_new_slots()->RemoveRange( |
+ static_cast<int>(free_start - address()), |
+ static_cast<int>(free_start + size() - address())); |
+ } |
+ if (old_to_old_slots() != nullptr) { |
+ old_to_old_slots()->RemoveRange( |
+ static_cast<int>(free_start - address()), |
+ static_cast<int>(free_start + size() - address())); |
+ } |
+} |
+ |
// ----------------------------------------------------------------------------- |
// LargeObjectIterator |
@@ -3083,6 +3096,7 @@ void LargeObjectSpace::FreeUnmarkedObjects() { |
Address free_start; |
if ((free_start = current->GetAddressToShrink()) != 0) { |
// TODO(hpayer): Perform partial free concurrently. |
+ current->ClearOutOfLiveRangeSlots(free_start); |
heap()->memory_allocator()->PartialFreeMemory(current, free_start); |
} |
previous = current; |