V8 Project
v8::internal::MapSpace Class Reference

#include <spaces.h>

+ Inheritance diagram for v8::internal::MapSpace:
+ Collaboration diagram for v8::internal::MapSpace:

Public Member Functions

 MapSpace (Heap *heap, intptr_t max_capacity, AllocationSpace id)
 
virtual int RoundSizeDownToObjectAlignment (int size)
 
- Public Member Functions inherited from v8::internal::PagedSpace
 PagedSpace (Heap *heap, intptr_t max_capacity, AllocationSpace id, Executability executable)
 
virtual ~PagedSpace ()
 
bool SetUp ()
 
bool HasBeenSetUp ()
 
void TearDown ()
 
bool Contains (Address a)
 
bool Contains (HeapObject *o)
 
ObjectFindObject (Address addr)
 
void RepairFreeListsAfterBoot ()
 
void PrepareForMarkCompact ()
 
intptr_t Capacity ()
 
intptr_t CommittedMemory ()
 
intptr_t MaximumCommittedMemory ()
 
size_t CommittedPhysicalMemory ()
 
void ObtainFreeListStatistics (Page *p, SizeStats *sizes)
 
void ResetFreeListStatistics ()
 
void ClearStats ()
 
void AddToAccountingStats (intptr_t bytes)
 
intptr_t Available ()
 
virtual intptr_t Size ()
 
virtual intptr_t SizeOfObjects ()
 
virtual intptr_t Waste ()
 
Address top ()
 
Address limit ()
 
Addressallocation_top_address ()
 
Addressallocation_limit_address ()
 
MUST_USE_RESULT AllocationResult AllocateRaw (int size_in_bytes)
 
int Free (Address start, int size_in_bytes)
 
void ResetFreeList ()
 
void SetTopAndLimit (Address top, Address limit)
 
void EmptyAllocationInfo ()
 
void Allocate (int bytes)
 
void IncreaseCapacity (int size)
 
void ReleasePage (Page *page)
 
Pageanchor ()
 
void IncrementUnsweptFreeBytes (intptr_t by)
 
void IncreaseUnsweptFreeBytes (Page *p)
 
void DecrementUnsweptFreeBytes (intptr_t by)
 
void DecreaseUnsweptFreeBytes (Page *p)
 
void ResetUnsweptFreeBytes ()
 
bool EnsureSweeperProgress (intptr_t size_in_bytes)
 
void set_end_of_unswept_pages (Page *page)
 
Pageend_of_unswept_pages ()
 
PageFirstPage ()
 
PageLastPage ()
 
void EvictEvacuationCandidatesFromFreeLists ()
 
bool CanExpand ()
 
int CountTotalPages ()
 
int AreaSize ()
 
void CreateEmergencyMemory ()
 
void FreeEmergencyMemory ()
 
void UseEmergencyMemory ()
 
bool HasEmergencyMemory ()
 
- Public Member Functions inherited from v8::internal::Space
 Space (Heap *heap, AllocationSpace id, Executability executable)
 
virtual ~Space ()
 
Heapheap () const
 
Executability executable ()
 
AllocationSpace identity ()
 
- Public Member Functions inherited from v8::internal::Malloced
void * operator new (size_t size)
 
void operator delete (void *p)
 

Static Public Attributes

static const int kMaxMapPageIndex = 1 << 16
 

Protected Member Functions

virtual void VerifyObject (HeapObject *obj)
 
- Protected Member Functions inherited from v8::internal::PagedSpace
FreeListfree_list ()
 
intptr_t SizeOfFirstPage ()
 
bool Expand ()
 
HeapObjectAllocateLinearly (int size_in_bytes)
 
MUST_USE_RESULT HeapObjectWaitForSweeperThreadsAndRetryAllocation (int size_in_bytes)
 
MUST_USE_RESULT HeapObjectSlowAllocateRaw (int size_in_bytes)
 

Private Member Functions

int CompactionThreshold ()
 

Private Attributes

const int max_map_space_pages_
 

Static Private Attributes

static const int kMapsPerPage = Page::kMaxRegularHeapObjectSize / Map::kSize
 

Additional Inherited Members

- Static Public Member Functions inherited from v8::internal::PagedSpace
static bool ShouldBeSweptBySweeperThreads (Page *p)
 
- Static Public Member Functions inherited from v8::internal::Malloced
static void FatalProcessOutOfMemory ()
 
static void * New (size_t size)
 
static void Delete (void *p)
 
- Protected Attributes inherited from v8::internal::PagedSpace
int area_size_
 
intptr_t max_capacity_
 
AllocationStats accounting_stats_
 
Page anchor_
 
FreeList free_list_
 
AllocationInfo allocation_info_
 
intptr_t unswept_free_bytes_
 
Pageend_of_unswept_pages_
 
MemoryChunkemergency_memory_
 

Detailed Description

Definition at line 2620 of file spaces.h.

Constructor & Destructor Documentation

◆ MapSpace()

v8::internal::MapSpace::MapSpace ( Heap heap,
intptr_t  max_capacity,
AllocationSpace  id 
)
inline

Definition at line 2623 of file spaces.h.

2624  : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE),
static const int kMaxMapPageIndex
Definition: spaces.h:2629
const int max_map_space_pages_
Definition: spaces.h:2650
PagedSpace(Heap *heap, intptr_t max_capacity, AllocationSpace id, Executability executable)
Definition: spaces.cc:880
Heap * heap() const
Definition: spaces.h:823
@ NOT_EXECUTABLE
Definition: globals.h:391

Member Function Documentation

◆ CompactionThreshold()

int v8::internal::MapSpace::CompactionThreshold ( )
inlineprivate

Definition at line 2646 of file spaces.h.

2646  {
2647  return kMapsPerPage * (max_map_space_pages_ - 1);
2648  }
static const int kMapsPerPage
Definition: spaces.h:2643

References kMapsPerPage, and max_map_space_pages_.

◆ RoundSizeDownToObjectAlignment()

virtual int v8::internal::MapSpace::RoundSizeDownToObjectAlignment ( int  size)
inlinevirtual

Reimplemented from v8::internal::Space.

Definition at line 2631 of file spaces.h.

2631  {
2633  return RoundDown(size, Map::kSize);
2634  } else {
2635  return (size / Map::kSize) * Map::kSize;
2636  }
2637  }
static const int kSize
Definition: objects.h:6202
enable harmony numeric enable harmony object literal extensions Optimize object size
T RoundDown(T x, intptr_t m)
Definition: macros.h:399
bool IsPowerOfTwo32(uint32_t value)
Definition: bits.h:77

References v8::base::bits::IsPowerOfTwo32(), v8::internal::Map::kSize, RoundDown(), and size.

+ Here is the call graph for this function:

◆ VerifyObject()

void v8::internal::MapSpace::VerifyObject ( HeapObject obj)
protectedvirtual

Definition at line 2750 of file spaces.cc.

2750 { CHECK(object->IsMap()); }
#define CHECK(condition)
Definition: logging.h:36

References CHECK.

Member Data Documentation

◆ kMapsPerPage

const int v8::internal::MapSpace::kMapsPerPage = Page::kMaxRegularHeapObjectSize / Map::kSize
staticprivate

Definition at line 2643 of file spaces.h.

Referenced by CompactionThreshold().

◆ kMaxMapPageIndex

const int v8::internal::MapSpace::kMaxMapPageIndex = 1 << 16
static

Definition at line 2629 of file spaces.h.

◆ max_map_space_pages_

const int v8::internal::MapSpace::max_map_space_pages_
private

Definition at line 2650 of file spaces.h.

Referenced by CompactionThreshold().


The documentation for this class was generated from the following files: