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

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

Issue 2079393003: [builtins] NonNumberToNumber and StringToNumber now use CallRuntime instead of TailCallRuntime (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 6 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/arm/builtins-arm.cc ('k') | src/ia32/builtins-ia32.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_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 2774 matching lines...) Expand 10 before | Expand all | Expand 10 after
2785 2785
2786 // Check if string has a cached array index. 2786 // Check if string has a cached array index.
2787 Label runtime; 2787 Label runtime;
2788 __ Ldr(x2, FieldMemOperand(x0, String::kHashFieldOffset)); 2788 __ Ldr(x2, FieldMemOperand(x0, String::kHashFieldOffset));
2789 __ Tst(x2, Operand(String::kContainsCachedArrayIndexMask)); 2789 __ Tst(x2, Operand(String::kContainsCachedArrayIndexMask));
2790 __ B(ne, &runtime); 2790 __ B(ne, &runtime);
2791 __ IndexFromHash(x2, x0); 2791 __ IndexFromHash(x2, x0);
2792 __ Ret(); 2792 __ Ret();
2793 2793
2794 __ Bind(&runtime); 2794 __ Bind(&runtime);
2795 __ Push(x0); // Push argument. 2795 {
2796 __ TailCallRuntime(Runtime::kStringToNumber); 2796 FrameScope frame(masm, StackFrame::INTERNAL);
2797 // Push argument.
2798 __ Push(x0);
2799 // We cannot use a tail call here because this builtin can also be called
2800 // from wasm.
2801 __ CallRuntime(Runtime::kStringToNumber);
2802 }
2803 __ Ret();
2797 } 2804 }
2798 2805
2799 // static 2806 // static
2800 void Builtins::Generate_ToNumber(MacroAssembler* masm) { 2807 void Builtins::Generate_ToNumber(MacroAssembler* masm) {
2801 // The ToNumber stub takes one argument in x0. 2808 // The ToNumber stub takes one argument in x0.
2802 Label not_smi; 2809 Label not_smi;
2803 __ JumpIfNotSmi(x0, &not_smi); 2810 __ JumpIfNotSmi(x0, &not_smi);
2804 __ Ret(); 2811 __ Ret();
2805 __ Bind(&not_smi); 2812 __ Bind(&not_smi);
2806 2813
(...skipping 22 matching lines...) Expand all
2829 __ Jump(masm->isolate()->builtins()->StringToNumber(), 2836 __ Jump(masm->isolate()->builtins()->StringToNumber(),
2830 RelocInfo::CODE_TARGET); 2837 RelocInfo::CODE_TARGET);
2831 __ Bind(&not_string); 2838 __ Bind(&not_string);
2832 2839
2833 Label not_oddball; 2840 Label not_oddball;
2834 __ Cmp(x1, ODDBALL_TYPE); 2841 __ Cmp(x1, ODDBALL_TYPE);
2835 __ B(ne, &not_oddball); 2842 __ B(ne, &not_oddball);
2836 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset)); 2843 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset));
2837 __ Ret(); 2844 __ Ret();
2838 __ Bind(&not_oddball); 2845 __ Bind(&not_oddball);
2839 2846 {
2840 __ Push(x0); // Push argument. 2847 FrameScope frame(masm, StackFrame::INTERNAL);
2841 __ TailCallRuntime(Runtime::kToNumber); 2848 // Push argument.
2849 __ Push(x0);
2850 // We cannot use a tail call here because this builtin can also be called
2851 // from wasm.
2852 __ CallRuntime(Runtime::kToNumber);
2853 }
2854 __ Ret();
2842 } 2855 }
2843 2856
2844 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 2857 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
2845 ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); 2858 ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline");
2846 // ----------- S t a t e ------------- 2859 // ----------- S t a t e -------------
2847 // -- x0 : actual number of arguments 2860 // -- x0 : actual number of arguments
2848 // -- x1 : function (passed through to callee) 2861 // -- x1 : function (passed through to callee)
2849 // -- x2 : expected number of arguments 2862 // -- x2 : expected number of arguments
2850 // -- x3 : new target (passed through to callee) 2863 // -- x3 : new target (passed through to callee)
2851 // ----------------------------------- 2864 // -----------------------------------
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2986 } 2999 }
2987 } 3000 }
2988 3001
2989 3002
2990 #undef __ 3003 #undef __
2991 3004
2992 } // namespace internal 3005 } // namespace internal
2993 } // namespace v8 3006 } // namespace v8
2994 3007
2995 #endif // V8_TARGET_ARCH_ARM 3008 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698