Commit 1f98ef6e authored by hpayer's avatar hpayer Committed by Commit bot

Revert of [heap] Reland decrease large object limit for regular heap objects....

Revert of [heap] Reland decrease large object limit for regular heap objects. (patchset #3 id:40001 of https://codereview.chromium.org/1401173003/ )

Reason for revert:
Still one failing test on Windows.

Original issue's description:
> [heap] Reland decrease large object limit for regular heap objects.
>
> BUG=
>
> Committed: https://crrev.com/9b91bf3a630b5382080ba1d7f9f3e88de3de8a95
> Cr-Commit-Position: refs/heads/master@{#31228}

TBR=mlippautz@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#31239}
parent c0185b7d
...@@ -2663,9 +2663,8 @@ void MarkCompactCollector::MigrateObject( ...@@ -2663,9 +2663,8 @@ void MarkCompactCollector::MigrateObject(
Address dst_addr = dst->address(); Address dst_addr = dst->address();
Address src_addr = src->address(); Address src_addr = src->address();
DCHECK(heap()->AllowedToBeMigrated(src, dest)); DCHECK(heap()->AllowedToBeMigrated(src, dest));
DCHECK(dest != LO_SPACE); DCHECK(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize);
if (dest == OLD_SPACE) { if (dest == OLD_SPACE) {
DCHECK_OBJECT_SIZE(size);
DCHECK(evacuation_slots_buffer != nullptr); DCHECK(evacuation_slots_buffer != nullptr);
DCHECK(IsAligned(size, kPointerSize)); DCHECK(IsAligned(size, kPointerSize));
switch (src->ContentType()) { switch (src->ContentType()) {
...@@ -2689,14 +2688,12 @@ void MarkCompactCollector::MigrateObject( ...@@ -2689,14 +2688,12 @@ void MarkCompactCollector::MigrateObject(
evacuation_slots_buffer); evacuation_slots_buffer);
} }
} else if (dest == CODE_SPACE) { } else if (dest == CODE_SPACE) {
DCHECK_CODEOBJECT_SIZE(size, heap()->code_space());
DCHECK(evacuation_slots_buffer != nullptr); DCHECK(evacuation_slots_buffer != nullptr);
PROFILE(isolate(), CodeMoveEvent(src_addr, dst_addr)); PROFILE(isolate(), CodeMoveEvent(src_addr, dst_addr));
heap()->MoveBlock(dst_addr, src_addr, size); heap()->MoveBlock(dst_addr, src_addr, size);
RecordMigratedCodeObjectSlot(dst_addr, evacuation_slots_buffer); RecordMigratedCodeObjectSlot(dst_addr, evacuation_slots_buffer);
Code::cast(dst)->Relocate(dst_addr - src_addr); Code::cast(dst)->Relocate(dst_addr - src_addr);
} else { } else {
DCHECK_OBJECT_SIZE(size);
DCHECK(evacuation_slots_buffer == nullptr); DCHECK(evacuation_slots_buffer == nullptr);
DCHECK(dest == NEW_SPACE); DCHECK(dest == NEW_SPACE);
heap()->MoveBlock(dst_addr, src_addr, size); heap()->MoveBlock(dst_addr, src_addr, size);
...@@ -3080,6 +3077,8 @@ static String* UpdateReferenceInExternalStringTableEntry(Heap* heap, ...@@ -3080,6 +3077,8 @@ static String* UpdateReferenceInExternalStringTableEntry(Heap* heap,
bool MarkCompactCollector::TryPromoteObject(HeapObject* object, bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
int object_size) { int object_size) {
DCHECK(object_size <= Page::kMaxRegularHeapObjectSize);
OldSpace* old_space = heap()->old_space(); OldSpace* old_space = heap()->old_space();
HeapObject* target = nullptr; HeapObject* target = nullptr;
......
...@@ -216,7 +216,7 @@ class ScavengingVisitor : public StaticVisitorBase { ...@@ -216,7 +216,7 @@ class ScavengingVisitor : public StaticVisitorBase {
template <ObjectContents object_contents, AllocationAlignment alignment> template <ObjectContents object_contents, AllocationAlignment alignment>
static inline void EvacuateObject(Map* map, HeapObject** slot, static inline void EvacuateObject(Map* map, HeapObject** slot,
HeapObject* object, int object_size) { HeapObject* object, int object_size) {
SLOW_DCHECK(object_size <= Page::kAllocatableMemory); SLOW_DCHECK(object_size <= Page::kMaxRegularHeapObjectSize);
SLOW_DCHECK(object->Size() == object_size); SLOW_DCHECK(object->Size() == object_size);
Heap* heap = map->GetHeap(); Heap* heap = map->GetHeap();
......
...@@ -133,12 +133,7 @@ HeapObject* HeapObjectIterator::FromCurrentPage() { ...@@ -133,12 +133,7 @@ HeapObject* HeapObjectIterator::FromCurrentPage() {
} }
if (!obj->IsFiller()) { if (!obj->IsFiller()) {
if (obj->IsCode()) {
DCHECK_EQ(space_, space_->heap()->code_space());
DCHECK_CODEOBJECT_SIZE(obj_size, space_);
} else {
DCHECK_OBJECT_SIZE(obj_size); DCHECK_OBJECT_SIZE(obj_size);
}
return obj; return obj;
} }
} }
......
...@@ -86,9 +86,6 @@ class Isolate; ...@@ -86,9 +86,6 @@ class Isolate;
#define DCHECK_OBJECT_SIZE(size) \ #define DCHECK_OBJECT_SIZE(size) \
DCHECK((0 < size) && (size <= Page::kMaxRegularHeapObjectSize)) DCHECK((0 < size) && (size <= Page::kMaxRegularHeapObjectSize))
#define DCHECK_CODEOBJECT_SIZE(size, code_space) \
DCHECK((0 < size) && (size <= code_space->AreaSize()))
#define DCHECK_PAGE_OFFSET(offset) \ #define DCHECK_PAGE_OFFSET(offset) \
DCHECK((Page::kObjectStartOffset <= offset) && (offset <= Page::kPageSize)) DCHECK((Page::kObjectStartOffset <= offset) && (offset <= Page::kPageSize))
...@@ -843,7 +840,7 @@ class Page : public MemoryChunk { ...@@ -843,7 +840,7 @@ class Page : public MemoryChunk {
// memory. This also applies to new space allocation, since objects are never // memory. This also applies to new space allocation, since objects are never
// migrated from new space to large object space. Takes double alignment into // migrated from new space to large object space. Takes double alignment into
// account. // account.
static const int kMaxRegularHeapObjectSize = 128 * KB * (i::kPointerSize / 4); static const int kMaxRegularHeapObjectSize = kPageSize - kObjectStartOffset;
static const int kAllocatableMemory = kPageSize - kObjectStartOffset; static const int kAllocatableMemory = kPageSize - kObjectStartOffset;
......
...@@ -10048,14 +10048,9 @@ class JSArray: public JSObject { ...@@ -10048,14 +10048,9 @@ class JSArray: public JSObject {
static const int kLengthOffset = JSObject::kHeaderSize; static const int kLengthOffset = JSObject::kHeaderSize;
static const int kSize = kLengthOffset + kPointerSize; static const int kSize = kLengthOffset + kPointerSize;
// 128 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which // Note that Page::kMaxRegularHeapObjectSize puts a limit on
// we do not want to include in objects.h // permissible values (see the DCHECK in heap.cc).
// Note that Page::kMaxRegularHeapObjectSize has to be in sync with static const int kInitialMaxFastElementArray = 100000;
// kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc.
static const int kInitialMaxFastElementArray =
(128 * KB * (i::kPointerSize / 4) - FixedArray::kHeaderSize - kSize -
AllocationMemento::kSize) /
kPointerSize;
private: private:
DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray);
......
...@@ -1223,15 +1223,15 @@ TEST(SerializeToplevelThreeBigStrings) { ...@@ -1223,15 +1223,15 @@ TEST(SerializeToplevelThreeBigStrings) {
CompileRun("a") CompileRun("a")
->ToString(CcTest::isolate()->GetCurrentContext()) ->ToString(CcTest::isolate()->GetCurrentContext())
.ToLocalChecked(); .ToLocalChecked();
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), LO_SPACE)); CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), OLD_SPACE));
result_str = CompileRun("b") result_str = CompileRun("b")
->ToString(CcTest::isolate()->GetCurrentContext()) ->ToString(CcTest::isolate()->GetCurrentContext())
.ToLocalChecked(); .ToLocalChecked();
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), LO_SPACE)); CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), OLD_SPACE));
result_str = CompileRun("c") result_str = CompileRun("c")
->ToString(CcTest::isolate()->GetCurrentContext()) ->ToString(CcTest::isolate()->GetCurrentContext())
.ToLocalChecked(); .ToLocalChecked();
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), LO_SPACE)); CHECK(heap->InSpace(*v8::Utils::OpenHandle(*result_str), OLD_SPACE));
delete cache; delete cache;
source_a.Dispose(); source_a.Dispose();
......
...@@ -430,8 +430,7 @@ TEST(CompactionSpace) { ...@@ -430,8 +430,7 @@ TEST(CompactionSpace) {
// and would thus neither grow, nor be able to allocate an object. // and would thus neither grow, nor be able to allocate an object.
const int kNumObjects = 100; const int kNumObjects = 100;
const int kExpectedPages = (kNumObjects / (compaction_space->AreaSize() / const int kExpectedPages = (kNumObjects / (compaction_space->AreaSize() /
Page::kMaxRegularHeapObjectSize)) + Page::kMaxRegularHeapObjectSize));
1;
for (int i = 0; i < kNumObjects; i++) { for (int i = 0; i < kNumObjects; i++) {
compaction_space->AllocateRawUnaligned(Page::kMaxRegularHeapObjectSize) compaction_space->AllocateRawUnaligned(Page::kMaxRegularHeapObjectSize)
.ToObjectChecked(); .ToObjectChecked();
......
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