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