| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium 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 #include "platform/heap/HeapCompact.h" | 5 #include "platform/heap/HeapCompact.h" |
| 6 | 6 |
| 7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
| 8 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
| 9 #include "platform/heap/SparseHeapBitmap.h" | 9 #include "platform/heap/SparseHeapBitmap.h" |
| 10 #include "wtf/CurrentTime.h" | 10 #include "wtf/CurrentTime.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Note: |slot| will reside outside the Oilpan heap if it is a | 79 // Note: |slot| will reside outside the Oilpan heap if it is a |
| 80 // PersistentHeapCollectionBase. Hence pageFromObject() cannot be | 80 // PersistentHeapCollectionBase. Hence pageFromObject() cannot be |
| 81 // used, as it sanity checks the |BasePage| it returns. Simply | 81 // used, as it sanity checks the |BasePage| it returns. Simply |
| 82 // derive the raw BasePage address here and check if it is a member | 82 // derive the raw BasePage address here and check if it is a member |
| 83 // of the compactable and relocatable page address set. | 83 // of the compactable and relocatable page address set. |
| 84 Address slotAddress = reinterpret_cast<Address>(slot); | 84 Address slotAddress = reinterpret_cast<Address>(slot); |
| 85 BasePage* slotPage = reinterpret_cast<BasePage*>( | 85 BasePage* slotPage = reinterpret_cast<BasePage*>( |
| 86 blinkPageAddress(slotAddress) + blinkGuardPageSize); | 86 blinkPageAddress(slotAddress) + blinkGuardPageSize); |
| 87 if (LIKELY(!m_relocatablePages.contains(slotPage))) | 87 if (LIKELY(!m_relocatablePages.contains(slotPage))) |
| 88 return; | 88 return; |
| 89 #if ENABLE(ASSERT) | 89 #if DCHECK_IS_ON() |
| 90 DCHECK(slotPage->contains(slotAddress)); | 90 DCHECK(slotPage->contains(slotAddress)); |
| 91 #endif | 91 #endif |
| 92 // Unlikely case, the slot resides on a compacting arena's page. | 92 // Unlikely case, the slot resides on a compacting arena's page. |
| 93 // => It is an 'interior slot' (interior to a movable backing store.) | 93 // => It is an 'interior slot' (interior to a movable backing store.) |
| 94 // Record it as an interior slot, which entails: | 94 // Record it as an interior slot, which entails: |
| 95 // | 95 // |
| 96 // - Storing it in the interior map, which maps the slot to | 96 // - Storing it in the interior map, which maps the slot to |
| 97 // its (eventual) location. Initially nullptr. | 97 // its (eventual) location. Initially nullptr. |
| 98 // - Mark it as being interior pointer within the page's | 98 // - Mark it as being interior pointer within the page's |
| 99 // "interior" bitmap. This bitmap is used when moving a backing | 99 // "interior" bitmap. This bitmap is used when moving a backing |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 fixups().addCompactingPage(page); | 469 fixups().addCompactingPage(page); |
| 470 } | 470 } |
| 471 | 471 |
| 472 bool HeapCompact::scheduleCompactionGCForTesting(bool value) { | 472 bool HeapCompact::scheduleCompactionGCForTesting(bool value) { |
| 473 bool current = s_forceCompactionGC; | 473 bool current = s_forceCompactionGC; |
| 474 s_forceCompactionGC = value; | 474 s_forceCompactionGC = value; |
| 475 return current; | 475 return current; |
| 476 } | 476 } |
| 477 | 477 |
| 478 } // namespace blink | 478 } // namespace blink |
| OLD | NEW |