Index: src/spaces.h |
=================================================================== |
--- src/spaces.h (revision 5846) |
+++ src/spaces.h (working copy) |
@@ -371,8 +371,13 @@ |
// Identity used in error reporting. |
AllocationSpace identity() { return id_; } |
+ // Returns allocated size. |
virtual intptr_t Size() = 0; |
+ // Returns size of objects. Can differ from the allocated size |
+ // (e.g. see LargeObjectSpace). |
+ virtual intptr_t SizeOfObjects() { return Size(); } |
+ |
#ifdef ENABLE_HEAP_PROTECTION |
// Protect/unprotect the space by marking it read-only/writable. |
virtual void Protect() = 0; |
@@ -591,7 +596,7 @@ |
static intptr_t Size() { return size_; } |
// Returns the maximum available executable bytes of heaps. |
- static int AvailableExecutable() { |
+ static intptr_t AvailableExecutable() { |
if (capacity_executable_ < size_executable_) return 0; |
return capacity_executable_ - size_executable_; |
} |
@@ -1715,6 +1720,8 @@ |
// 'wasted_bytes'. The size should be a non-zero multiple of the word size. |
MUST_USE_RESULT MaybeObject* Allocate(int size_in_bytes, int* wasted_bytes); |
+ void MarkNodes(); |
+ |
private: |
// The size range of blocks, in bytes. (Smaller allocations are allowed, but |
// will always result in waste.) |
@@ -1813,6 +1820,8 @@ |
// A failure is returned if no block is available. |
MUST_USE_RESULT MaybeObject* Allocate(); |
+ void MarkNodes(); |
+ |
private: |
// Available bytes on the free list. |
intptr_t available_; |
@@ -1884,6 +1893,8 @@ |
virtual void PutRestOfCurrentPageOnFreeList(Page* current_page); |
+ void MarkFreeListNodes() { free_list_.MarkNodes(); } |
+ |
#ifdef DEBUG |
// Reports statistics for the space |
void ReportStatistics(); |
@@ -1951,6 +1962,9 @@ |
virtual void DeallocateBlock(Address start, |
int size_in_bytes, |
bool add_to_freelist); |
+ |
+ void MarkFreeListNodes() { free_list_.MarkNodes(); } |
+ |
#ifdef DEBUG |
// Reports statistic info of the space |
void ReportStatistics(); |
@@ -2191,6 +2205,10 @@ |
return size_; |
} |
+ virtual intptr_t SizeOfObjects() { |
+ return objects_size_; |
+ } |
+ |
int PageCount() { |
return page_count_; |
} |
@@ -2242,8 +2260,8 @@ |
LargeObjectChunk* first_chunk_; |
intptr_t size_; // allocated bytes |
int page_count_; // number of chunks |
+ intptr_t objects_size_; // size of objects |
- |
// Shared implementation of AllocateRaw, AllocateRawCode and |
// AllocateRawFixedArray. |
MUST_USE_RESULT MaybeObject* AllocateRawInternal(int requested_size, |