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/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 4716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4727 __ SmiToInteger32(rdx, rdx); | 4727 __ SmiToInteger32(rdx, rdx); |
4728 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); | 4728 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
4729 __ andp(rdx, Immediate(AllocationSite::ElementsKindBits::kMask)); | 4729 __ andp(rdx, Immediate(AllocationSite::ElementsKindBits::kMask)); |
4730 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 4730 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); |
4731 | 4731 |
4732 __ bind(&no_info); | 4732 __ bind(&no_info); |
4733 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); | 4733 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); |
4734 | 4734 |
4735 // Subclassing | 4735 // Subclassing |
4736 __ bind(&subclassing); | 4736 __ bind(&subclassing); |
4737 __ Pop(rcx); // return address. | |
4738 __ Push(rdi); | |
4739 __ Push(rdx); | |
4740 | |
4741 // Adjust argc. | |
4742 switch (argument_count()) { | 4737 switch (argument_count()) { |
4743 case ANY: | 4738 case ANY: |
4744 case MORE_THAN_ONE: | 4739 case MORE_THAN_ONE: { |
4745 __ addp(rax, Immediate(2)); | 4740 StackArgumentsAccessor args(rsp, rax); |
| 4741 __ movp(args.GetReceiverOperand(), rdi); |
| 4742 __ addp(rax, Immediate(3)); |
4746 break; | 4743 break; |
4747 case NONE: | 4744 } |
4748 __ movp(rax, Immediate(2)); | 4745 case NONE: { |
| 4746 StackArgumentsAccessor args(rsp, 0); |
| 4747 __ movp(args.GetReceiverOperand(), rdi); |
| 4748 __ Set(rax, 3); |
4749 break; | 4749 break; |
4750 case ONE: | 4750 } |
4751 __ movp(rax, Immediate(3)); | 4751 case ONE: { |
| 4752 StackArgumentsAccessor args(rsp, 1); |
| 4753 __ movp(args.GetReceiverOperand(), rdi); |
| 4754 __ Set(rax, 4); |
4752 break; | 4755 break; |
| 4756 } |
4753 } | 4757 } |
4754 | 4758 __ PopReturnAddressTo(rcx); |
4755 __ Push(rcx); | 4759 __ Push(rdx); |
4756 __ JumpToExternalReference( | 4760 __ Push(rbx); |
4757 ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate()), | 4761 __ PushReturnAddressFrom(rcx); |
4758 1); | 4762 __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()), |
| 4763 1); |
4759 } | 4764 } |
4760 | 4765 |
4761 | 4766 |
4762 void InternalArrayConstructorStub::GenerateCase( | 4767 void InternalArrayConstructorStub::GenerateCase( |
4763 MacroAssembler* masm, ElementsKind kind) { | 4768 MacroAssembler* masm, ElementsKind kind) { |
4764 Label not_zero_case, not_one_case; | 4769 Label not_zero_case, not_one_case; |
4765 Label normal_sequence; | 4770 Label normal_sequence; |
4766 | 4771 |
4767 __ testp(rax, rax); | 4772 __ testp(rax, rax); |
4768 __ j(not_zero, ¬_zero_case); | 4773 __ j(not_zero, ¬_zero_case); |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5397 kStackSpace, nullptr, return_value_operand, NULL); | 5402 kStackSpace, nullptr, return_value_operand, NULL); |
5398 } | 5403 } |
5399 | 5404 |
5400 | 5405 |
5401 #undef __ | 5406 #undef __ |
5402 | 5407 |
5403 } // namespace internal | 5408 } // namespace internal |
5404 } // namespace v8 | 5409 } // namespace v8 |
5405 | 5410 |
5406 #endif // V8_TARGET_ARCH_X64 | 5411 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |