| Index: src/spaces.h
|
| diff --git a/src/spaces.h b/src/spaces.h
|
| index 10a803e2ea24ac8f1847884374590e3a4e2dd874..1ccdacbc02e32eecd93c72a96d5edaf4a8d868dd 100644
|
| --- a/src/spaces.h
|
| +++ b/src/spaces.h
|
| @@ -33,7 +33,6 @@
|
| #include "list.h"
|
| #include "log.h"
|
| #include "platform/mutex.h"
|
| -#include "platform/virtual-memory.h"
|
| #include "v8utils.h"
|
|
|
| namespace v8 {
|
| @@ -574,10 +573,8 @@ class MemoryChunk {
|
| area_end_ = area_end;
|
| }
|
|
|
| - VirtualMemory::Executability executability() {
|
| - return IsFlagSet(IS_EXECUTABLE)
|
| - ? VirtualMemory::EXECUTABLE
|
| - : VirtualMemory::NOT_EXECUTABLE;
|
| + Executability executable() {
|
| + return IsFlagSet(IS_EXECUTABLE) ? EXECUTABLE : NOT_EXECUTABLE;
|
| }
|
|
|
| bool ContainsOnlyData() {
|
| @@ -719,7 +716,7 @@ class MemoryChunk {
|
| size_t size,
|
| Address area_start,
|
| Address area_end,
|
| - VirtualMemory::Executability executability,
|
| + Executability executable,
|
| Space* owner);
|
|
|
| friend class MemoryAllocator;
|
| @@ -799,7 +796,7 @@ class Page : public MemoryChunk {
|
|
|
| static inline Page* Initialize(Heap* heap,
|
| MemoryChunk* chunk,
|
| - VirtualMemory::Executability executable,
|
| + Executability executable,
|
| PagedSpace* owner);
|
|
|
| void InitializeAsAnchor(PagedSpace* owner);
|
| @@ -865,17 +862,15 @@ STATIC_CHECK(sizeof(LargePage) <= MemoryChunk::kHeaderSize);
|
| // Space is the abstract superclass for all allocation spaces.
|
| class Space : public Malloced {
|
| public:
|
| - Space(Heap* heap,
|
| - AllocationSpace id,
|
| - VirtualMemory::Executability executability)
|
| - : heap_(heap), id_(id), executability_(executability) {}
|
| + Space(Heap* heap, AllocationSpace id, Executability executable)
|
| + : heap_(heap), id_(id), executable_(executable) {}
|
|
|
| virtual ~Space() {}
|
|
|
| Heap* heap() const { return heap_; }
|
|
|
| // Does the space need executable memory?
|
| - VirtualMemory::Executability executability() { return executability_; }
|
| + Executability executable() { return executable_; }
|
|
|
| // Identity used in error reporting.
|
| AllocationSpace identity() { return id_; }
|
| @@ -902,7 +897,7 @@ class Space : public Malloced {
|
| private:
|
| Heap* heap_;
|
| AllocationSpace id_;
|
| - VirtualMemory::Executability executability_;
|
| + Executability executable_;
|
| };
|
|
|
|
|
| @@ -1060,13 +1055,11 @@ class MemoryAllocator {
|
|
|
| void TearDown();
|
|
|
| - Page* AllocatePage(intptr_t size,
|
| - PagedSpace* owner,
|
| - VirtualMemory::Executability executability);
|
| + Page* AllocatePage(
|
| + intptr_t size, PagedSpace* owner, Executability executable);
|
|
|
| - LargePage* AllocateLargePage(intptr_t object_size,
|
| - Space* owner,
|
| - VirtualMemory::Executability executability);
|
| + LargePage* AllocateLargePage(
|
| + intptr_t object_size, Space* owner, Executability executable);
|
|
|
| void Free(MemoryChunk* chunk);
|
|
|
| @@ -1092,7 +1085,7 @@ class MemoryAllocator {
|
|
|
| // Returns an indication of whether a pointer is in a space that has
|
| // been allocated by this MemoryAllocator.
|
| - V8_INLINE bool IsOutsideAllocatedSpace(const void* address) const {
|
| + V8_INLINE(bool IsOutsideAllocatedSpace(const void* address)) const {
|
| return address < lowest_ever_allocated_ ||
|
| address >= highest_ever_allocated_;
|
| }
|
| @@ -1107,7 +1100,7 @@ class MemoryAllocator {
|
| // could be committed later by calling MemoryChunk::CommitArea.
|
| MemoryChunk* AllocateChunk(intptr_t reserve_area_size,
|
| intptr_t commit_area_size,
|
| - VirtualMemory::Executability executability,
|
| + Executability executable,
|
| Space* space);
|
|
|
| Address ReserveAlignedMemory(size_t requested,
|
| @@ -1116,26 +1109,19 @@ class MemoryAllocator {
|
| Address AllocateAlignedMemory(size_t reserve_size,
|
| size_t commit_size,
|
| size_t alignment,
|
| - VirtualMemory::Executability executability,
|
| + Executability executable,
|
| VirtualMemory* controller);
|
|
|
| - bool CommitMemory(Address addr,
|
| - size_t size,
|
| - VirtualMemory::Executability executability);
|
| + bool CommitMemory(Address addr, size_t size, Executability executable);
|
|
|
| - void FreeMemory(VirtualMemory* reservation,
|
| - VirtualMemory::Executability executability);
|
| - void FreeMemory(Address addr,
|
| - size_t size,
|
| - VirtualMemory::Executability executability);
|
| + void FreeMemory(VirtualMemory* reservation, Executability executable);
|
| + void FreeMemory(Address addr, size_t size, Executability executable);
|
|
|
| // Commit a contiguous block of memory from the initial chunk. Assumes that
|
| // the address is not NULL, the size is greater than zero, and that the
|
| // block is contained in the initial chunk. Returns true if it succeeded
|
| // and false otherwise.
|
| - bool CommitBlock(Address start,
|
| - size_t size,
|
| - VirtualMemory::Executability executability);
|
| + bool CommitBlock(Address start, size_t size, Executability executable);
|
|
|
| // Uncommit a contiguous block of memory [start..(start+size)[.
|
| // start is not NULL, the size is greater than zero, and the
|
| @@ -1626,7 +1612,7 @@ class PagedSpace : public Space {
|
| PagedSpace(Heap* heap,
|
| intptr_t max_capacity,
|
| AllocationSpace id,
|
| - VirtualMemory::Executability executability);
|
| + Executability executable);
|
|
|
| virtual ~PagedSpace() {}
|
|
|
| @@ -2051,7 +2037,7 @@ class SemiSpace : public Space {
|
| public:
|
| // Constructor.
|
| SemiSpace(Heap* heap, SemiSpaceId semispace)
|
| - : Space(heap, NEW_SPACE, VirtualMemory::NOT_EXECUTABLE),
|
| + : Space(heap, NEW_SPACE, NOT_EXECUTABLE),
|
| start_(NULL),
|
| age_mark_(NULL),
|
| id_(semispace),
|
| @@ -2304,7 +2290,7 @@ class NewSpace : public Space {
|
| public:
|
| // Constructor.
|
| explicit NewSpace(Heap* heap)
|
| - : Space(heap, NEW_SPACE, VirtualMemory::NOT_EXECUTABLE),
|
| + : Space(heap, NEW_SPACE, NOT_EXECUTABLE),
|
| to_space_(heap, kToSpace),
|
| from_space_(heap, kFromSpace),
|
| reservation_(),
|
| @@ -2569,8 +2555,8 @@ class OldSpace : public PagedSpace {
|
| OldSpace(Heap* heap,
|
| intptr_t max_capacity,
|
| AllocationSpace id,
|
| - VirtualMemory::Executability executability)
|
| - : PagedSpace(heap, max_capacity, id, executability) {
|
| + Executability executable)
|
| + : PagedSpace(heap, max_capacity, id, executable) {
|
| page_extra_ = 0;
|
| }
|
|
|
| @@ -2601,7 +2587,7 @@ class FixedSpace : public PagedSpace {
|
| intptr_t max_capacity,
|
| AllocationSpace id,
|
| int object_size_in_bytes)
|
| - : PagedSpace(heap, max_capacity, id, VirtualMemory::NOT_EXECUTABLE),
|
| + : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE),
|
| object_size_in_bytes_(object_size_in_bytes) {
|
| page_extra_ = Page::kNonCodeObjectAreaSize % object_size_in_bytes;
|
| }
|
| @@ -2741,8 +2727,8 @@ class LargeObjectSpace : public Space {
|
|
|
| // Shared implementation of AllocateRaw, AllocateRawCode and
|
| // AllocateRawFixedArray.
|
| - MUST_USE_RESULT MaybeObject* AllocateRaw(
|
| - int object_size, VirtualMemory::Executability executability);
|
| + MUST_USE_RESULT MaybeObject* AllocateRaw(int object_size,
|
| + Executability executable);
|
|
|
| // Available bytes for objects in this space.
|
| inline intptr_t Available();
|
|
|