| Index: src/heap/heap.cc
|
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
| index e724ea420a4cd9c5fe77e83c0c03df291ad5a01a..443b594b6910eea2b4f2e11f1cd49cf96ea64aec 100644
|
| --- a/src/heap/heap.cc
|
| +++ b/src/heap/heap.cc
|
| @@ -3427,59 +3427,6 @@ AllocationResult Heap::CopyBytecodeArray(BytecodeArray* bytecode_array) {
|
| return copy;
|
| }
|
|
|
| -AllocationResult Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
|
| - // Allocate ByteArray before the Code object, so that we do not risk
|
| - // leaving uninitialized Code object (and breaking the heap).
|
| - ByteArray* reloc_info_array = nullptr;
|
| - {
|
| - AllocationResult allocation =
|
| - AllocateByteArray(reloc_info.length(), TENURED);
|
| - if (!allocation.To(&reloc_info_array)) return allocation;
|
| - }
|
| -
|
| - int new_body_size = RoundUp(code->instruction_size(), kObjectAlignment);
|
| -
|
| - int new_obj_size = Code::SizeFor(new_body_size);
|
| -
|
| - Address old_addr = code->address();
|
| -
|
| - size_t relocation_offset =
|
| - static_cast<size_t>(code->instruction_end() - old_addr);
|
| -
|
| - HeapObject* result = nullptr;
|
| - AllocationResult allocation = AllocateRaw(new_obj_size, CODE_SPACE);
|
| - if (!allocation.To(&result)) return allocation;
|
| -
|
| - // Copy code object.
|
| - Address new_addr = result->address();
|
| -
|
| - // Copy header and instructions.
|
| - CopyBytes(new_addr, old_addr, relocation_offset);
|
| -
|
| - Code* new_code = Code::cast(result);
|
| - new_code->set_relocation_info(reloc_info_array);
|
| -
|
| - // Copy patched rinfo.
|
| - CopyBytes(new_code->relocation_start(), reloc_info.start(),
|
| - static_cast<size_t>(reloc_info.length()));
|
| -
|
| - // Relocate the copy.
|
| - DCHECK(IsAligned(bit_cast<intptr_t>(new_code->address()), kCodeAlignment));
|
| - DCHECK(!memory_allocator()->code_range()->valid() ||
|
| - memory_allocator()->code_range()->contains(code->address()) ||
|
| - new_obj_size <= code_space()->AreaSize());
|
| -
|
| - new_code->Relocate(new_addr - old_addr);
|
| - // We have to iterate over over the object and process its pointers when
|
| - // black allocation is on.
|
| - incremental_marking()->IterateBlackObject(new_code);
|
| -#ifdef VERIFY_HEAP
|
| - if (FLAG_verify_heap) code->ObjectVerify();
|
| -#endif
|
| - return new_code;
|
| -}
|
| -
|
| -
|
| void Heap::InitializeAllocationMemento(AllocationMemento* memento,
|
| AllocationSite* allocation_site) {
|
| memento->set_map_no_write_barrier(allocation_memento_map());
|
|
|