Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index cb36904ee380315a046cf8b179c25e58347636c6..4b8528fa4790845a113dc3432233cff1865212e0 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -1326,12 +1326,17 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
__ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
__ push(Immediate(Smi::FromInt(expr->literal_index()))); |
__ push(Immediate(expr->constant_elements())); |
- 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); |
} |