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

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

Issue 1843933002: [stubs] Migrate ToLengthStub to TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@MathCeil
Patch Set: REBASE Created 4 years, 8 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
« no previous file with comments | « src/s390/code-stubs-s390.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | 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/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2581 matching lines...) Expand 10 before | Expand all | Expand 10 after
2592 __ IndexFromHash(rax, rax); 2592 __ IndexFromHash(rax, rax);
2593 __ Ret(); 2593 __ Ret();
2594 2594
2595 __ bind(&runtime); 2595 __ bind(&runtime);
2596 __ PopReturnAddressTo(rcx); // Pop return address. 2596 __ PopReturnAddressTo(rcx); // Pop return address.
2597 __ Push(rax); // Push argument. 2597 __ Push(rax); // Push argument.
2598 __ PushReturnAddressFrom(rcx); // Push return address. 2598 __ PushReturnAddressFrom(rcx); // Push return address.
2599 __ TailCallRuntime(Runtime::kStringToNumber); 2599 __ TailCallRuntime(Runtime::kStringToNumber);
2600 } 2600 }
2601 2601
2602 void ToLengthStub::Generate(MacroAssembler* masm) {
2603 // The ToLength stub takes on argument in rax.
2604 Label not_smi, positive_smi;
2605 __ JumpIfNotSmi(rax, &not_smi, Label::kNear);
2606 STATIC_ASSERT(kSmiTag == 0);
2607 __ testp(rax, rax);
2608 __ j(greater_equal, &positive_smi, Label::kNear);
2609 __ xorl(rax, rax);
2610 __ bind(&positive_smi);
2611 __ Ret();
2612 __ bind(&not_smi);
2613
2614 __ PopReturnAddressTo(rcx); // Pop return address.
2615 __ Push(rax); // Push argument.
2616 __ PushReturnAddressFrom(rcx); // Push return address.
2617 __ TailCallRuntime(Runtime::kToLength);
2618 }
2619
2620
2621 void ToStringStub::Generate(MacroAssembler* masm) { 2602 void ToStringStub::Generate(MacroAssembler* masm) {
2622 // The ToString stub takes one argument in rax. 2603 // The ToString stub takes one argument in rax.
2623 Label is_number; 2604 Label is_number;
2624 __ JumpIfSmi(rax, &is_number, Label::kNear); 2605 __ JumpIfSmi(rax, &is_number, Label::kNear);
2625 2606
2626 Label not_string; 2607 Label not_string;
2627 __ CmpObjectType(rax, FIRST_NONSTRING_TYPE, rdi); 2608 __ CmpObjectType(rax, FIRST_NONSTRING_TYPE, rdi);
2628 // rax: receiver 2609 // rax: receiver
2629 // rdi: receiver map 2610 // rdi: receiver map
2630 __ j(above_equal, &not_string, Label::kNear); 2611 __ j(above_equal, &not_string, Label::kNear);
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after
5583 NULL); 5564 NULL);
5584 } 5565 }
5585 5566
5586 5567
5587 #undef __ 5568 #undef __
5588 5569
5589 } // namespace internal 5570 } // namespace internal
5590 } // namespace v8 5571 } // namespace v8
5591 5572
5592 #endif // V8_TARGET_ARCH_X64 5573 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/s390/code-stubs-s390.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698