Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index efbdf135445b9988494af3affdfab5775f3bd9f4..5d3a1b973c56e60af5088ec477ce872f965c4804 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -1670,24 +1670,33 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
Handle<FixedArrayBase> constant_elements_values( |
FixedArrayBase::cast(constant_elements->get(1))); |
- __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
- __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
- __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
- __ push(Immediate(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); |
+ __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
+ __ mov(eax, FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
+ __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); |
+ __ mov(ecx, Immediate(constant_elements)); |
FastCloneShallowArrayStub stub( |
FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, |
DONT_TRACK_ALLOCATION_SITE, |
length); |
__ CallStub(&stub); |
} else if (expr->depth() > 1) { |
+ __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
+ __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
+ __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
+ __ push(Immediate(constant_elements)); |
__ CallRuntime(Runtime::kCreateArrayLiteral, 3); |
- } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
+ } else if (Serializer::enabled() || |
+ length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
+ __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
+ __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
+ __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
+ __ push(Immediate(constant_elements)); |
__ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); |
} else { |
ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
@@ -1704,6 +1713,10 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
} |
+ __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
+ __ mov(eax, FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
+ __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); |
+ __ mov(ecx, Immediate(constant_elements)); |
FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); |
__ CallStub(&stub); |
} |