Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index 384bca189286cd27b2eacc7bb490f3dd68d76821..e34290ebb95e0e1b27c9b6697c87ad43e7dd8227 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -1113,7 +1113,7 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object, |
__ j(not_equal, &miss); |
if (argc == 1) { // Otherwise fall through to call builtin. |
- Label call_builtin, exit, with_rset_update, attempt_to_grow_elements; |
+ Label call_builtin, exit, with_write_barrier, attempt_to_grow_elements; |
// Get the array's length into rax and calculate new length. |
__ movq(rax, FieldOperand(rdx, JSArray::kLengthOffset)); |
@@ -1121,8 +1121,7 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object, |
__ SmiAddConstant(rax, rax, Smi::FromInt(argc)); |
// Get the element's length into rcx. |
- __ movl(rcx, FieldOperand(rbx, FixedArray::kLengthOffset)); |
- __ Integer32ToSmi(rcx, rcx); |
+ __ movq(rcx, FieldOperand(rbx, FixedArray::kLengthOffset)); |
// Check if we could survive without allocation. |
__ SmiCompare(rax, rcx); |
@@ -1141,12 +1140,12 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object, |
__ movq(Operand(rdx, 0), rcx); |
// Check if value is a smi. |
- __ JumpIfNotSmi(rcx, &with_rset_update); |
+ __ JumpIfNotSmi(rcx, &with_write_barrier); |
__ bind(&exit); |
__ ret((argc + 1) * kPointerSize); |
- __ bind(&with_rset_update); |
+ __ bind(&with_write_barrier); |
__ InNewSpace(rbx, rcx, equal, &exit); |
@@ -1194,11 +1193,11 @@ Object* CallStubCompiler::CompileArrayPushCall(Object* object, |
__ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); |
// Increment element's and array's sizes. |
- __ addl(FieldOperand(rbx, FixedArray::kLengthOffset), |
- Immediate(kAllocationDelta)); |
+ __ SmiAddConstant(FieldOperand(rbx, FixedArray::kLengthOffset), |
+ Smi::FromInt(kAllocationDelta)); |
__ movq(FieldOperand(rdx, JSArray::kLengthOffset), rax); |
- // Elements are in new space, so no remembered set updates are necessary. |
+ // Elements are in new space, so write barrier is not required. |
__ ret((argc + 1) * kPointerSize); |
__ bind(&call_builtin); |