Index: src/x87/lithium-codegen-x87.cc |
diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc |
index 18b174c5548ced415135bbd16d2868f030f2329a..10881bff86f82f8b6569b477323129c0a6dc4037 100644 |
--- a/src/x87/lithium-codegen-x87.cc |
+++ b/src/x87/lithium-codegen-x87.cc |
@@ -4379,7 +4379,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) |