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

Side by Side Diff: src/builtins/arm/builtins-arm.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 | « no previous file | src/builtins/arm64/builtins-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 2741 matching lines...) Expand 10 before | Expand all | Expand 10 after
2752 void Builtins::Generate_Abort(MacroAssembler* masm) { 2752 void Builtins::Generate_Abort(MacroAssembler* masm) {
2753 // ----------- S t a t e ------------- 2753 // ----------- S t a t e -------------
2754 // -- r1 : message_id as Smi 2754 // -- r1 : message_id as Smi
2755 // -- lr : return address 2755 // -- lr : return address
2756 // ----------------------------------- 2756 // -----------------------------------
2757 __ Push(r1); 2757 __ Push(r1);
2758 __ Move(cp, Smi::FromInt(0)); 2758 __ Move(cp, Smi::FromInt(0));
2759 __ TailCallRuntime(Runtime::kAbort); 2759 __ TailCallRuntime(Runtime::kAbort);
2760 } 2760 }
2761 2761
2762 // static
2763 void Builtins::Generate_StringToNumber(MacroAssembler* masm) {
2764 // The StringToNumber stub takes one argument in r0.
2765 __ AssertString(r0);
2766
2767 // Check if string has a cached array index.
2768 Label runtime;
2769 __ ldr(r2, FieldMemOperand(r0, String::kHashFieldOffset));
2770 __ tst(r2, Operand(String::kContainsCachedArrayIndexMask));
2771 __ b(ne, &runtime);
2772 __ IndexFromHash(r2, r0);
2773 __ Ret();
2774
2775 __ bind(&runtime);
2776 {
2777 FrameScope frame(masm, StackFrame::INTERNAL);
2778 // Push argument.
2779 __ Push(r0);
2780 // We cannot use a tail call here because this builtin can also be called
2781 // from wasm.
2782 __ CallRuntime(Runtime::kStringToNumber);
2783 }
2784 __ Ret();
2785 }
2786
2787 void Builtins::Generate_ToNumber(MacroAssembler* masm) { 2762 void Builtins::Generate_ToNumber(MacroAssembler* masm) {
2788 // The ToNumber stub takes one argument in r0. 2763 // The ToNumber stub takes one argument in r0.
2789 STATIC_ASSERT(kSmiTag == 0); 2764 STATIC_ASSERT(kSmiTag == 0);
2790 __ tst(r0, Operand(kSmiTagMask)); 2765 __ tst(r0, Operand(kSmiTagMask));
2791 __ Ret(eq); 2766 __ Ret(eq);
2792 2767
2793 __ CompareObjectType(r0, r1, r1, HEAP_NUMBER_TYPE); 2768 __ CompareObjectType(r0, r1, r1, HEAP_NUMBER_TYPE);
2794 // r0: receiver 2769 // r0: receiver
2795 // r1: receiver instance type 2770 // r1: receiver instance type
2796 __ Ret(eq); 2771 __ Ret(eq);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2921 __ bkpt(0); 2896 __ bkpt(0);
2922 } 2897 }
2923 } 2898 }
2924 2899
2925 #undef __ 2900 #undef __
2926 2901
2927 } // namespace internal 2902 } // namespace internal
2928 } // namespace v8 2903 } // namespace v8
2929 2904
2930 #endif // V8_TARGET_ARCH_ARM 2905 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/builtins/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698