| Index: src/heap.cc
|
| ===================================================================
|
| --- src/heap.cc (revision 10877)
|
| +++ src/heap.cc (working copy)
|
| @@ -1075,7 +1075,7 @@
|
| Page* p = Page::FromAllocationTop(reinterpret_cast<Address>(rear_));
|
| intptr_t* head_start = rear_;
|
| intptr_t* head_end =
|
| - Min(front_, reinterpret_cast<intptr_t*>(p->body_limit()));
|
| + Min(front_, reinterpret_cast<intptr_t*>(p->area_end()));
|
|
|
| int entries_count =
|
| static_cast<int>(head_end - head_start) / kEntrySizeInWords;
|
| @@ -1416,7 +1416,7 @@
|
| NewSpaceScavenger::IterateBody(object->map(), object);
|
| } else {
|
| new_space_front =
|
| - NewSpacePage::FromLimit(new_space_front)->next_page()->body();
|
| + NewSpacePage::FromLimit(new_space_front)->next_page()->area_start();
|
| }
|
| }
|
|
|
| @@ -1578,7 +1578,7 @@
|
| HeapObject* object,
|
| int object_size) {
|
| SLOW_ASSERT((size_restriction != SMALL) ||
|
| - (object_size <= Page::kMaxHeapObjectSize));
|
| + (object_size <= Page::kMaxNonCodeHeapObjectSize));
|
| SLOW_ASSERT(object->Size() == object_size);
|
|
|
| Heap* heap = map->GetHeap();
|
| @@ -1586,7 +1586,7 @@
|
| MaybeObject* maybe_result;
|
|
|
| if ((size_restriction != SMALL) &&
|
| - (object_size > Page::kMaxHeapObjectSize)) {
|
| + (object_size > Page::kMaxNonCodeHeapObjectSize)) {
|
| maybe_result = heap->lo_space()->AllocateRaw(object_size,
|
| NOT_EXECUTABLE);
|
| } else {
|
| @@ -2226,7 +2226,7 @@
|
| MaybeObject* Heap::AllocateHeapNumber(double value, PretenureFlag pretenure) {
|
| // Statically ensure that it is safe to allocate heap numbers in paged
|
| // spaces.
|
| - STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxHeapObjectSize);
|
| + STATIC_ASSERT(HeapNumber::kSize <= Page::kNonCodeObjectAreaSize);
|
| AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
|
|
|
| Object* result;
|
| @@ -2247,7 +2247,7 @@
|
|
|
| // This version of AllocateHeapNumber is optimized for
|
| // allocation in new space.
|
| - STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxHeapObjectSize);
|
| + STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxNonCodeHeapObjectSize);
|
| ASSERT(allocation_allowed_ && gc_state_ == NOT_IN_GC);
|
| Object* result;
|
| { MaybeObject* maybe_result = new_space_.AllocateRaw(HeapNumber::kSize);
|
| @@ -2785,7 +2785,7 @@
|
|
|
| MaybeObject* Heap::AllocateForeign(Address address, PretenureFlag pretenure) {
|
| // Statically ensure that it is safe to allocate foreigns in paged spaces.
|
| - STATIC_ASSERT(Foreign::kSize <= Page::kMaxHeapObjectSize);
|
| + STATIC_ASSERT(Foreign::kSize <= Page::kMaxNonCodeHeapObjectSize);
|
| AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
|
| Foreign* result;
|
| MaybeObject* maybe_result = Allocate(foreign_map(), space);
|
| @@ -3201,7 +3201,7 @@
|
| }
|
| int size = ByteArray::SizeFor(length);
|
| Object* result;
|
| - { MaybeObject* maybe_result = (size <= MaxObjectSizeInPagedSpace())
|
| + { MaybeObject* maybe_result = (size <= Page::kMaxNonCodeHeapObjectSize)
|
| ? old_data_space_->AllocateRaw(size)
|
| : lo_space_->AllocateRaw(size, NOT_EXECUTABLE);
|
| if (!maybe_result->ToObject(&result)) return maybe_result;
|
| @@ -3220,7 +3220,7 @@
|
| }
|
| int size = ByteArray::SizeFor(length);
|
| AllocationSpace space =
|
| - (size > MaxObjectSizeInPagedSpace()) ? LO_SPACE : NEW_SPACE;
|
| + (size > Page::kMaxNonCodeHeapObjectSize) ? LO_SPACE : NEW_SPACE;
|
| Object* result;
|
| { MaybeObject* maybe_result = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (!maybe_result->ToObject(&result)) return maybe_result;
|
| @@ -3286,7 +3286,7 @@
|
| MaybeObject* maybe_result;
|
| // Large code objects and code objects which should stay at a fixed address
|
| // are allocated in large object space.
|
| - if (obj_size > MaxObjectSizeInPagedSpace() || immovable) {
|
| + if (obj_size > code_space()->AreaSize() || immovable) {
|
| maybe_result = lo_space_->AllocateRaw(obj_size, EXECUTABLE);
|
| } else {
|
| maybe_result = code_space_->AllocateRaw(obj_size);
|
| @@ -3334,7 +3334,7 @@
|
| // Allocate an object the same size as the code object.
|
| int obj_size = code->Size();
|
| MaybeObject* maybe_result;
|
| - if (obj_size > MaxObjectSizeInPagedSpace()) {
|
| + if (obj_size > code_space()->AreaSize()) {
|
| maybe_result = lo_space_->AllocateRaw(obj_size, EXECUTABLE);
|
| } else {
|
| maybe_result = code_space_->AllocateRaw(obj_size);
|
| @@ -3377,7 +3377,7 @@
|
| static_cast<size_t>(code->instruction_end() - old_addr);
|
|
|
| MaybeObject* maybe_result;
|
| - if (new_obj_size > MaxObjectSizeInPagedSpace()) {
|
| + if (new_obj_size > code_space()->AreaSize()) {
|
| maybe_result = lo_space_->AllocateRaw(new_obj_size, EXECUTABLE);
|
| } else {
|
| maybe_result = code_space_->AllocateRaw(new_obj_size);
|
| @@ -3698,7 +3698,7 @@
|
| // Allocate the JSObject.
|
| AllocationSpace space =
|
| (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE;
|
| - if (map->instance_size() > MaxObjectSizeInPagedSpace()) space = LO_SPACE;
|
| + if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE;
|
| Object* obj;
|
| { MaybeObject* maybe_obj = Allocate(map, space);
|
| if (!maybe_obj->ToObject(&obj)) return maybe_obj;
|
| @@ -4148,7 +4148,7 @@
|
|
|
| // Allocate string.
|
| Object* result;
|
| - { MaybeObject* maybe_result = (size > MaxObjectSizeInPagedSpace())
|
| + { MaybeObject* maybe_result = (size > Page::kMaxNonCodeHeapObjectSize)
|
| ? lo_space_->AllocateRaw(size, NOT_EXECUTABLE)
|
| : old_data_space_->AllocateRaw(size);
|
| if (!maybe_result->ToObject(&result)) return maybe_result;
|
| @@ -4185,11 +4185,12 @@
|
| if (size > kMaxObjectSizeInNewSpace) {
|
| // Allocate in large object space, retry space will be ignored.
|
| space = LO_SPACE;
|
| - } else if (size > MaxObjectSizeInPagedSpace()) {
|
| + } else if (size > Page::kMaxNonCodeHeapObjectSize) {
|
| // Allocate in new space, retry in large object space.
|
| retry_space = LO_SPACE;
|
| }
|
| - } else if (space == OLD_DATA_SPACE && size > MaxObjectSizeInPagedSpace()) {
|
| + } else if (space == OLD_DATA_SPACE &&
|
| + size > Page::kMaxNonCodeHeapObjectSize) {
|
| space = LO_SPACE;
|
| }
|
| Object* result;
|
| @@ -4220,11 +4221,12 @@
|
| if (size > kMaxObjectSizeInNewSpace) {
|
| // Allocate in large object space, retry space will be ignored.
|
| space = LO_SPACE;
|
| - } else if (size > MaxObjectSizeInPagedSpace()) {
|
| + } else if (size > Page::kMaxNonCodeHeapObjectSize) {
|
| // Allocate in new space, retry in large object space.
|
| retry_space = LO_SPACE;
|
| }
|
| - } else if (space == OLD_DATA_SPACE && size > MaxObjectSizeInPagedSpace()) {
|
| + } else if (space == OLD_DATA_SPACE &&
|
| + size > Page::kMaxNonCodeHeapObjectSize) {
|
| space = LO_SPACE;
|
| }
|
| Object* result;
|
| @@ -4344,13 +4346,13 @@
|
| // Too big for new space.
|
| space = LO_SPACE;
|
| } else if (space == OLD_POINTER_SPACE &&
|
| - size > MaxObjectSizeInPagedSpace()) {
|
| + size > Page::kMaxNonCodeHeapObjectSize) {
|
| // Too big for old pointer space.
|
| space = LO_SPACE;
|
| }
|
|
|
| AllocationSpace retry_space =
|
| - (size <= MaxObjectSizeInPagedSpace()) ? OLD_POINTER_SPACE : LO_SPACE;
|
| + (size <= Page::kMaxNonCodeHeapObjectSize) ? OLD_POINTER_SPACE : LO_SPACE;
|
|
|
| return AllocateRaw(size, space, retry_space);
|
| }
|
| @@ -4456,13 +4458,13 @@
|
| // Too big for new space.
|
| space = LO_SPACE;
|
| } else if (space == OLD_DATA_SPACE &&
|
| - size > MaxObjectSizeInPagedSpace()) {
|
| + size > Page::kMaxNonCodeHeapObjectSize) {
|
| // Too big for old data space.
|
| space = LO_SPACE;
|
| }
|
|
|
| AllocationSpace retry_space =
|
| - (size <= MaxObjectSizeInPagedSpace()) ? OLD_DATA_SPACE : LO_SPACE;
|
| + (size <= Page::kMaxNonCodeHeapObjectSize) ? OLD_DATA_SPACE : LO_SPACE;
|
|
|
| return AllocateRaw(size, space, retry_space);
|
| }
|
| @@ -4588,7 +4590,7 @@
|
| }
|
| int size = map->instance_size();
|
| AllocationSpace space =
|
| - (size > MaxObjectSizeInPagedSpace()) ? LO_SPACE : OLD_POINTER_SPACE;
|
| + (size > Page::kMaxNonCodeHeapObjectSize) ? LO_SPACE : OLD_POINTER_SPACE;
|
| Object* result;
|
| { MaybeObject* maybe_result = Allocate(map, space);
|
| if (!maybe_result->ToObject(&result)) return maybe_result;
|
| @@ -5004,7 +5006,7 @@
|
| new_space_.FromSpaceEnd());
|
| while (it.has_next()) {
|
| NewSpacePage* page = it.next();
|
| - for (Address cursor = page->body(), limit = page->body_limit();
|
| + for (Address cursor = page->area_start(), limit = page->area_end();
|
| cursor < limit;
|
| cursor += kPointerSize) {
|
| Memory::Address_at(cursor) = kFromSpaceZapValue;
|
| @@ -5143,9 +5145,9 @@
|
|
|
| while (pages.has_next()) {
|
| Page* page = pages.next();
|
| - Object** current = reinterpret_cast<Object**>(page->ObjectAreaStart());
|
| + Object** current = reinterpret_cast<Object**>(page->area_start());
|
|
|
| - Address end = page->ObjectAreaEnd();
|
| + Address end = page->area_end();
|
|
|
| Object*** store_buffer_position = store_buffer()->Start();
|
| Object*** store_buffer_top = store_buffer()->Top();
|
| @@ -5171,9 +5173,9 @@
|
|
|
| while (pages.has_next()) {
|
| Page* page = pages.next();
|
| - Object** current = reinterpret_cast<Object**>(page->ObjectAreaStart());
|
| + Object** current = reinterpret_cast<Object**>(page->area_start());
|
|
|
| - Address end = page->ObjectAreaEnd();
|
| + Address end = page->area_end();
|
|
|
| Object*** store_buffer_position = store_buffer()->Start();
|
| Object*** store_buffer_top = store_buffer()->Top();
|
|
|