OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project 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 V8_HEAP_SPACES_INL_H_ | 5 #ifndef V8_HEAP_SPACES_INL_H_ |
6 #define V8_HEAP_SPACES_INL_H_ | 6 #define V8_HEAP_SPACES_INL_H_ |
7 | 7 |
8 #include "src/heap/incremental-marking.h" | 8 #include "src/heap/incremental-marking.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 }); | 272 }); |
273 } | 273 } |
274 | 274 |
275 intptr_t PagedSpace::RelinkFreeListCategories(Page* page) { | 275 intptr_t PagedSpace::RelinkFreeListCategories(Page* page) { |
276 DCHECK_EQ(this, page->owner()); | 276 DCHECK_EQ(this, page->owner()); |
277 intptr_t added = 0; | 277 intptr_t added = 0; |
278 page->ForAllFreeListCategories([&added](FreeListCategory* category) { | 278 page->ForAllFreeListCategories([&added](FreeListCategory* category) { |
279 added += category->available(); | 279 added += category->available(); |
280 category->Relink(); | 280 category->Relink(); |
281 }); | 281 }); |
| 282 DCHECK_EQ(page->AvailableInFreeList(), page->available_in_free_list()); |
282 return added; | 283 return added; |
283 } | 284 } |
284 | 285 |
285 MemoryChunk* MemoryChunk::FromAnyPointerAddress(Heap* heap, Address addr) { | 286 MemoryChunk* MemoryChunk::FromAnyPointerAddress(Heap* heap, Address addr) { |
286 MemoryChunk* chunk = MemoryChunk::FromAddress(addr); | 287 MemoryChunk* chunk = MemoryChunk::FromAddress(addr); |
287 uintptr_t offset = addr - chunk->address(); | 288 uintptr_t offset = addr - chunk->address(); |
288 if (offset < MemoryChunk::kHeaderSize || !chunk->HasPageHeader()) { | 289 if (offset < MemoryChunk::kHeaderSize || !chunk->HasPageHeader()) { |
289 chunk = heap->lo_space()->FindPage(addr); | 290 chunk = heap->lo_space()->FindPage(addr); |
290 } | 291 } |
291 return chunk; | 292 return chunk; |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 other->allocation_info_.Reset(nullptr, nullptr); | 628 other->allocation_info_.Reset(nullptr, nullptr); |
628 return true; | 629 return true; |
629 } | 630 } |
630 return false; | 631 return false; |
631 } | 632 } |
632 | 633 |
633 } // namespace internal | 634 } // namespace internal |
634 } // namespace v8 | 635 } // namespace v8 |
635 | 636 |
636 #endif // V8_HEAP_SPACES_INL_H_ | 637 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |