| Index: src/heap/heap.cc
|
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
| index bfd1fb50958ee8288422606051700c4324438775..4cc820e847dfaf95474a5a72eaffc648406b76d0 100644
|
| --- a/src/heap/heap.cc
|
| +++ b/src/heap/heap.cc
|
| @@ -1940,10 +1940,6 @@ Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
|
|
|
| STATIC_ASSERT((FixedDoubleArray::kHeaderSize & kDoubleAlignmentMask) ==
|
| 0); // NOLINT
|
| -STATIC_ASSERT((ConstantPoolArray::kFirstEntryOffset & kDoubleAlignmentMask) ==
|
| - 0); // NOLINT
|
| -STATIC_ASSERT((ConstantPoolArray::kExtendedFirstOffset &
|
| - kDoubleAlignmentMask) == 0); // NOLINT
|
| STATIC_ASSERT((FixedTypedArrayBase::kDataOffset & kDoubleAlignmentMask) ==
|
| 0); // NOLINT
|
|
|
| @@ -2559,8 +2555,6 @@ bool Heap::CreateInitialMaps() {
|
| ALLOCATE_PARTIAL_MAP(FIXED_ARRAY_TYPE, kVariableSizeSentinel, fixed_array);
|
| ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, undefined);
|
| ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, null);
|
| - ALLOCATE_PARTIAL_MAP(CONSTANT_POOL_ARRAY_TYPE, kVariableSizeSentinel,
|
| - constant_pool_array);
|
|
|
| #undef ALLOCATE_PARTIAL_MAP
|
| }
|
| @@ -2597,13 +2591,6 @@ bool Heap::CreateInitialMaps() {
|
| }
|
| set_empty_descriptor_array(DescriptorArray::cast(obj));
|
|
|
| - // Allocate the constant pool array.
|
| - {
|
| - AllocationResult allocation = AllocateEmptyConstantPoolArray();
|
| - if (!allocation.To(&obj)) return false;
|
| - }
|
| - set_empty_constant_pool_array(ConstantPoolArray::cast(obj));
|
| -
|
| // Fix the instance_descriptors for the existing maps.
|
| meta_map()->set_code_cache(empty_fixed_array());
|
| meta_map()->set_dependent_code(DependentCode::cast(empty_fixed_array()));
|
| @@ -2640,16 +2627,6 @@ bool Heap::CreateInitialMaps() {
|
| null_map()->set_layout_descriptor(LayoutDescriptor::FastPointerLayout());
|
| }
|
|
|
| - constant_pool_array_map()->set_code_cache(empty_fixed_array());
|
| - constant_pool_array_map()->set_dependent_code(
|
| - DependentCode::cast(empty_fixed_array()));
|
| - constant_pool_array_map()->set_raw_transitions(Smi::FromInt(0));
|
| - constant_pool_array_map()->set_instance_descriptors(empty_descriptor_array());
|
| - if (FLAG_unbox_double_fields) {
|
| - constant_pool_array_map()->set_layout_descriptor(
|
| - LayoutDescriptor::FastPointerLayout());
|
| - }
|
| -
|
| // Fix prototype object for existing maps.
|
| meta_map()->set_prototype(null_value());
|
| meta_map()->set_constructor_or_backpointer(null_value());
|
| @@ -2663,9 +2640,6 @@ bool Heap::CreateInitialMaps() {
|
| null_map()->set_prototype(null_value());
|
| null_map()->set_constructor_or_backpointer(null_value());
|
|
|
| - constant_pool_array_map()->set_prototype(null_value());
|
| - constant_pool_array_map()->set_constructor_or_backpointer(null_value());
|
| -
|
| { // Map allocation
|
| #define ALLOCATE_MAP(instance_type, size, field_name) \
|
| { \
|
| @@ -3726,16 +3700,6 @@ AllocationResult Heap::AllocateCode(int object_size, bool immovable) {
|
|
|
| AllocationResult Heap::CopyCode(Code* code) {
|
| AllocationResult allocation;
|
| - HeapObject* new_constant_pool;
|
| - if (FLAG_enable_ool_constant_pool &&
|
| - code->constant_pool() != empty_constant_pool_array()) {
|
| - // Copy the constant pool, since edits to the copied code may modify
|
| - // the constant pool.
|
| - allocation = CopyConstantPoolArray(code->constant_pool());
|
| - if (!allocation.To(&new_constant_pool)) return allocation;
|
| - } else {
|
| - new_constant_pool = empty_constant_pool_array();
|
| - }
|
|
|
| HeapObject* result = NULL;
|
| // Allocate an object the same size as the code object.
|
| @@ -3749,9 +3713,6 @@ AllocationResult Heap::CopyCode(Code* code) {
|
| CopyBlock(new_addr, old_addr, obj_size);
|
| Code* new_code = Code::cast(result);
|
|
|
| - // Update the constant pool.
|
| - new_code->set_constant_pool(new_constant_pool);
|
| -
|
| // Relocate the copy.
|
| DCHECK(IsAligned(bit_cast<intptr_t>(new_code->address()), kCodeAlignment));
|
| DCHECK(isolate_->code_range() == NULL || !isolate_->code_range()->valid() ||
|
| @@ -3762,24 +3723,14 @@ AllocationResult Heap::CopyCode(Code* code) {
|
|
|
|
|
| AllocationResult Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
|
| - // Allocate ByteArray and ConstantPoolArray before the Code object, so that we
|
| - // do not risk leaving uninitialized Code object (and breaking the heap).
|
| + // Allocate ByteArray before the Code object, so that we do not risk
|
| + // leaving uninitialized Code object (and breaking the heap).
|
| ByteArray* reloc_info_array;
|
| {
|
| AllocationResult allocation =
|
| AllocateByteArray(reloc_info.length(), TENURED);
|
| if (!allocation.To(&reloc_info_array)) return allocation;
|
| }
|
| - HeapObject* new_constant_pool;
|
| - if (FLAG_enable_ool_constant_pool &&
|
| - code->constant_pool() != empty_constant_pool_array()) {
|
| - // Copy the constant pool, since edits to the copied code may modify
|
| - // the constant pool.
|
| - AllocationResult allocation = CopyConstantPoolArray(code->constant_pool());
|
| - if (!allocation.To(&new_constant_pool)) return allocation;
|
| - } else {
|
| - new_constant_pool = empty_constant_pool_array();
|
| - }
|
|
|
| int new_body_size = RoundUp(code->instruction_size(), kObjectAlignment);
|
|
|
| @@ -3804,9 +3755,6 @@ AllocationResult Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
|
| Code* new_code = Code::cast(result);
|
| new_code->set_relocation_info(reloc_info_array);
|
|
|
| - // Update constant pool.
|
| - new_code->set_constant_pool(new_constant_pool);
|
| -
|
| // Copy patched rinfo.
|
| CopyBytes(new_code->relocation_start(), reloc_info.start(),
|
| static_cast<size_t>(reloc_info.length()));
|
| @@ -4299,31 +4247,6 @@ AllocationResult Heap::CopyFixedDoubleArrayWithMap(FixedDoubleArray* src,
|
| }
|
|
|
|
|
| -AllocationResult Heap::CopyConstantPoolArrayWithMap(ConstantPoolArray* src,
|
| - Map* map) {
|
| - HeapObject* obj;
|
| - if (src->is_extended_layout()) {
|
| - ConstantPoolArray::NumberOfEntries small(src,
|
| - ConstantPoolArray::SMALL_SECTION);
|
| - ConstantPoolArray::NumberOfEntries extended(
|
| - src, ConstantPoolArray::EXTENDED_SECTION);
|
| - AllocationResult allocation =
|
| - AllocateExtendedConstantPoolArray(small, extended);
|
| - if (!allocation.To(&obj)) return allocation;
|
| - } else {
|
| - ConstantPoolArray::NumberOfEntries small(src,
|
| - ConstantPoolArray::SMALL_SECTION);
|
| - AllocationResult allocation = AllocateConstantPoolArray(small);
|
| - if (!allocation.To(&obj)) return allocation;
|
| - }
|
| - obj->set_map_no_write_barrier(map);
|
| - CopyBlock(obj->address() + ConstantPoolArray::kFirstEntryOffset,
|
| - src->address() + ConstantPoolArray::kFirstEntryOffset,
|
| - src->size() - ConstantPoolArray::kFirstEntryOffset);
|
| - return obj;
|
| -}
|
| -
|
| -
|
| AllocationResult Heap::AllocateRawFixedArray(int length,
|
| PretenureFlag pretenure) {
|
| if (length < 0 || length > FixedArray::kMaxLength) {
|
| @@ -4413,70 +4336,6 @@ AllocationResult Heap::AllocateRawFixedDoubleArray(int length,
|
| }
|
|
|
|
|
| -AllocationResult Heap::AllocateConstantPoolArray(
|
| - const ConstantPoolArray::NumberOfEntries& small) {
|
| - CHECK(small.are_in_range(0, ConstantPoolArray::kMaxSmallEntriesPerType));
|
| - int size = ConstantPoolArray::SizeFor(small);
|
| -#ifndef V8_HOST_ARCH_64_BIT
|
| - size += kPointerSize;
|
| -#endif
|
| - AllocationSpace space = SelectSpace(size, TENURED);
|
| -
|
| - HeapObject* object;
|
| - {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| - if (!allocation.To(&object)) return allocation;
|
| - }
|
| - object = EnsureDoubleAligned(object, size);
|
| - object->set_map_no_write_barrier(constant_pool_array_map());
|
| -
|
| - ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object);
|
| - constant_pool->Init(small);
|
| - constant_pool->ClearPtrEntries(isolate());
|
| - return constant_pool;
|
| -}
|
| -
|
| -
|
| -AllocationResult Heap::AllocateExtendedConstantPoolArray(
|
| - const ConstantPoolArray::NumberOfEntries& small,
|
| - const ConstantPoolArray::NumberOfEntries& extended) {
|
| - CHECK(small.are_in_range(0, ConstantPoolArray::kMaxSmallEntriesPerType));
|
| - CHECK(extended.are_in_range(0, kMaxInt));
|
| - int size = ConstantPoolArray::SizeForExtended(small, extended);
|
| -#ifndef V8_HOST_ARCH_64_BIT
|
| - size += kPointerSize;
|
| -#endif
|
| - AllocationSpace space = SelectSpace(size, TENURED);
|
| -
|
| - HeapObject* object;
|
| - {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| - if (!allocation.To(&object)) return allocation;
|
| - }
|
| - object = EnsureDoubleAligned(object, size);
|
| - object->set_map_no_write_barrier(constant_pool_array_map());
|
| -
|
| - ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object);
|
| - constant_pool->InitExtended(small, extended);
|
| - constant_pool->ClearPtrEntries(isolate());
|
| - return constant_pool;
|
| -}
|
| -
|
| -
|
| -AllocationResult Heap::AllocateEmptyConstantPoolArray() {
|
| - ConstantPoolArray::NumberOfEntries small(0, 0, 0, 0);
|
| - int size = ConstantPoolArray::SizeFor(small);
|
| - HeapObject* result = NULL;
|
| - {
|
| - AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE);
|
| - if (!allocation.To(&result)) return allocation;
|
| - }
|
| - result->set_map_no_write_barrier(constant_pool_array_map());
|
| - ConstantPoolArray::cast(result)->Init(small);
|
| - return result;
|
| -}
|
| -
|
| -
|
| AllocationResult Heap::AllocateSymbol() {
|
| // Statically ensure that it is safe to allocate symbols in paged spaces.
|
| STATIC_ASSERT(Symbol::kSize <= Page::kMaxRegularHeapObjectSize);
|
|
|