| 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/Histogram.h" | 7 #include "platform/Histogram.h" |
| 8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
| 9 #include "platform/heap/Heap.h" | 9 #include "platform/heap/Heap.h" |
| 10 #include "platform/heap/SparseHeapBitmap.h" | 10 #include "platform/heap/SparseHeapBitmap.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 return WTF::wrapUnique(new MovableObjectFixups); | 30 return WTF::wrapUnique(new MovableObjectFixups); |
| 31 } | 31 } |
| 32 | 32 |
| 33 ~MovableObjectFixups() {} | 33 ~MovableObjectFixups() {} |
| 34 | 34 |
| 35 // For the arenas being compacted, record all pages belonging to them. | 35 // For the arenas being compacted, record all pages belonging to them. |
| 36 // This is needed to handle 'interior slots', pointers that themselves | 36 // This is needed to handle 'interior slots', pointers that themselves |
| 37 // can move (independently from the reference the slot points to.) | 37 // can move (independently from the reference the slot points to.) |
| 38 void addCompactingPage(BasePage* page) { | 38 void addCompactingPage(BasePage* page) { |
| 39 DCHECK(!page->isLargeObjectPage()); | 39 DCHECK(!page->isLargeObjectPage()); |
| 40 m_relocatablePages.add(page); | 40 m_relocatablePages.insert(page); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void addInteriorFixup(MovableReference* slot) { | 43 void addInteriorFixup(MovableReference* slot) { |
| 44 auto it = m_interiorFixups.find(slot); | 44 auto it = m_interiorFixups.find(slot); |
| 45 // Ephemeron fixpoint iterations may cause repeated registrations. | 45 // Ephemeron fixpoint iterations may cause repeated registrations. |
| 46 if (UNLIKELY(it != m_interiorFixups.end())) { | 46 if (UNLIKELY(it != m_interiorFixups.end())) { |
| 47 DCHECK(!it->value); | 47 DCHECK(!it->value); |
| 48 return; | 48 return; |
| 49 } | 49 } |
| 50 m_interiorFixups.add(slot, nullptr); | 50 m_interiorFixups.add(slot, nullptr); |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 fixups().addCompactingPage(page); | 458 fixups().addCompactingPage(page); |
| 459 } | 459 } |
| 460 | 460 |
| 461 bool HeapCompact::scheduleCompactionGCForTesting(bool value) { | 461 bool HeapCompact::scheduleCompactionGCForTesting(bool value) { |
| 462 bool current = s_forceCompactionGC; | 462 bool current = s_forceCompactionGC; |
| 463 s_forceCompactionGC = value; | 463 s_forceCompactionGC = value; |
| 464 return current; | 464 return current; |
| 465 } | 465 } |
| 466 | 466 |
| 467 } // namespace blink | 467 } // namespace blink |
| OLD | NEW |