Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 371e278641e8a1a3a7fdd9dcf57b4be2c67a2cc1..25d199b189d5e881797fbf829495b4c5790c017d 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -3205,16 +3205,19 @@ Object* Heap::AllocateRawFixedArray(int length) { |
} |
-Object* Heap::CopyFixedArray(FixedArray* src) { |
+Object* Heap::CopyFixedArrayWithMap(FixedArray* src, Map* map) { |
int len = src->length(); |
Object* obj = AllocateRawFixedArray(len); |
if (obj->IsFailure()) return obj; |
if (Heap::InNewSpace(obj)) { |
HeapObject* dst = HeapObject::cast(obj); |
- CopyBlock(dst->address(), src->address(), FixedArray::SizeFor(len)); |
+ dst->set_map(map); |
+ CopyBlock(dst->address() + kPointerSize, |
+ src->address() + kPointerSize, |
+ FixedArray::SizeFor(len) - kPointerSize); |
return obj; |
} |
- HeapObject::cast(obj)->set_map(src->map()); |
+ HeapObject::cast(obj)->set_map(map); |
FixedArray* result = FixedArray::cast(obj); |
result->set_length(len); |