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

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: Added tests 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 4596 matching lines...) Expand 10 before | Expand all | Expand 10 after
4607 // Only look at the lower 16 bits of the transition info. 4607 // Only look at the lower 16 bits of the transition info.
4608 __ movp(rdx, FieldOperand(rbx, AllocationSite::kTransitionInfoOffset)); 4608 __ movp(rdx, FieldOperand(rbx, AllocationSite::kTransitionInfoOffset));
4609 __ SmiToInteger32(rdx, rdx); 4609 __ SmiToInteger32(rdx, rdx);
4610 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); 4610 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
4611 __ andp(rdx, Immediate(AllocationSite::ElementsKindBits::kMask)); 4611 __ andp(rdx, Immediate(AllocationSite::ElementsKindBits::kMask));
4612 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); 4612 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
4613 4613
4614 __ bind(&no_info); 4614 __ bind(&no_info);
4615 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); 4615 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
4616 4616
4617 // Subclassing
4617 __ bind(&subclassing); 4618 __ bind(&subclassing);
4618 __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1); 4619 __ Pop(rcx); // return address.
4620 __ Push(rdi);
4621 __ Push(rdx);
4622
4623 // Adjust argc.
4624 switch (argument_count()) {
4625 case ANY:
4626 case MORE_THAN_ONE:
4627 __ addp(rax, Immediate(2));
4628 break;
4629 case NONE:
4630 __ movp(rax, Immediate(2));
4631 break;
4632 case ONE:
4633 __ movp(rax, Immediate(3));
4634 break;
4635 }
4636
4637 __ Push(rcx);
4638 __ JumpToExternalReference(
4639 ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate()),
4640 1);
4619 } 4641 }
4620 4642
4621 4643
4622 void InternalArrayConstructorStub::GenerateCase( 4644 void InternalArrayConstructorStub::GenerateCase(
4623 MacroAssembler* masm, ElementsKind kind) { 4645 MacroAssembler* masm, ElementsKind kind) {
4624 Label not_zero_case, not_one_case; 4646 Label not_zero_case, not_one_case;
4625 Label normal_sequence; 4647 Label normal_sequence;
4626 4648
4627 __ testp(rax, rax); 4649 __ testp(rax, rax);
4628 __ j(not_zero, &not_zero_case); 4650 __ j(not_zero, &not_zero_case);
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5104 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, 5126 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg,
5105 kStackSpace, nullptr, return_value_operand, NULL); 5127 kStackSpace, nullptr, return_value_operand, NULL);
5106 } 5128 }
5107 5129
5108 5130
5109 #undef __ 5131 #undef __
5110 5132
5111 } } // namespace v8::internal 5133 } } // namespace v8::internal
5112 5134
5113 #endif // V8_TARGET_ARCH_X64 5135 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698