| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // "interior" bitmap. This bitmap is used when moving a backing | 100 // "interior" bitmap. This bitmap is used when moving a backing |
| 101 // store, quickly/ier checking if interior slots will have to | 101 // store, quickly/ier checking if interior slots will have to |
| 102 // be additionally redirected. | 102 // be additionally redirected. |
| 103 addInteriorFixup(slot); | 103 addInteriorFixup(slot); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void addFixupCallback(MovableReference reference, | 106 void addFixupCallback(MovableReference reference, |
| 107 MovingObjectCallback callback, | 107 MovingObjectCallback callback, |
| 108 void* callbackData) { | 108 void* callbackData) { |
| 109 DCHECK(!m_fixupCallbacks.contains(reference)); | 109 DCHECK(!m_fixupCallbacks.contains(reference)); |
| 110 m_fixupCallbacks.insert(reference, std::pair<void*, MovingObjectCallback>( | 110 m_fixupCallbacks.insert( |
| 111 callbackData, callback)); | 111 reference, |
| 112 std::pair<void*, MovingObjectCallback>(callbackData, callback)); |
| 112 } | 113 } |
| 113 | 114 |
| 114 void relocateInteriorFixups(Address from, Address to, size_t size) { | 115 void relocateInteriorFixups(Address from, Address to, size_t size) { |
| 115 SparseHeapBitmap* range = m_interiors->hasRange(from, size); | 116 SparseHeapBitmap* range = m_interiors->hasRange(from, size); |
| 116 if (LIKELY(!range)) | 117 if (LIKELY(!range)) |
| 117 return; | 118 return; |
| 118 | 119 |
| 119 // Scan through the payload, looking for interior pointer slots | 120 // Scan through the payload, looking for interior pointer slots |
| 120 // to adjust. If the backing store of such an interior slot hasn't | 121 // to adjust. If the backing store of such an interior slot hasn't |
| 121 // been moved already, update the slot -> real location mapping. | 122 // been moved already, update the slot -> real location mapping. |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 fixups().addCompactingPage(page); | 455 fixups().addCompactingPage(page); |
| 455 } | 456 } |
| 456 | 457 |
| 457 bool HeapCompact::scheduleCompactionGCForTesting(bool value) { | 458 bool HeapCompact::scheduleCompactionGCForTesting(bool value) { |
| 458 bool current = s_forceCompactionGC; | 459 bool current = s_forceCompactionGC; |
| 459 s_forceCompactionGC = value; | 460 s_forceCompactionGC = value; |
| 460 return current; | 461 return current; |
| 461 } | 462 } |
| 462 | 463 |
| 463 } // namespace blink | 464 } // namespace blink |
| OLD | NEW |