| Index: src/builtins.cc
|
| diff --git a/src/builtins.cc b/src/builtins.cc
|
| index 0f493e6e5712558237a4b3dbdd4edb541b54b7f1..01e88f5593adb2ad9ec24cc975e30c2492a8c852 100644
|
| --- a/src/builtins.cc
|
| +++ b/src/builtins.cc
|
| @@ -412,12 +412,17 @@ static inline MaybeObject* EnsureJSArrayWithWritableFastElements(
|
| HeapObject* elms = array->elements();
|
| Map* map = elms->map();
|
| if (map == heap->fixed_array_map()) {
|
| - if (args == NULL || !array->HasFastSmiOnlyElements()) {
|
| + if (args == NULL || array->HasFastElements()) return elms;
|
| + if (array->HasFastDoubleElements()) {
|
| + ASSERT(elms == heap->empty_fixed_array());
|
| + MaybeObject* maybe_transition =
|
| + array->TransitionElementsKind(FAST_ELEMENTS);
|
| + if (maybe_transition->IsFailure()) return maybe_transition;
|
| return elms;
|
| }
|
| } else if (map == heap->fixed_cow_array_map()) {
|
| MaybeObject* maybe_writable_result = array->EnsureWritableFastElements();
|
| - if (args == NULL || !array->HasFastSmiOnlyElements() ||
|
| + if (args == NULL || array->HasFastElements() ||
|
| maybe_writable_result->IsFailure()) {
|
| return maybe_writable_result;
|
| }
|
|
|