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 #ifndef SparseHeapBitmap_h | 5 #ifndef SparseHeapBitmap_h |
6 #define SparseHeapBitmap_h | 6 #define SparseHeapBitmap_h |
7 | 7 |
| 8 #include <bitset> |
| 9 #include <memory> |
8 #include "platform/heap/BlinkGC.h" | 10 #include "platform/heap/BlinkGC.h" |
9 #include "platform/heap/HeapPage.h" | 11 #include "platform/heap/HeapPage.h" |
10 #include "wtf/Alignment.h" | 12 #include "wtf/Alignment.h" |
11 #include "wtf/PtrUtil.h" | 13 #include "wtf/PtrUtil.h" |
12 #include <bitset> | |
13 #include <memory> | |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 // A sparse bitmap of heap addresses where the (very few) addresses that are | 17 // A sparse bitmap of heap addresses where the (very few) addresses that are |
18 // set are likely to be in small clusters. The abstraction is tailored to | 18 // set are likely to be in small clusters. The abstraction is tailored to |
19 // support heap compaction, assuming the following: | 19 // support heap compaction, assuming the following: |
20 // | 20 // |
21 // - Addresses will be bitmap-marked from lower to higher addresses. | 21 // - Addresses will be bitmap-marked from lower to higher addresses. |
22 // - Bitmap lookups are performed for each object that is compacted | 22 // - Bitmap lookups are performed for each object that is compacted |
23 // and moved to some new location, supplying the (base, size) | 23 // and moved to some new location, supplying the (base, size) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // If non-null, contains a bitmap for addresses within [m_base, m_size) | 127 // If non-null, contains a bitmap for addresses within [m_base, m_size) |
128 std::unique_ptr<std::bitset<s_bitmapChunkSize>> m_bitmap; | 128 std::unique_ptr<std::bitset<s_bitmapChunkSize>> m_bitmap; |
129 | 129 |
130 std::unique_ptr<SparseHeapBitmap> m_left; | 130 std::unique_ptr<SparseHeapBitmap> m_left; |
131 std::unique_ptr<SparseHeapBitmap> m_right; | 131 std::unique_ptr<SparseHeapBitmap> m_right; |
132 }; | 132 }; |
133 | 133 |
134 } // namespace blink | 134 } // namespace blink |
135 | 135 |
136 #endif // SparseHeapBitmap_h | 136 #endif // SparseHeapBitmap_h |
OLD | NEW |