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

Side by Side Diff: src/ia32/code-stubs-ia32.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/code-stubs.cc ('k') | src/mips/code-stubs-mips.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_IA32 5 #if V8_TARGET_ARCH_IA32
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/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2643 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 __ IndexFromHash(eax, eax); 2654 __ IndexFromHash(eax, eax);
2655 __ Ret(); 2655 __ Ret();
2656 2656
2657 __ bind(&runtime); 2657 __ bind(&runtime);
2658 __ PopReturnAddressTo(ecx); // Pop return address. 2658 __ PopReturnAddressTo(ecx); // Pop return address.
2659 __ Push(eax); // Push argument. 2659 __ Push(eax); // Push argument.
2660 __ PushReturnAddressFrom(ecx); // Push return address. 2660 __ PushReturnAddressFrom(ecx); // Push return address.
2661 __ TailCallRuntime(Runtime::kStringToNumber); 2661 __ TailCallRuntime(Runtime::kStringToNumber);
2662 } 2662 }
2663 2663
2664 void ToLengthStub::Generate(MacroAssembler* masm) {
2665 // The ToLength stub takes on argument in eax.
2666 Label not_smi, positive_smi;
2667 __ JumpIfNotSmi(eax, &not_smi, Label::kNear);
2668 STATIC_ASSERT(kSmiTag == 0);
2669 __ test(eax, eax);
2670 __ j(greater_equal, &positive_smi, Label::kNear);
2671 __ xor_(eax, eax);
2672 __ bind(&positive_smi);
2673 __ Ret();
2674 __ bind(&not_smi);
2675
2676 __ pop(ecx); // Pop return address.
2677 __ push(eax); // Push argument.
2678 __ push(ecx); // Push return address.
2679 __ TailCallRuntime(Runtime::kToLength);
2680 }
2681
2682
2683 void ToStringStub::Generate(MacroAssembler* masm) { 2664 void ToStringStub::Generate(MacroAssembler* masm) {
2684 // The ToString stub takes one argument in eax. 2665 // The ToString stub takes one argument in eax.
2685 Label is_number; 2666 Label is_number;
2686 __ JumpIfSmi(eax, &is_number, Label::kNear); 2667 __ JumpIfSmi(eax, &is_number, Label::kNear);
2687 2668
2688 Label not_string; 2669 Label not_string;
2689 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edi); 2670 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edi);
2690 // eax: receiver 2671 // eax: receiver
2691 // edi: receiver map 2672 // edi: receiver map
2692 __ j(above_equal, &not_string, Label::kNear); 2673 __ j(above_equal, &not_string, Label::kNear);
(...skipping 3165 matching lines...) Expand 10 before | Expand all | Expand 10 after
5858 return_value_operand, NULL); 5839 return_value_operand, NULL);
5859 } 5840 }
5860 5841
5861 5842
5862 #undef __ 5843 #undef __
5863 5844
5864 } // namespace internal 5845 } // namespace internal
5865 } // namespace v8 5846 } // namespace v8
5866 5847
5867 #endif // V8_TARGET_ARCH_IA32 5848 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698