| Index: src/spaces.h
|
| ===================================================================
|
| --- src/spaces.h (revision 8834)
|
| +++ src/spaces.h (working copy)
|
| @@ -413,6 +413,8 @@
|
| // manages a range of virtual memory.
|
| class CodeRange {
|
| public:
|
| + explicit CodeRange(Isolate* isolate);
|
| +
|
| // Reserves a range of virtual memory, but does not commit any of it.
|
| // Can only be called once, at heap initialization time.
|
| // Returns false on failure.
|
| @@ -422,9 +424,9 @@
|
| // manage it.
|
| void TearDown();
|
|
|
| - bool exists() { return code_range_ != NULL; }
|
| + bool exists() { return this != NULL && code_range_ != NULL; }
|
| bool contains(Address address) {
|
| - if (code_range_ == NULL) return false;
|
| + if (this == NULL || code_range_ == NULL) return false;
|
| Address start = static_cast<Address>(code_range_->address());
|
| return start <= address && address < start + code_range_->size();
|
| }
|
| @@ -437,7 +439,7 @@
|
| void FreeRawMemory(void* buf, size_t length);
|
|
|
| private:
|
| - CodeRange();
|
| + Isolate* isolate_;
|
|
|
| // The reserved range of virtual memory that all code objects are put in.
|
| VirtualMemory* code_range_;
|
| @@ -471,10 +473,6 @@
|
| static int CompareFreeBlockAddress(const FreeBlock* left,
|
| const FreeBlock* right);
|
|
|
| - friend class Isolate;
|
| -
|
| - Isolate* isolate_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(CodeRange);
|
| };
|
|
|
| @@ -505,6 +503,8 @@
|
|
|
| class MemoryAllocator {
|
| public:
|
| + explicit MemoryAllocator(Isolate* isolate);
|
| +
|
| // Initializes its internal bookkeeping structures.
|
| // Max capacity of the total space and executable memory limit.
|
| bool Setup(intptr_t max_capacity, intptr_t capacity_executable);
|
| @@ -675,11 +675,11 @@
|
| #endif
|
|
|
| private:
|
| - MemoryAllocator();
|
| -
|
| static const int kChunkSize = kPagesPerChunk * Page::kPageSize;
|
| static const int kChunkSizeLog2 = kPagesPerChunkLog2 + kPageSizeBits;
|
|
|
| + Isolate* isolate_;
|
| +
|
| // Maximum space size in bytes.
|
| intptr_t capacity_;
|
| // Maximum subset of capacity_ that can be executable
|
| @@ -772,10 +772,6 @@
|
| Page* prev,
|
| Page** last_page_in_use);
|
|
|
| - friend class Isolate;
|
| -
|
| - Isolate* isolate_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(MemoryAllocator);
|
| };
|
|
|
|
|