Commit 3b8ad45e authored by mlippautz's avatar mlippautz Committed by Commit bot

[heap] Change LO space limit to 512k - page header

BUG=chromium:636331
R=ulan@chromium.org

Review-Url: https://codereview.chromium.org/2289683002
Cr-Commit-Position: refs/heads/master@{#39106}
parent d27f7f7c
......@@ -716,7 +716,7 @@ class Page : public MemoryChunk {
// account.
// TODO(hpayer): This limit should be way smaller but we currently have
// short living objects >256K.
static const int kMaxRegularHeapObjectSize = 600 * KB;
static const int kMaxRegularHeapObjectSize = 512 * KB - Page::kHeaderSize;
static inline Page* ConvertNewToOld(Page* old_page, PagedSpace* new_owner);
......
......@@ -10584,12 +10584,13 @@ class JSArray: public JSObject {
static const int kLengthOffset = JSObject::kHeaderSize;
static const int kSize = kLengthOffset + kPointerSize;
// 600 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which
// we do not want to include in objects.h
// (512 * KB - 384) is the Page::kMaxRegularHeapObjectSize defined in spaces.h
// which we do not want to include in objects.h
// Note that Page::kMaxRegularHeapObjectSize has to be in sync with
// kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc.
static const int kInitialMaxFastElementArray =
(600 * KB - FixedArray::kHeaderSize - kSize - AllocationMemento::kSize) /
(512 * KB - 384 - FixedArray::kHeaderSize - kSize -
AllocationMemento::kSize) /
kPointerSize;
private:
......
......@@ -1178,13 +1178,13 @@ TEST(CodeSerializerThreeBigStrings) {
Vector<const uint8_t> source_b =
ConstructSource(STATIC_CHAR_VECTOR("var b = \""), STATIC_CHAR_VECTOR("b"),
STATIC_CHAR_VECTOR("\";"), 600000);
STATIC_CHAR_VECTOR("\";"), 400000);
Handle<String> source_b_str =
f->NewStringFromOneByte(source_b).ToHandleChecked();
Vector<const uint8_t> source_c =
ConstructSource(STATIC_CHAR_VECTOR("var c = \""), STATIC_CHAR_VECTOR("c"),
STATIC_CHAR_VECTOR("\";"), 500000);
STATIC_CHAR_VECTOR("\";"), 400000);
Handle<String> source_c_str =
f->NewStringFromOneByte(source_c).ToHandleChecked();
......@@ -1217,10 +1217,10 @@ TEST(CodeSerializerThreeBigStrings) {
v8::Maybe<int32_t> result =
CompileRun("(a + b).length")
->Int32Value(v8::Isolate::GetCurrent()->GetCurrentContext());
CHECK_EQ(600000 + 700000, result.FromJust());
CHECK_EQ(400000 + 700000, result.FromJust());
result = CompileRun("(b + c).length")
->Int32Value(v8::Isolate::GetCurrent()->GetCurrentContext());
CHECK_EQ(500000 + 600000, result.FromJust());
CHECK_EQ(400000 + 400000, result.FromJust());
Heap* heap = isolate->heap();
v8::Local<v8::String> result_str =
CompileRun("a")
......
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