| Index: src/x64/lithium-codegen-x64.cc
|
| diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
|
| index ae80b841eaae962386b7bef66561db084be8f0be..775f2f0aa0bd12034c95e5aa60cfc90c6d60dd6d 100644
|
| --- a/src/x64/lithium-codegen-x64.cc
|
| +++ b/src/x64/lithium-codegen-x64.cc
|
| @@ -2552,6 +2552,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
|
| rcx);
|
| } else {
|
| Register reg = ToRegister(instr->parameter_count());
|
| + __ SmiToInteger32(reg, reg);
|
| Register return_addr_reg = reg.is(rcx) ? rbx : rcx;
|
| __ pop(return_addr_reg);
|
| __ shl(reg, Immediate(kPointerSizeLog2));
|
| @@ -3899,9 +3900,18 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
|
|
|
| __ Set(rax, instr->arity());
|
| __ Move(rbx, instr->hydrogen()->property_cell());
|
| - Handle<Code> array_construct_code =
|
| - isolate()->builtins()->ArrayConstructCode();
|
| - CallCode(array_construct_code, RelocInfo::CONSTRUCT_CALL, instr);
|
| + Object* cell_value = instr->hydrogen()->property_cell()->value();
|
| + ElementsKind kind = static_cast<ElementsKind>(Smi::cast(cell_value)->value());
|
| + if (instr->arity() == 0) {
|
| + ArrayNoArgumentConstructorStub stub(kind);
|
| + CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
|
| + } else if (instr->arity() == 1) {
|
| + ArraySingleArgumentConstructorStub stub(kind);
|
| + CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
|
| + } else {
|
| + ArrayNArgumentsConstructorStub stub(kind);
|
| + CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
|
| + }
|
| }
|
|
|
|
|
|
|