| Index: src/spaces.h
|
| diff --git a/src/spaces.h b/src/spaces.h
|
| index 36d3f20054ef9b62b9d82aca98175ad222132cbe..3012bd10e64e778ebcede0564fa448a98feb380d 100644
|
| --- a/src/spaces.h
|
| +++ b/src/spaces.h
|
| @@ -751,6 +751,8 @@ class Space : public Malloced {
|
| // 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.
|
| @@ -760,9 +762,9 @@ class CodeRange {
|
| // 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();
|
| }
|
| @@ -775,7 +777,7 @@ class CodeRange {
|
| void FreeRawMemory(Address buf, size_t length);
|
|
|
| private:
|
| - CodeRange();
|
| + Isolate* isolate_;
|
|
|
| // The reserved range of virtual memory that all code objects are put in.
|
| VirtualMemory* code_range_;
|
| @@ -815,10 +817,6 @@ class CodeRange {
|
| static int CompareFreeBlockAddress(const FreeBlock* left,
|
| const FreeBlock* right);
|
|
|
| - friend class Isolate;
|
| -
|
| - Isolate* isolate_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(CodeRange);
|
| };
|
|
|
| @@ -832,6 +830,8 @@ class CodeRange {
|
| //
|
| 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);
|
| @@ -918,9 +918,9 @@ class MemoryAllocator {
|
|
|
|
|
| // TODO(gc) ISOLATSE
|
| - Isolate* isolate_;
|
|
|
| private:
|
| + Isolate* isolate_;
|
|
|
| // Maximum space size in bytes.
|
| size_t capacity_;
|
| @@ -953,6 +953,8 @@ class MemoryAllocator {
|
| // used as a marking stack and its page headers are destroyed.
|
| Page* InitializePagesInChunk(int chunk_id, int pages_in_chunk,
|
| PagedSpace* owner);
|
| +
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(MemoryAllocator);
|
| };
|
|
|
|
|
|
|