V8 Project
|
#include <spaces.h>
Public Member Functions | |
FreeList (PagedSpace *owner) | |
intptr_t | Concatenate (FreeList *free_list) |
void | Reset () |
intptr_t | available () |
int | Free (Address start, int size_in_bytes) |
MUST_USE_RESULT HeapObject * | Allocate (int size_in_bytes) |
bool | IsEmpty () |
void | RepairLists (Heap *heap) |
intptr_t | EvictFreeListItems (Page *p) |
bool | ContainsPageFreeListItems (Page *p) |
FreeListCategory * | small_list () |
FreeListCategory * | medium_list () |
FreeListCategory * | large_list () |
FreeListCategory * | huge_list () |
Static Public Member Functions | |
static int | GuaranteedAllocatable (int maximum_freed) |
Private Member Functions | |
FreeListNode * | FindNodeFor (int size_in_bytes, int *node_size) |
DISALLOW_IMPLICIT_CONSTRUCTORS (FreeList) | |
Private Attributes | |
PagedSpace * | owner_ |
Heap * | heap_ |
FreeListCategory | small_list_ |
FreeListCategory | medium_list_ |
FreeListCategory | large_list_ |
FreeListCategory | huge_list_ |
Static Private Attributes | |
static const int | kMinBlockSize = 3 * kPointerSize |
static const int | kMaxBlockSize = Page::kMaxRegularHeapObjectSize |
static const int | kSmallListMin = 0x20 * kPointerSize |
static const int | kSmallListMax = 0xff * kPointerSize |
static const int | kMediumListMax = 0x7ff * kPointerSize |
static const int | kLargeListMax = 0x3fff * kPointerSize |
static const int | kSmallAllocationMax = kSmallListMin - kPointerSize |
static const int | kMediumAllocationMax = kSmallListMax |
static const int | kLargeAllocationMax = kMediumListMax |
|
explicit |
HeapObject * v8::internal::FreeList::Allocate | ( | int | size_in_bytes | ) |
Definition at line 2326 of file spaces.cc.
References v8::internal::HeapObject::address(), v8::internal::PagedSpace::Allocate(), DCHECK, FindNodeFor(), v8::internal::PagedSpace::Free(), v8::internal::Smi::FromInt(), v8::internal::Space::heap(), v8::internal::Heap::incremental_marking(), v8::internal::Heap::inline_allocation_disabled(), v8::internal::IsAligned(), v8::internal::IncrementalMarking::IsMarkingIncomplete(), v8::internal::IncrementalMarking::kAllocatedThreshold, v8::internal::kCodeZapValue, kMaxBlockSize, v8::internal::kPointerSize, v8::internal::PagedSpace::limit(), NULL, v8::internal::IncrementalMarking::OldSpaceStep(), owner_, v8::internal::Space::RoundSizeDownToObjectAlignment(), v8::internal::PagedSpace::SetTopAndLimit(), and v8::internal::PagedSpace::top().
Referenced by v8::internal::PagedSpace::AllocateRaw(), v8::internal::PagedSpace::SlowAllocateRaw(), and v8::internal::PagedSpace::WaitForSweeperThreadsAndRetryAllocation().
|
inline |
Definition at line 1525 of file spaces.h.
References v8::internal::FreeListCategory::available(), huge_list_, large_list_, medium_list_, and small_list_.
Referenced by v8::internal::PagedSpace::Available(), FindNodeFor(), Free(), and v8::internal::PagedSpace::SlowAllocateRaw().
intptr_t v8::internal::FreeList::Concatenate | ( | FreeList * | free_list | ) |
Definition at line 2159 of file spaces.cc.
References v8::internal::FreeListCategory::Concatenate(), huge_list(), huge_list_, large_list(), large_list_, medium_list(), medium_list_, small_list(), and small_list_.
Referenced by v8::internal::MarkCompactCollector::SweepInParallel().
Definition at line 2418 of file spaces.cc.
References v8::internal::FreeListCategory::EvictFreeListItemsInList(), huge_list_, large_list_, medium_list_, and small_list_.
Referenced by v8::internal::PagedSpace::FreeEmergencyMemory(), and v8::internal::PagedSpace::ReleasePage().
|
private |
intptr_t v8::internal::FreeList::EvictFreeListItems | ( | Page * | p | ) |
Definition at line 2401 of file spaces.cc.
References v8::internal::FreeListCategory::EvictFreeListItemsInList(), huge_list_, large_list_, medium_list_, and small_list_.
Referenced by v8::internal::PagedSpace::ReleasePage().
|
private |
Definition at line 2211 of file spaces.cc.
References v8::internal::HeapObject::address(), available(), v8::internal::FreeListCategory::available(), DCHECK, v8::internal::MemoryChunk::FromAddress(), heap_, huge_list_, v8::internal::MemoryChunk::IsEvacuationCandidate(), kLargeAllocationMax, kLargeListMax, kMediumAllocationMax, kMediumListMax, kSmallAllocationMax, kSmallListMax, large_list_, medium_list_, v8::internal::FreeListNode::next(), NULL, v8::internal::FreeListCategory::PickNodeFromList(), v8::internal::FreeListCategory::set_available(), v8::internal::FreeListCategory::set_end(), v8::internal::FreeListCategory::set_top(), size, v8::internal::FreeSpace::Size(), small_list_, and v8::internal::FreeListCategory::top().
Referenced by Allocate().
Definition at line 2177 of file spaces.cc.
References available(), DCHECK, v8::internal::FreeListCategory::Free(), v8::internal::MemoryChunk::FromAddress(), v8::internal::FreeListNode::FromAddress(), heap_, huge_list_, kLargeListMax, kMediumListMax, kSmallListMax, kSmallListMin, large_list_, medium_list_, v8::internal::FreeListNode::set_size(), and small_list_.
Referenced by v8::internal::PagedSpace::Free(), and v8::internal::Free().
Definition at line 1540 of file spaces.h.
References kLargeAllocationMax, kLargeListMax, kMediumAllocationMax, kMediumListMax, kSmallAllocationMax, kSmallListMax, and kSmallListMin.
Referenced by v8::internal::Sweep().
|
inline |
Definition at line 1579 of file spaces.h.
References huge_list_.
Referenced by Concatenate().
|
inline |
Definition at line 1559 of file spaces.h.
References huge_list_, v8::internal::FreeListCategory::IsEmpty(), large_list_, medium_list_, and small_list_.
|
inline |
Definition at line 1578 of file spaces.h.
References large_list_.
Referenced by Concatenate().
|
inline |
Definition at line 1577 of file spaces.h.
References medium_list_.
Referenced by Concatenate().
void v8::internal::FreeList::RepairLists | ( | Heap * | heap | ) |
Definition at line 2426 of file spaces.cc.
References huge_list_, large_list_, medium_list_, v8::internal::FreeListCategory::RepairFreeList(), and small_list_.
Referenced by v8::internal::PagedSpace::RepairFreeListsAfterBoot().
void v8::internal::FreeList::Reset | ( | ) |
Definition at line 2169 of file spaces.cc.
References huge_list_, large_list_, medium_list_, v8::internal::FreeListCategory::Reset(), and small_list_.
Referenced by FreeList(), v8::internal::PagedSpace::PrepareForMarkCompact(), and v8::internal::PagedSpace::ResetFreeList().
|
inline |
Definition at line 1576 of file spaces.h.
References small_list_.
Referenced by Concatenate().
|
private |
Definition at line 1589 of file spaces.h.
Referenced by FindNodeFor(), and Free().
|
private |
Definition at line 1601 of file spaces.h.
Referenced by available(), Concatenate(), ContainsPageFreeListItems(), EvictFreeListItems(), FindNodeFor(), Free(), huge_list(), IsEmpty(), RepairLists(), and Reset().
|
staticprivate |
Definition at line 1597 of file spaces.h.
Referenced by FindNodeFor(), and GuaranteedAllocatable().
|
staticprivate |
Definition at line 1594 of file spaces.h.
Referenced by FindNodeFor(), Free(), and GuaranteedAllocatable().
|
staticprivate |
Definition at line 1584 of file spaces.h.
Referenced by Allocate().
|
staticprivate |
Definition at line 1596 of file spaces.h.
Referenced by FindNodeFor(), and GuaranteedAllocatable().
|
staticprivate |
Definition at line 1593 of file spaces.h.
Referenced by FindNodeFor(), Free(), and GuaranteedAllocatable().
|
staticprivate |
|
staticprivate |
Definition at line 1595 of file spaces.h.
Referenced by FindNodeFor(), and GuaranteedAllocatable().
|
staticprivate |
Definition at line 1592 of file spaces.h.
Referenced by FindNodeFor(), Free(), and GuaranteedAllocatable().
|
staticprivate |
Definition at line 1591 of file spaces.h.
Referenced by Free(), and GuaranteedAllocatable().
|
private |
Definition at line 1600 of file spaces.h.
Referenced by available(), Concatenate(), ContainsPageFreeListItems(), EvictFreeListItems(), FindNodeFor(), Free(), IsEmpty(), large_list(), RepairLists(), and Reset().
|
private |
Definition at line 1599 of file spaces.h.
Referenced by available(), Concatenate(), ContainsPageFreeListItems(), EvictFreeListItems(), FindNodeFor(), Free(), IsEmpty(), medium_list(), RepairLists(), and Reset().
|
private |
Definition at line 1588 of file spaces.h.
Referenced by Allocate().
|
private |
Definition at line 1598 of file spaces.h.
Referenced by available(), Concatenate(), ContainsPageFreeListItems(), EvictFreeListItems(), FindNodeFor(), Free(), IsEmpty(), RepairLists(), Reset(), and small_list().