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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 330 } |
331 case kFinishedState: | 331 case kFinishedState: |
332 return nullptr; | 332 return nullptr; |
333 default: | 333 default: |
334 break; | 334 break; |
335 } | 335 } |
336 UNREACHABLE(); | 336 UNREACHABLE(); |
337 return nullptr; | 337 return nullptr; |
338 } | 338 } |
339 | 339 |
340 Page* FreeListCategory::page() { | 340 Page* FreeListCategory::page() const { |
341 return Page::FromAddress(reinterpret_cast<Address>(this)); | 341 return Page::FromAddress( |
| 342 reinterpret_cast<Address>(const_cast<FreeListCategory*>(this))); |
| 343 } |
| 344 |
| 345 Page* FreeList::GetPageForCategoryType(FreeListCategoryType type) { |
| 346 return top(type) ? top(type)->page() : nullptr; |
342 } | 347 } |
343 | 348 |
344 FreeList* FreeListCategory::owner() { | 349 FreeList* FreeListCategory::owner() { |
345 return reinterpret_cast<PagedSpace*>( | 350 return reinterpret_cast<PagedSpace*>( |
346 Page::FromAddress(reinterpret_cast<Address>(this))->owner()) | 351 Page::FromAddress(reinterpret_cast<Address>(this))->owner()) |
347 ->free_list(); | 352 ->free_list(); |
348 } | 353 } |
349 | 354 |
350 bool FreeListCategory::is_linked() { | 355 bool FreeListCategory::is_linked() { |
351 return prev_ != nullptr || next_ != nullptr || owner()->top(type_) == this; | 356 return prev_ != nullptr || next_ != nullptr || owner()->top(type_) == this; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 other->allocation_info_.Reset(nullptr, nullptr); | 626 other->allocation_info_.Reset(nullptr, nullptr); |
622 return true; | 627 return true; |
623 } | 628 } |
624 return false; | 629 return false; |
625 } | 630 } |
626 | 631 |
627 } // namespace internal | 632 } // namespace internal |
628 } // namespace v8 | 633 } // namespace v8 |
629 | 634 |
630 #endif // V8_HEAP_SPACES_INL_H_ | 635 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |