Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Unified Diff: src/heap.cc

Issue 228923002: Allow the embedder to pass the virtual memory limit to v8 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.h ('k') | src/spaces.cc » ('j') | src/spaces.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index ef2906085ce57afee9a5243430ec3c77cd3e3168..c1dcc6934ad68f64391ba25cecd3fa0034b273e0 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -68,7 +68,7 @@ namespace internal {
Heap::Heap()
: isolate_(NULL),
- code_range_size_(kIs64BitArch ? 512 * MB : 0),
+ code_range_size_(0),
// semispace_size_ should be a power of 2 and old_generation_size_ should be
// a multiple of Page::kPageSize.
reserved_semispace_size_(8 * (kPointerSize / 4) * MB),
@@ -165,15 +165,6 @@ Heap::Heap()
// Ensure old_generation_size_ is a multiple of kPageSize.
ASSERT(MB >= Page::kPageSize);
- intptr_t max_virtual = OS::MaxVirtualMemory();
-
- if (max_virtual > 0) {
- if (code_range_size_ > 0) {
- // Reserve no more than 1/8 of the memory for the code range.
- code_range_size_ = Min(code_range_size_, max_virtual >> 3);
- }
- }
-
memset(roots_, 0, sizeof(roots_[0]) * kRootListLength);
native_contexts_list_ = NULL;
array_buffers_list_ = Smi::FromInt(0);
@@ -6137,7 +6128,8 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) {
// size is not big enough to fit all the initial objects.
bool Heap::ConfigureHeap(int max_semispace_size,
intptr_t max_old_gen_size,
- intptr_t max_executable_size) {
+ intptr_t max_executable_size,
+ intptr_t code_range_size) {
if (HasBeenSetUp()) return false;
if (FLAG_stress_compaction) {
@@ -6211,6 +6203,8 @@ bool Heap::ConfigureHeap(int max_semispace_size,
FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) +
AllocationMemento::kSize));
+ code_range_size_ = code_range_size;
+
configured_ = true;
return true;
}
@@ -6219,7 +6213,8 @@ bool Heap::ConfigureHeap(int max_semispace_size,
bool Heap::ConfigureHeapDefault() {
return ConfigureHeap(static_cast<intptr_t>(FLAG_max_new_space_size / 2) * KB,
static_cast<intptr_t>(FLAG_max_old_space_size) * MB,
- static_cast<intptr_t>(FLAG_max_executable_size) * MB);
+ static_cast<intptr_t>(FLAG_max_executable_size) * MB,
+ static_cast<intptr_t>(0));
}
@@ -6376,10 +6371,8 @@ bool Heap::SetUp() {
// generation size. It needs executable memory.
// On 64-bit platform(s), we put all code objects in a 2 GB range of
Michael Starzinger 2014/04/09 12:03:04 nit: The comment looks very outdated. Can we adapt
jochen (gone - plz use gerrit) 2014/04/09 12:44:56 Done.
// virtual address space, so that they can call each other with near calls.
- if (code_range_size_ > 0) {
- if (!isolate_->code_range()->SetUp(code_range_size_)) {
- return false;
- }
+ if (!isolate_->code_range()->SetUp(code_range_size_)) {
+ return false;
}
code_space_ =
« no previous file with comments | « src/heap.h ('k') | src/spaces.cc » ('j') | src/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698