Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index b58a4a5854a6b77b050797bfa4605a0cc4b58e95..9e5e8e8b5127381b14e4480b298421d2f1dc5577 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -1223,12 +1223,17 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
__ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); |
__ mov(r1, Operand(expr->constant_elements())); |
__ Push(r3, r2, r1); |
- if (expr->depth() > 1) { |
+ if (expr->constant_elements()->map() == Heap::fixed_cow_array_map()) { |
+ FastCloneShallowArrayStub stub( |
+ FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, length); |
+ __ CallStub(&stub); |
+ } else if (expr->depth() > 1) { |
__ CallRuntime(Runtime::kCreateArrayLiteral, 3); |
- } else if (length > FastCloneShallowArrayStub::kMaximumLength) { |
+ } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
__ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); |
} else { |
- FastCloneShallowArrayStub stub(length); |
+ FastCloneShallowArrayStub stub( |
+ FastCloneShallowArrayStub::CLONE_ELEMENTS, length); |
__ CallStub(&stub); |
} |