Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 26726018f8740d31ec84961f7433da451714531d..a46cd4bfb9e2edb2d8d649a5234927aa6132c9fa 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -3977,7 +3977,15 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
DCHECK(ToRegister(instr->result()).is(eax)); |
__ Move(eax, Immediate(instr->arity())); |
- __ mov(ebx, isolate()->factory()->undefined_value()); |
+ if (instr->arity() == 1) { |
+ // We only need the allocation site for the case we have a length argument. |
+ // The case may bail out to the runtime, which will determine the correct |
+ // elements kind with the site. |
+ __ mov(ebx, instr->hydrogen()->site()); |
+ } else { |
+ __ mov(ebx, isolate()->factory()->undefined_value()); |
+ } |
+ |
ElementsKind kind = instr->hydrogen()->elements_kind(); |
AllocationSiteOverrideMode override_mode = |
(AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |