Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(928)

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 975463002: Implement subclassing Arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm again Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
4639 __ bind(&subclassing); 4640 __ bind(&subclassing);
4640 __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1); 4641 __ Pop(rcx); // return address.
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);
4641 } 4663 }
4642 4664
4643 4665
4644 void InternalArrayConstructorStub::GenerateCase( 4666 void InternalArrayConstructorStub::GenerateCase(
4645 MacroAssembler* masm, ElementsKind kind) { 4667 MacroAssembler* masm, ElementsKind kind) {
4646 Label not_zero_case, not_one_case; 4668 Label not_zero_case, not_one_case;
4647 Label normal_sequence; 4669 Label normal_sequence;
4648 4670
4649 __ testp(rax, rax); 4671 __ testp(rax, rax);
4650 __ j(not_zero, &not_zero_case); 4672 __ j(not_zero, &not_zero_case);
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5126 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, 5148 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg,
5127 kStackSpace, nullptr, return_value_operand, NULL); 5149 kStackSpace, nullptr, return_value_operand, NULL);
5128 } 5150 }
5129 5151
5130 5152
5131 #undef __ 5153 #undef __
5132 5154
5133 } } // namespace v8::internal 5155 } } // namespace v8::internal
5134 5156
5135 #endif // V8_TARGET_ARCH_X64 5157 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698