| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index 322479dec60715085633e4642ff18b3c31d5ae29..93452e550c5784916a87a540bcb81efbab98cb6f 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.cc
|
| @@ -1695,24 +1695,33 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| Handle<FixedArrayBase> constant_elements_values(
|
| FixedArrayBase::cast(constant_elements->get(1)));
|
|
|
| - __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
|
| - __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset));
|
| - __ Push(Smi::FromInt(expr->literal_index()));
|
| - __ Push(constant_elements);
|
| Heap* heap = isolate()->heap();
|
| if (has_constant_fast_elements &&
|
| constant_elements_values->map() == heap->fixed_cow_array_map()) {
|
| // If the elements are already FAST_*_ELEMENTS, the boilerplate cannot
|
| // change, so it's possible to specialize the stub in advance.
|
| __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), 1);
|
| + __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
|
| + __ movq(rax, FieldOperand(rbx, JSFunction::kLiteralsOffset));
|
| + __ Move(rbx, Smi::FromInt(expr->literal_index()));
|
| + __ Move(rcx, constant_elements);
|
| FastCloneShallowArrayStub stub(
|
| FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS,
|
| DONT_TRACK_ALLOCATION_SITE,
|
| length);
|
| __ CallStub(&stub);
|
| } else if (expr->depth() > 1) {
|
| + __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
|
| + __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset));
|
| + __ Push(Smi::FromInt(expr->literal_index()));
|
| + __ Push(constant_elements);
|
| __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
|
| - } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
|
| + } else if (Serializer::enabled() ||
|
| + length > FastCloneShallowArrayStub::kMaximumClonedLength) {
|
| + __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
|
| + __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset));
|
| + __ Push(Smi::FromInt(expr->literal_index()));
|
| + __ Push(constant_elements);
|
| __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
|
| } else {
|
| ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
|
| @@ -1729,6 +1738,10 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
|
| }
|
|
|
| + __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
|
| + __ movq(rax, FieldOperand(rbx, JSFunction::kLiteralsOffset));
|
| + __ Move(rbx, Smi::FromInt(expr->literal_index()));
|
| + __ Move(rcx, constant_elements);
|
| FastCloneShallowArrayStub stub(mode, allocation_site_mode, length);
|
| __ CallStub(&stub);
|
| }
|
|
|