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

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

Issue 1456423003: [runtime] Introduce a proper %NewArray runtime entry. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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, &not_zero_case); 4773 __ j(not_zero, &not_zero_case);
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698