Index: src/spaces.h |
=================================================================== |
--- src/spaces.h (revision 5544) |
+++ src/spaces.h (working copy) |
@@ -371,7 +371,7 @@ |
// Identity used in error reporting. |
AllocationSpace identity() { return id_; } |
- virtual intptr_t Size() = 0; |
+ virtual int Size() = 0; |
#ifdef ENABLE_HEAP_PROTECTION |
// Protect/unprotect the space by marking it read-only/writable. |
@@ -491,7 +491,7 @@ |
public: |
// Initializes its internal bookkeeping structures. |
// Max capacity of the total space. |
- static bool Setup(intptr_t max_capacity); |
+ static bool Setup(int max_capacity); |
// Deletes valid chunks. |
static void TearDown(); |
@@ -582,18 +582,16 @@ |
MemoryAllocationCallback callback); |
// Returns the maximum available bytes of heaps. |
- static intptr_t Available() { |
- return capacity_ < size_ ? 0 : capacity_ - size_; |
- } |
+ static int Available() { return capacity_ < size_ ? 0 : capacity_ - size_; } |
// Returns allocated spaces in bytes. |
- static intptr_t Size() { return size_; } |
+ static int Size() { return size_; } |
// Returns allocated executable spaces in bytes. |
- static intptr_t SizeExecutable() { return size_executable_; } |
+ static int SizeExecutable() { return size_executable_; } |
// Returns maximum available bytes that the old space can have. |
- static intptr_t MaxAvailable() { |
+ static int MaxAvailable() { |
return (Available() / Page::kPageSize) * Page::kObjectAreaSize; |
} |
@@ -651,12 +649,12 @@ |
private: |
// Maximum space size in bytes. |
- static intptr_t capacity_; |
+ static int capacity_; |
// Allocated space size in bytes. |
- static intptr_t size_; |
+ static int size_; |
// Allocated executable space size in bytes. |
- static intptr_t size_executable_; |
+ static int size_executable_; |
struct MemoryAllocationCallbackRegistration { |
MemoryAllocationCallbackRegistration(MemoryAllocationCallback callback, |
@@ -929,10 +927,10 @@ |
} |
// Accessors for the allocation statistics. |
- intptr_t Capacity() { return capacity_; } |
- intptr_t Available() { return available_; } |
- intptr_t Size() { return size_; } |
- intptr_t Waste() { return waste_; } |
+ int Capacity() { return capacity_; } |
+ int Available() { return available_; } |
+ int Size() { return size_; } |
+ int Waste() { return waste_; } |
// Grow the space by adding available bytes. |
void ExpandSpace(int size_in_bytes) { |
@@ -953,7 +951,7 @@ |
} |
// Free allocated bytes, making them available (size -> available). |
- void DeallocateBytes(intptr_t size_in_bytes) { |
+ void DeallocateBytes(int size_in_bytes) { |
size_ -= size_in_bytes; |
available_ += size_in_bytes; |
} |
@@ -972,19 +970,17 @@ |
} |
private: |
- intptr_t capacity_; |
- intptr_t available_; |
- intptr_t size_; |
- intptr_t waste_; |
+ int capacity_; |
+ int available_; |
+ int size_; |
+ int waste_; |
}; |
class PagedSpace : public Space { |
public: |
// Creates a space with a maximum capacity, and an id. |
- PagedSpace(intptr_t max_capacity, |
- AllocationSpace id, |
- Executability executable); |
+ PagedSpace(int max_capacity, AllocationSpace id, Executability executable); |
virtual ~PagedSpace() {} |
@@ -1035,21 +1031,21 @@ |
} |
// Current capacity without growing (Size() + Available() + Waste()). |
- intptr_t Capacity() { return accounting_stats_.Capacity(); } |
+ int Capacity() { return accounting_stats_.Capacity(); } |
// Total amount of memory committed for this space. For paged |
// spaces this equals the capacity. |
- intptr_t CommittedMemory() { return Capacity(); } |
+ int CommittedMemory() { return Capacity(); } |
// Available bytes without growing. |
- intptr_t Available() { return accounting_stats_.Available(); } |
+ int Available() { return accounting_stats_.Available(); } |
// Allocated bytes in this space. |
- virtual intptr_t Size() { return accounting_stats_.Size(); } |
+ virtual int Size() { return accounting_stats_.Size(); } |
// Wasted bytes due to fragmentation and not recoverable until the |
// next GC of this space. |
- intptr_t Waste() { return accounting_stats_.Waste(); } |
+ int Waste() { return accounting_stats_.Waste(); } |
// Returns the address of the first object in this space. |
Address bottom() { return first_page_->ObjectAreaStart(); } |
@@ -1332,7 +1328,7 @@ |
// If we don't have these here then SemiSpace will be abstract. However |
// they should never be called. |
- virtual intptr_t Size() { |
+ virtual int Size() { |
UNREACHABLE(); |
return 0; |
} |
@@ -1358,7 +1354,7 @@ |
#endif |
// Returns the current capacity of the semi space. |
- intptr_t Capacity() { return capacity_; } |
+ int Capacity() { return capacity_; } |
// Returns the maximum capacity of the semi space. |
int MaximumCapacity() { return maximum_capacity_; } |
@@ -1475,22 +1471,22 @@ |
} |
// Return the allocated bytes in the active semispace. |
- virtual intptr_t Size() { return static_cast<int>(top() - bottom()); } |
+ virtual int Size() { return static_cast<int>(top() - bottom()); } |
// Return the current capacity of a semispace. |
- intptr_t Capacity() { |
+ int Capacity() { |
ASSERT(to_space_.Capacity() == from_space_.Capacity()); |
return to_space_.Capacity(); |
} |
// Return the total amount of memory committed for new space. |
- intptr_t CommittedMemory() { |
+ int CommittedMemory() { |
if (from_space_.is_committed()) return 2 * Capacity(); |
return Capacity(); |
} |
// Return the available bytes without growing in the active semispace. |
- intptr_t Available() { return Capacity() - Size(); } |
+ int Available() { return Capacity() - Size(); } |
// Return the maximum capacity of a semispace. |
int MaximumCapacity() { |
@@ -1499,7 +1495,7 @@ |
} |
// Returns the initial capacity of a semispace. |
- intptr_t InitialCapacity() { |
+ int InitialCapacity() { |
ASSERT(to_space_.InitialCapacity() == from_space_.InitialCapacity()); |
return to_space_.InitialCapacity(); |
} |
@@ -1685,7 +1681,7 @@ |
void Reset(); |
// Return the number of bytes available on the free list. |
- intptr_t available() { return available_; } |
+ int available() { return available_; } |
// Place a node on the free list. The block of size 'size_in_bytes' |
// starting at 'start' is placed on the free list. The return value is the |
@@ -1787,7 +1783,7 @@ |
void Reset(); |
// Return the number of bytes available on the free list. |
- intptr_t available() { return available_; } |
+ int available() { return available_; } |
// Place a node on the free list. The block starting at 'start' (assumed to |
// have size object_size_) is placed on the free list. Bookkeeping |
@@ -1801,7 +1797,7 @@ |
private: |
// Available bytes on the free list. |
- intptr_t available_; |
+ int available_; |
// The head of the free list. |
Address head_; |
@@ -1836,7 +1832,7 @@ |
// The bytes available on the free list (ie, not above the linear allocation |
// pointer). |
- intptr_t AvailableFree() { return free_list_.available(); } |
+ int AvailableFree() { return free_list_.available(); } |
// The limit of allocation for a page in this space. |
virtual Address PageAllocationLimit(Page* page) { |
@@ -2133,7 +2129,7 @@ |
// Given a chunk size, returns the object size it can accommodate. Used by |
// LargeObjectSpace::Available. |
- static intptr_t ObjectSizeFor(intptr_t chunk_size) { |
+ static int ObjectSizeFor(int chunk_size) { |
if (chunk_size <= (Page::kPageSize + Page::kObjectStartOffset)) return 0; |
return chunk_size - Page::kPageSize - Page::kObjectStartOffset; |
} |
@@ -2169,11 +2165,11 @@ |
Object* AllocateRawFixedArray(int size_in_bytes); |
// Available bytes for objects in this space. |
- intptr_t Available() { |
+ int Available() { |
return LargeObjectChunk::ObjectSizeFor(MemoryAllocator::Available()); |
} |
- virtual intptr_t Size() { |
+ virtual int Size() { |
return size_; |
} |
@@ -2227,7 +2223,7 @@ |
private: |
// The head of the linked list of large object chunks. |
LargeObjectChunk* first_chunk_; |
- intptr_t size_; // allocated bytes |
+ int size_; // allocated bytes |
int page_count_; // number of chunks |