| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 3711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3722 } | 3722 } |
| 3723 } | 3723 } |
| 3724 | 3724 |
| 3725 | 3725 |
| 3726 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3726 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3727 DCHECK(ToRegister(instr->context()).is(rsi)); | 3727 DCHECK(ToRegister(instr->context()).is(rsi)); |
| 3728 DCHECK(ToRegister(instr->constructor()).is(rdi)); | 3728 DCHECK(ToRegister(instr->constructor()).is(rdi)); |
| 3729 DCHECK(ToRegister(instr->result()).is(rax)); | 3729 DCHECK(ToRegister(instr->result()).is(rax)); |
| 3730 | 3730 |
| 3731 __ Set(rax, instr->arity()); | 3731 __ Set(rax, instr->arity()); |
| 3732 if (instr->arity() == 1) { | 3732 if (instr->arity() > 0) { |
| 3733 // We only need the allocation site for the case we have a length argument. | 3733 // We only need the allocation site for the case we have a length argument. |
| 3734 // The case may bail out to the runtime, which will determine the correct | 3734 // The case may bail out to the runtime, which will determine the correct |
| 3735 // elements kind with the site. | 3735 // elements kind with the site. |
| 3736 __ Move(rbx, instr->hydrogen()->site()); | 3736 __ Move(rbx, instr->hydrogen()->site()); |
| 3737 } else { | 3737 } else { |
| 3738 __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex); | 3738 __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex); |
| 3739 } | 3739 } |
| 3740 | 3740 |
| 3741 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3741 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 3742 AllocationSiteOverrideMode override_mode = | 3742 AllocationSiteOverrideMode override_mode = |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3763 override_mode); | 3763 override_mode); |
| 3764 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3764 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3765 __ jmp(&done, Label::kNear); | 3765 __ jmp(&done, Label::kNear); |
| 3766 __ bind(&packed_case); | 3766 __ bind(&packed_case); |
| 3767 } | 3767 } |
| 3768 | 3768 |
| 3769 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 3769 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
| 3770 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3770 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3771 __ bind(&done); | 3771 __ bind(&done); |
| 3772 } else { | 3772 } else { |
| 3773 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 3773 ArrayNArgumentsConstructorStub stub(isolate()); |
| 3774 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3774 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3775 } | 3775 } |
| 3776 } | 3776 } |
| 3777 | 3777 |
| 3778 | 3778 |
| 3779 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3779 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 3780 DCHECK(ToRegister(instr->context()).is(rsi)); | 3780 DCHECK(ToRegister(instr->context()).is(rsi)); |
| 3781 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); | 3781 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); |
| 3782 } | 3782 } |
| 3783 | 3783 |
| (...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5623 __ bind(deferred->exit()); | 5623 __ bind(deferred->exit()); |
| 5624 __ bind(&done); | 5624 __ bind(&done); |
| 5625 } | 5625 } |
| 5626 | 5626 |
| 5627 #undef __ | 5627 #undef __ |
| 5628 | 5628 |
| 5629 } // namespace internal | 5629 } // namespace internal |
| 5630 } // namespace v8 | 5630 } // namespace v8 |
| 5631 | 5631 |
| 5632 #endif // V8_TARGET_ARCH_X64 | 5632 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |