OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PagePool.h" | 5 #include "platform/heap/PagePool.h" |
6 | 6 |
7 #include "platform/heap/Heap.h" | 7 #include "platform/heap/Heap.h" |
8 #include "platform/heap/PageMemory.h" | 8 #include "platform/heap/PageMemory.h" |
9 #include "wtf/Assertions.h" | 9 #include "wtf/Assertions.h" |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // pages are reused. | 94 // pages are reused. |
95 // NOTE: We call the destructor before freeing or adding to the | 95 // NOTE: We call the destructor before freeing or adding to the |
96 // free page pool. | 96 // free page pool. |
97 PageMemory* memory = page->storage(); | 97 PageMemory* memory = page->storage(); |
98 if (page->isLargeObjectPage()) { | 98 if (page->isLargeObjectPage()) { |
99 page->~BasePage(); | 99 page->~BasePage(); |
100 delete memory; | 100 delete memory; |
101 } else { | 101 } else { |
102 page->~BasePage(); | 102 page->~BasePage(); |
103 clearMemory(memory); | 103 clearMemory(memory); |
104 Heap::getFreePagePool()->addFreePage(index, memory); | 104 ThreadHeap::getFreePagePool()->addFreePage(index, memory); |
105 } | 105 } |
106 | 106 |
107 PoolEntry* deadEntry = entry; | 107 PoolEntry* deadEntry = entry; |
108 entry = entry->next; | 108 entry = entry->next; |
109 *prevNext = entry; | 109 *prevNext = entry; |
110 delete deadEntry; | 110 delete deadEntry; |
111 } | 111 } |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
(...skipping 29 matching lines...) Expand all Loading... |
144 BasePage* page = entry->data; | 144 BasePage* page = entry->data; |
145 if (page->contains(reinterpret_cast<Address>(object))) | 145 if (page->contains(reinterpret_cast<Address>(object))) |
146 return true; | 146 return true; |
147 } | 147 } |
148 } | 148 } |
149 return false; | 149 return false; |
150 } | 150 } |
151 #endif | 151 #endif |
152 | 152 |
153 } // namespace blink | 153 } // namespace blink |
OLD | NEW |