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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 4618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4629 // Only look at the lower 16 bits of the transition info. | 4629 // Only look at the lower 16 bits of the transition info. |
4630 __ movp(rdx, FieldOperand(rbx, AllocationSite::kTransitionInfoOffset)); | 4630 __ movp(rdx, FieldOperand(rbx, AllocationSite::kTransitionInfoOffset)); |
4631 __ SmiToInteger32(rdx, rdx); | 4631 __ SmiToInteger32(rdx, rdx); |
4632 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); | 4632 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
4633 __ andp(rdx, Immediate(AllocationSite::ElementsKindBits::kMask)); | 4633 __ andp(rdx, Immediate(AllocationSite::ElementsKindBits::kMask)); |
4634 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 4634 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); |
4635 | 4635 |
4636 __ bind(&no_info); | 4636 __ bind(&no_info); |
4637 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); | 4637 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); |
4638 | 4638 |
4639 // Subclassing | |
4640 __ bind(&subclassing); | 4639 __ bind(&subclassing); |
4641 __ Pop(rcx); // return address. | 4640 __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1); |
4642 __ Push(rdi); | |
4643 __ Push(rdx); | |
4644 | |
4645 // Adjust argc. | |
4646 switch (argument_count()) { | |
4647 case ANY: | |
4648 case MORE_THAN_ONE: | |
4649 __ addp(rax, Immediate(2)); | |
4650 break; | |
4651 case NONE: | |
4652 __ movp(rax, Immediate(2)); | |
4653 break; | |
4654 case ONE: | |
4655 __ movp(rax, Immediate(3)); | |
4656 break; | |
4657 } | |
4658 | |
4659 __ Push(rcx); | |
4660 __ JumpToExternalReference( | |
4661 ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate()), | |
4662 1); | |
4663 } | 4641 } |
4664 | 4642 |
4665 | 4643 |
4666 void InternalArrayConstructorStub::GenerateCase( | 4644 void InternalArrayConstructorStub::GenerateCase( |
4667 MacroAssembler* masm, ElementsKind kind) { | 4645 MacroAssembler* masm, ElementsKind kind) { |
4668 Label not_zero_case, not_one_case; | 4646 Label not_zero_case, not_one_case; |
4669 Label normal_sequence; | 4647 Label normal_sequence; |
4670 | 4648 |
4671 __ testp(rax, rax); | 4649 __ testp(rax, rax); |
4672 __ j(not_zero, ¬_zero_case); | 4650 __ j(not_zero, ¬_zero_case); |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5148 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, | 5126 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, |
5149 kStackSpace, nullptr, return_value_operand, NULL); | 5127 kStackSpace, nullptr, return_value_operand, NULL); |
5150 } | 5128 } |
5151 | 5129 |
5152 | 5130 |
5153 #undef __ | 5131 #undef __ |
5154 | 5132 |
5155 } } // namespace v8::internal | 5133 } } // namespace v8::internal |
5156 | 5134 |
5157 #endif // V8_TARGET_ARCH_X64 | 5135 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |