Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index b7bd4c6f1ce8c30260fce3ae160eb3b00a7e38a9..93f752f150cb2f0cfe2a3c67f5d1369408e139c2 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3187,9 +3187,9 @@ Object* JSObject::EnsureWritableFastElements() { |
ASSERT(HasFastElements()); |
FixedArray* elems = FixedArray::cast(elements()); |
if (elems->map() != Heap::fixed_cow_array_map()) return elems; |
- Object* writable_elems = Heap::CopyFixedArray(elems); |
+ Object* writable_elems = Heap::CopyFixedArrayWithMap(elems, |
+ Heap::fixed_array_map()); |
if (writable_elems->IsFailure()) return writable_elems; |
- FixedArray::cast(writable_elems)->set_map(Heap::fixed_array_map()); |
set_elements(FixedArray::cast(writable_elems)); |
Counters::cow_arrays_converted.Increment(); |
return writable_elems; |