Upgrade to V8 3.5
Merge V8 3.5.10.24
Simple merge required updates to makefiles only.
Bug: 5688872
Change-Id: I0acdb9a1a53919d84e9a7525308e8371739d2f06
diff --git a/src/spaces.h b/src/spaces.h
index ac5d998..908cd30 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -200,9 +200,9 @@
inline void SetIsLargeObjectPage(bool is_large_object_page);
- inline bool IsPageExecutable();
+ inline Executability PageExecutability();
- inline void SetIsPageExecutable(bool is_page_executable);
+ inline void SetPageExecutability(Executability executable);
// Returns the offset of a given address to this page.
INLINE(int Offset(Address a)) {
@@ -408,6 +408,9 @@
// manages a range of virtual memory.
class CodeRange {
public:
+ explicit CodeRange(Isolate* isolate);
+ ~CodeRange() { TearDown(); }
+
// 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.
@@ -417,9 +420,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();
}
@@ -432,7 +435,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_;
@@ -466,10 +469,6 @@
static int CompareFreeBlockAddress(const FreeBlock* left,
const FreeBlock* right);
- friend class Isolate;
-
- Isolate* isolate_;
-
DISALLOW_COPY_AND_ASSIGN(CodeRange);
};
@@ -500,6 +499,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);
@@ -657,10 +658,10 @@
#endif
private:
- MemoryAllocator();
-
static const int kChunkSize = kPagesPerChunk * Page::kPageSize;
+ Isolate* isolate_;
+
// Maximum space size in bytes.
intptr_t capacity_;
// Maximum subset of capacity_ that can be executable
@@ -753,10 +754,6 @@
Page* prev,
Page** last_page_in_use);
- friend class Isolate;
-
- Isolate* isolate_;
-
DISALLOW_COPY_AND_ASSIGN(MemoryAllocator);
};
@@ -2147,7 +2144,7 @@
static LargeObjectChunk* New(int size_in_bytes, Executability executable);
// Free the memory associated with the chunk.
- inline void Free(Executability executable);
+ void Free(Executability executable);
// Interpret a raw address as a large object chunk.
static LargeObjectChunk* FromAddress(Address address) {
@@ -2157,13 +2154,17 @@
// Returns the address of this chunk.
Address address() { return reinterpret_cast<Address>(this); }
+ Page* GetPage() {
+ return Page::FromAddress(RoundUp(address(), Page::kPageSize));
+ }
+
// Accessors for the fields of the chunk.
LargeObjectChunk* next() { return next_; }
void set_next(LargeObjectChunk* chunk) { next_ = chunk; }
size_t size() { return size_ & ~Page::kPageFlagMask; }
// Compute the start address in the chunk.
- inline Address GetStartAddress();
+ Address GetStartAddress() { return GetPage()->ObjectAreaStart(); }
// Returns the object in this chunk.
HeapObject* GetObject() { return HeapObject::FromAddress(GetStartAddress()); }