Commit a35bb758 authored by hpayer@chromium.org's avatar hpayer@chromium.org

FLAG_max_new_space_size is in MB.

Plus, cleanup of the space - generation mess. More to do there...

BUG=
R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/268073004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 45681c68
...@@ -474,15 +474,15 @@ bool SetResourceConstraints(Isolate* v8_isolate, ...@@ -474,15 +474,15 @@ bool SetResourceConstraints(Isolate* v8_isolate,
ResourceConstraints* constraints) { ResourceConstraints* constraints) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
int new_space_size = constraints->max_new_space_size(); 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 max_executable_size = constraints->max_executable_size();
int code_range_size = constraints->code_range_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) { code_range_size != 0) {
// After initialization it's too late to change Heap constraints. // After initialization it's too late to change Heap constraints.
ASSERT(!isolate->IsInitialized()); ASSERT(!isolate->IsInitialized());
bool result = isolate->heap()->ConfigureHeap(new_space_size / 2, bool result = isolate->heap()->ConfigureHeap(new_space_size / 2,
old_gen_size, old_space_size,
max_executable_size, max_executable_size,
code_range_size); code_range_size);
if (!result) return false; if (!result) return false;
......
...@@ -469,8 +469,10 @@ DEFINE_bool(always_inline_smi_code, false, ...@@ -469,8 +469,10 @@ DEFINE_bool(always_inline_smi_code, false,
"always inline smi code in non-opt code") "always inline smi code in non-opt code")
// heap.cc // heap.cc
DEFINE_int(max_new_space_size, 0, "max size of the new generation (in kBytes)") DEFINE_int(max_new_space_size, 0,
DEFINE_int(max_old_space_size, 0, "max size of the old generation (in Mbytes)") "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_int(max_executable_size, 0, "max size of executable memory (in Mbytes)")
DEFINE_bool(gc_global, false, "always perform global GCs") DEFINE_bool(gc_global, false, "always perform global GCs")
DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations") DEFINE_int(gc_interval, -1, "garbage collect after <n> allocations")
......
...@@ -4980,17 +4980,17 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) { ...@@ -4980,17 +4980,17 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) {
// and through the API, we should gracefully handle the case that the heap // and through the API, we should gracefully handle the case that the heap
// size is not big enough to fit all the initial objects. // size is not big enough to fit all the initial objects.
bool Heap::ConfigureHeap(int max_semispace_size, 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 max_executable_size,
intptr_t code_range_size) { intptr_t code_range_size) {
if (HasBeenSetUp()) return false; if (HasBeenSetUp()) return false;
// If max space size flags are specified overwrite the configuration. // If max space size flags are specified overwrite the configuration.
if (FLAG_max_new_space_size > 0) { 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) { 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) { if (FLAG_max_executable_size > 0) {
max_executable_size = FLAG_max_executable_size * kLumpOfMemory; max_executable_size = FLAG_max_executable_size * kLumpOfMemory;
...@@ -5031,7 +5031,7 @@ bool Heap::ConfigureHeap(int max_semispace_size, ...@@ -5031,7 +5031,7 @@ bool Heap::ConfigureHeap(int max_semispace_size,
reserved_semispace_size_ = 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) { if (max_executable_size > 0) {
max_executable_size_ = RoundUp(max_executable_size, Page::kPageSize); max_executable_size_ = RoundUp(max_executable_size, Page::kPageSize);
} }
......
...@@ -549,7 +549,7 @@ class Heap { ...@@ -549,7 +549,7 @@ class Heap {
// Configure heap size before setup. Return false if the heap has been // Configure heap size before setup. Return false if the heap has been
// set up already. // set up already.
bool ConfigureHeap(int max_semispace_size, 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 max_executable_size,
intptr_t code_range_size); intptr_t code_range_size);
bool ConfigureHeapDefault(); bool ConfigureHeapDefault();
......
...@@ -99,7 +99,7 @@ void V8::InitializeOncePerProcessImpl() { ...@@ -99,7 +99,7 @@ void V8::InitializeOncePerProcessImpl() {
if (FLAG_stress_compaction) { if (FLAG_stress_compaction) {
FLAG_force_marking_deque_overflows = true; FLAG_force_marking_deque_overflows = true;
FLAG_gc_global = 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 #ifdef V8_USE_DEFAULT_PLATFORM
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment