Index: src/spaces.cc |
diff --git a/src/spaces.cc b/src/spaces.cc |
index 7966a04728c6291e83142eeeda1acf2039c68c77..5be2d213bfdd3a3ff8ff05aa6d84ff27823c1278 100644 |
--- a/src/spaces.cc |
+++ b/src/spaces.cc |
@@ -115,15 +115,17 @@ 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; |
+ // When a target requires the code range feature, we put all code objects |
+ // in a kMaximalCodeRangeSize range of virtual address space, so that |
+ // they can call each other with near calls. |
+ if (kRequiresCodeRange) { |
+ requested = kMaximalCodeRangeSize; |
} else { |
return true; |
} |
} |
+ ASSERT(!kRequiresCodeRange || requested <= kMaximalCodeRangeSize); |
code_range_ = new VirtualMemory(requested); |
CHECK(code_range_ != NULL); |
if (!code_range_->IsReserved()) { |