| Index: src/ia32/stub-cache-ia32.cc
|
| diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
|
| index b2c9dab83bc593ba61230189848880a6875fd479..c6c65f076e236da7480c73692139ce7b54d04717 100644
|
| --- a/src/ia32/stub-cache-ia32.cc
|
| +++ b/src/ia32/stub-cache-ia32.cc
|
| @@ -1366,16 +1366,18 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
|
| __ mov(eax, FieldOperand(edx, JSArray::kLengthOffset));
|
| __ ret((argc + 1) * kPointerSize);
|
| } else {
|
| + Label call_builtin;
|
| +
|
| // Get the elements array of the object.
|
| __ mov(ebx, FieldOperand(edx, JSArray::kElementsOffset));
|
|
|
| - // Check that the elements are in fast mode (not dictionary).
|
| + // Check that the elements are in fast mode and writable.
|
| __ cmp(FieldOperand(ebx, HeapObject::kMapOffset),
|
| Immediate(Factory::fixed_array_map()));
|
| - __ j(not_equal, &miss);
|
| + __ j(not_equal, &call_builtin);
|
|
|
| if (argc == 1) { // Otherwise fall through to call builtin.
|
| - Label call_builtin, exit, with_write_barrier, attempt_to_grow_elements;
|
| + Label exit, with_write_barrier, attempt_to_grow_elements;
|
|
|
| // Get the array's length into eax and calculate new length.
|
| __ mov(eax, FieldOperand(edx, JSArray::kLengthOffset));
|
| @@ -1456,10 +1458,9 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object,
|
|
|
| // Elements are in new space, so write barrier is not required.
|
| __ ret((argc + 1) * kPointerSize);
|
| -
|
| - __ bind(&call_builtin);
|
| }
|
|
|
| + __ bind(&call_builtin);
|
| __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush),
|
| argc + 1,
|
| 1);
|
| @@ -1511,10 +1512,10 @@ Object* CallStubCompiler::CompileArrayPopCall(Object* object,
|
| // Get the elements array of the object.
|
| __ mov(ebx, FieldOperand(edx, JSArray::kElementsOffset));
|
|
|
| - // Check that the elements are in fast mode (not dictionary).
|
| + // Check that the elements are in fast mode and writable.
|
| __ cmp(FieldOperand(ebx, HeapObject::kMapOffset),
|
| Immediate(Factory::fixed_array_map()));
|
| - __ j(not_equal, &miss);
|
| + __ j(not_equal, &call_builtin);
|
|
|
| // Get the array's length into ecx and calculate new length.
|
| __ mov(ecx, FieldOperand(edx, JSArray::kLengthOffset));
|
|
|