Reviewers: Toon Verwaest,

Message:
x32 also requires code range with V8_HOST_ARCH_32_BIT and currently we set its
maximal code range size as 256 MB.

Description:
Rename kIs64BitArch with kRequiresCodeRange.

Please review this at https://codereview.chromium.org/335473003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+14, -9 lines):
  M src/api.cc
  M src/globals.h
  M src/spaces.cc


Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index cc9cd3ae9f60820190948cf403fda7f349a9d9cb..6e76d9ac0586adca5246de9afd5df1cdad3591b1 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -465,11 +465,12 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory,

   set_max_available_threads(i::Max(i::Min(number_of_processors, 4u), 1u));

-  if (virtual_memory_limit > 0 && i::kIs64BitArch) {
+  if (virtual_memory_limit > 0 && i::kRequiresCodeRange) {
// Reserve no more than 1/8 of the memory for the code range, but at most
-    // 512 MB.
+    // kMaximalCodeRangeSize.
     set_code_range_size(
- i::Min(512, static_cast<int>((virtual_memory_limit >> 3) / i::MB)));
+        i::Min(i::kMaximalCodeRangeSize / i::MB,
+               static_cast<int>((virtual_memory_limit >> 3) / i::MB)));
   }
 }

Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index 0c24c6e59dea386a4fbbd82f1fccf6315e0d69a4..f3f0788fc5cf7d0b1663969f0bcc7db516bf383a 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -153,12 +153,14 @@ const int kDoubleSizeLog2 = 3;
 const int kPointerSizeLog2 = 3;
 const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000);
 const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF);
-const bool kIs64BitArch = true;
+const bool kRequiresCodeRange = true;
+const int kMaximalCodeRangeSize = 512 * MB;
 #else
 const int kPointerSizeLog2 = 2;
 const intptr_t kIntptrSignBit = 0x80000000;
 const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu;
-const bool kIs64BitArch = false;
+const bool kRequiresCodeRange = false;
+const int kMaximalCodeRangeSize = 0 * MB;
 #endif

 const int kBitsPerByte = 8;
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index 7966a04728c6291e83142eeeda1acf2039c68c77..9d2152970881694e46f0d5f6eecbef971f3894a8 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(requested <= kMaximalCodeRangeSize);
   code_range_ = new VirtualMemory(requested);
   CHECK(code_range_ != NULL);
   if (!code_range_->IsReserved()) {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to