| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 74616d0756cb9321adf6b7c420f053108250f71c..10a3422ea1d429f899bd4ee8ae056e1ee244ee31 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -1477,8 +1477,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| int length = subexprs->length();
|
| Handle<FixedArray> constant_elements = expr->constant_elements();
|
| ASSERT_EQ(2, constant_elements->length());
|
| - ElementsKind constant_elements_kind =
|
| - static_cast<ElementsKind>(Smi::cast(constant_elements->get(0))->value());
|
| Handle<FixedArrayBase> constant_elements_values(
|
| FixedArrayBase::cast(constant_elements->get(1)));
|
|
|
| @@ -1486,14 +1484,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset));
|
| __ push(Immediate(Smi::FromInt(expr->literal_index())));
|
| __ push(Immediate(constant_elements));
|
| - if (constant_elements_values->map() ==
|
| - isolate()->heap()->fixed_cow_array_map()) {
|
| - ASSERT(expr->depth() == 1);
|
| - FastCloneShallowArrayStub stub(
|
| - FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, length);
|
| - __ CallStub(&stub);
|
| - __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), 1);
|
| - } else if (expr->depth() > 1) {
|
| + if (expr->depth() > 1) {
|
| __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
|
| } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
|
| __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
|
| @@ -1501,11 +1492,13 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| ASSERT(constant_elements_kind == FAST_ELEMENTS ||
|
| constant_elements_kind == FAST_SMI_ONLY_ELEMENTS ||
|
| FLAG_smi_only_arrays);
|
| - FastCloneShallowArrayStub::Mode mode =
|
| - constant_elements_kind == FAST_DOUBLE_ELEMENTS
|
| - ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS
|
| - : FastCloneShallowArrayStub::CLONE_ELEMENTS;
|
| - FastCloneShallowArrayStub stub(mode, length);
|
| + if (constant_elements_values->map() ==
|
| + isolate()->heap()->fixed_cow_array_map()) {
|
| + __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(),
|
| + 1);
|
| + }
|
| + FastCloneShallowArrayStub stub(
|
| + FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS, length);
|
| __ CallStub(&stub);
|
| }
|
|
|
|
|