V8 Project
v8::internal::CellSpace Class Reference

#include <spaces.h>

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

Public Member Functions

 CellSpace (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)
 

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)
 

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 2660 of file spaces.h.

Constructor & Destructor Documentation

◆ CellSpace()

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

Definition at line 2663 of file spaces.h.

2664  : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE) {}
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

◆ RoundSizeDownToObjectAlignment()

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

Reimplemented from v8::internal::Space.

Definition at line 2666 of file spaces.h.

2666  {
2668  return RoundDown(size, Cell::kSize);
2669  } else {
2670  return (size / Cell::kSize) * Cell::kSize;
2671  }
2672  }
static const int kSize
Definition: objects.h:9447
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::Cell::kSize, RoundDown(), and size.

+ Here is the call graph for this function:

◆ VerifyObject()

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

Definition at line 2759 of file spaces.cc.

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

References CHECK.


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