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

Side by Side Diff: src/builtins/arm64/builtins-arm64.cc

Issue 2235983003: [builtins] Migrate StringToNumber to TurboFan builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/builtins/arm/builtins-arm.cc ('k') | src/builtins/builtins.h » ('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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after
2840 // -- x1 : message_id as Smi 2840 // -- x1 : message_id as Smi
2841 // -- lr : return address 2841 // -- lr : return address
2842 // ----------------------------------- 2842 // -----------------------------------
2843 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); 2843 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm);
2844 __ Push(x1); 2844 __ Push(x1);
2845 __ Move(cp, Smi::FromInt(0)); 2845 __ Move(cp, Smi::FromInt(0));
2846 __ TailCallRuntime(Runtime::kAbort); 2846 __ TailCallRuntime(Runtime::kAbort);
2847 } 2847 }
2848 2848
2849 // static 2849 // static
2850 void Builtins::Generate_StringToNumber(MacroAssembler* masm) {
2851 // The StringToNumber stub takes one argument in x0.
2852 __ AssertString(x0);
2853
2854 // Check if string has a cached array index.
2855 Label runtime;
2856 __ Ldr(x2, FieldMemOperand(x0, String::kHashFieldOffset));
2857 __ Tst(x2, Operand(String::kContainsCachedArrayIndexMask));
2858 __ B(ne, &runtime);
2859 __ IndexFromHash(x2, x0);
2860 __ Ret();
2861
2862 __ Bind(&runtime);
2863 {
2864 FrameScope frame(masm, StackFrame::INTERNAL);
2865 // Push argument.
2866 __ Push(x0);
2867 // We cannot use a tail call here because this builtin can also be called
2868 // from wasm.
2869 __ CallRuntime(Runtime::kStringToNumber);
2870 }
2871 __ Ret();
2872 }
2873
2874 // static
2875 void Builtins::Generate_ToNumber(MacroAssembler* masm) { 2850 void Builtins::Generate_ToNumber(MacroAssembler* masm) {
2876 // The ToNumber stub takes one argument in x0. 2851 // The ToNumber stub takes one argument in x0.
2877 Label not_smi; 2852 Label not_smi;
2878 __ JumpIfNotSmi(x0, &not_smi); 2853 __ JumpIfNotSmi(x0, &not_smi);
2879 __ Ret(); 2854 __ Ret();
2880 __ Bind(&not_smi); 2855 __ Bind(&not_smi);
2881 2856
2882 Label not_heap_number; 2857 Label not_heap_number;
2883 __ CompareObjectType(x0, x1, x1, HEAP_NUMBER_TYPE); 2858 __ CompareObjectType(x0, x1, x1, HEAP_NUMBER_TYPE);
2884 // x0: receiver 2859 // x0: receiver
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
3035 __ Unreachable(); 3010 __ Unreachable();
3036 } 3011 }
3037 } 3012 }
3038 3013
3039 #undef __ 3014 #undef __
3040 3015
3041 } // namespace internal 3016 } // namespace internal
3042 } // namespace v8 3017 } // namespace v8
3043 3018
3044 #endif // V8_TARGET_ARCH_ARM 3019 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/builtins/arm/builtins-arm.cc ('k') | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698