Index: src/spaces.cc |
diff --git a/src/spaces.cc b/src/spaces.cc |
index 59c17af1a682f895da807efe188584cb698e9507..dfa9cea71a73a1f895da56237c1107c0e819c08b 100644 |
--- a/src/spaces.cc |
+++ b/src/spaces.cc |
@@ -133,9 +133,19 @@ CodeRange::CodeRange(Isolate* isolate) |
} |
-bool CodeRange::SetUp(const size_t requested) { |
+bool CodeRange::SetUp(size_t requested) { |
ASSERT(code_range_ == NULL); |
+ if (requested == 0) { |
+ // On 64-bit platform(s), we put all code objects in a 512 MB range of |
+ // virtual address space, so that they can call each other with near calls. |
+ if (kIs64BitArch) { |
+ requested = 512 * MB; |
+ } else { |
+ return true; |
+ } |
+ } |
+ |
code_range_ = new VirtualMemory(requested); |
CHECK(code_range_ != NULL); |
if (!code_range_->IsReserved()) { |
@@ -146,7 +156,8 @@ bool CodeRange::SetUp(const size_t requested) { |
// We are sure that we have mapped a block of requested addresses. |
ASSERT(code_range_->size() == requested); |
- LOG(isolate_, NewEvent("CodeRange", code_range_->address(), requested)); |
+ LOG(isolate_, |
+ NewEvent("CodeRange", code_range_->address(), requested)); |
Address base = reinterpret_cast<Address>(code_range_->address()); |
Address aligned_base = |
RoundUp(reinterpret_cast<Address>(code_range_->address()), |