Reviewers: mvstanton, Michael Starzinger,
Description:
FLAG_max_new_space_size is in MB.
Plus, cleanup of the space - generation mess. More to do there...
BUG=
Please review this at https://codereview.chromium.org/268073004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+13, -11 lines):
M src/api.cc
M src/flag-definitions.h
M src/heap.h
M src/heap.cc
M src/v8.cc
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
41b5a45a70ebf78e86d271b1c68df2ddd29dd1d8..1fc270c7255ceddbdae4557714de08a7562a15c1
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -474,15 +474,15 @@ bool SetResourceConstraints(Isolate* v8_isolate,
ResourceConstraints* constraints) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
int new_space_size = constraints->max_new_space_size();
- int old_gen_size = constraints->max_old_space_size();
+ int old_space_size = constraints->max_old_space_size();
int max_executable_size = constraints->max_executable_size();
int code_range_size = constraints->code_range_size();
- if (new_space_size != 0 || old_gen_size != 0 || max_executable_size != 0
||
+ if (new_space_size != 0 || old_space_size != 0 || max_executable_size !=
0 ||
code_range_size != 0) {
// After initialization it's too late to change Heap constraints.
ASSERT(!isolate->IsInitialized());
bool result = isolate->heap()->ConfigureHeap(new_space_size / 2,
- old_gen_size,
+ old_space_size,
max_executable_size,
code_range_size);
if (!result) return false;
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index
47d87eaa50a044426cb446bb451c49d7bed6d3e0..32bd20e1310b4cce410bab966dd9d5fa6ac2f9cb
100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -469,8 +469,10 @@ DEFINE_bool(always_inline_smi_code, false,
"always inline smi code in non-opt code")
// heap.cc
-DEFINE_int(max_new_space_size, 0, "max size of the new generation (in
kBytes)")
-DEFINE_int(max_old_space_size, 0, "max size of the old generation (in
Mbytes)")
+DEFINE_int(max_new_space_size, 0,
+ "max size of the new space consisting of two semi-spaces which are
half"
+ "the size (in MBytes)")
+DEFINE_int(max_old_space_size, 0, "max size of the old space (in Mbytes)")
DEFINE_int(max_executable_size, 0, "max size of executable memory (in
Mbytes)")
DEFINE_bool(gc_global, false, "always perform global GCs")
DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations")
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index
ee622f2065f80bfd4b69f67e0e87a12c43f81fd8..13771e613e5dc61cc6ef1163bcecf880e39c7be9
100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -4980,17 +4980,17 @@ void Heap::IterateStrongRoots(ObjectVisitor* v,
VisitMode mode) {
// and through the API, we should gracefully handle the case that the heap
// 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_old_space_size,
intptr_t max_executable_size,
intptr_t code_range_size) {
if (HasBeenSetUp()) return false;
// If max space size flags are specified overwrite the configuration.
if (FLAG_max_new_space_size > 0) {
- max_semispace_size = FLAG_max_new_space_size * kLumpOfMemory;
+ max_semispace_size = (FLAG_max_new_space_size / 2) * kLumpOfMemory;
}
if (FLAG_max_old_space_size > 0) {
- max_old_gen_size = FLAG_max_old_space_size * kLumpOfMemory;
+ max_old_space_size = FLAG_max_old_space_size * kLumpOfMemory;
}
if (FLAG_max_executable_size > 0) {
max_executable_size = FLAG_max_executable_size * kLumpOfMemory;
@@ -5031,7 +5031,7 @@ bool Heap::ConfigureHeap(int max_semispace_size,
reserved_semispace_size_ = max_semispace_size_;
}
- if (max_old_gen_size > 0) max_old_generation_size_ = max_old_gen_size;
+ if (max_old_space_size > 0) max_old_generation_size_ =
max_old_space_size;
if (max_executable_size > 0) {
max_executable_size_ = RoundUp(max_executable_size, Page::kPageSize);
}
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index
44e1b94593546a78bb7d4ea09d3babea7a7bdd41..1b42efd89c1b4102941d25ce543013e40ec8202a
100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -549,7 +549,7 @@ class Heap {
// Configure heap size before setup. Return false if the heap has been
// set up already.
bool ConfigureHeap(int max_semispace_size,
- intptr_t max_old_gen_size,
+ intptr_t max_old_space_size,
intptr_t max_executable_size,
intptr_t code_range_size);
bool ConfigureHeapDefault();
Index: src/v8.cc
diff --git a/src/v8.cc b/src/v8.cc
index
30f64d6bdf8ea91d72c9adffa46773c158ca0533..4050e3475933bdb1542c8872fece0e1d5d0e9938
100644
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -99,7 +99,7 @@ void V8::InitializeOncePerProcessImpl() {
if (FLAG_stress_compaction) {
FLAG_force_marking_deque_overflows = true;
FLAG_gc_global = true;
- FLAG_max_new_space_size = (1 << (kPageSizeBits - 10)) * 2;
+ FLAG_max_new_space_size = 2 * Page::kPageSize;
}
#ifdef V8_USE_DEFAULT_PLATFORM
--
--
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.