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

Side by Side Diff: src/mips/builtins-mips.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/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 2758 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 2769
2770 // Check if string has a cached array index. 2770 // Check if string has a cached array index.
2771 Label runtime; 2771 Label runtime;
2772 __ lw(a2, FieldMemOperand(a0, String::kHashFieldOffset)); 2772 __ lw(a2, FieldMemOperand(a0, String::kHashFieldOffset));
2773 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); 2773 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask));
2774 __ Branch(&runtime, ne, at, Operand(zero_reg)); 2774 __ Branch(&runtime, ne, at, Operand(zero_reg));
2775 __ IndexFromHash(a2, v0); 2775 __ IndexFromHash(a2, v0);
2776 __ Ret(); 2776 __ Ret();
2777 2777
2778 __ bind(&runtime); 2778 __ bind(&runtime);
2779 __ Push(a0); // Push argument. 2779 {
2780 __ TailCallRuntime(Runtime::kStringToNumber); 2780 FrameScope frame(masm, StackFrame::INTERNAL);
2781 // Push argument.
2782 __ Push(a0);
2783 // We cannot use a tail call here because this builtin can also be called
2784 // from wasm.
2785 __ CallRuntime(Runtime::kStringToNumber);
2786 }
2787 __ Ret();
2781 } 2788 }
2782 2789
2783 // static 2790 // static
2784 void Builtins::Generate_ToNumber(MacroAssembler* masm) { 2791 void Builtins::Generate_ToNumber(MacroAssembler* masm) {
2785 // The ToNumber stub takes one argument in a0. 2792 // The ToNumber stub takes one argument in a0.
2786 Label not_smi; 2793 Label not_smi;
2787 __ JumpIfNotSmi(a0, &not_smi); 2794 __ JumpIfNotSmi(a0, &not_smi);
2788 __ Ret(USE_DELAY_SLOT); 2795 __ Ret(USE_DELAY_SLOT);
2789 __ mov(v0, a0); 2796 __ mov(v0, a0);
2790 __ bind(&not_smi); 2797 __ bind(&not_smi);
(...skipping 23 matching lines...) Expand all
2814 __ Branch(&not_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); 2821 __ Branch(&not_string, hs, a1, Operand(FIRST_NONSTRING_TYPE));
2815 __ Jump(masm->isolate()->builtins()->StringToNumber(), 2822 __ Jump(masm->isolate()->builtins()->StringToNumber(),
2816 RelocInfo::CODE_TARGET); 2823 RelocInfo::CODE_TARGET);
2817 __ bind(&not_string); 2824 __ bind(&not_string);
2818 2825
2819 Label not_oddball; 2826 Label not_oddball;
2820 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE)); 2827 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2821 __ Ret(USE_DELAY_SLOT); 2828 __ Ret(USE_DELAY_SLOT);
2822 __ lw(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. 2829 __ lw(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot.
2823 __ bind(&not_oddball); 2830 __ bind(&not_oddball);
2824 2831 {
2825 __ Push(a0); // Push argument. 2832 FrameScope frame(masm, StackFrame::INTERNAL);
2826 __ TailCallRuntime(Runtime::kToNumber); 2833 // Push argument.
2834 __ Push(a0);
2835 // We cannot use a tail call here because this builtin can also be called
2836 // from wasm.
2837 __ CallRuntime(Runtime::kToNumber);
2838 }
2839 __ Ret();
2827 } 2840 }
2828 2841
2829 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 2842 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
2830 // State setup as expected by MacroAssembler::InvokePrologue. 2843 // State setup as expected by MacroAssembler::InvokePrologue.
2831 // ----------- S t a t e ------------- 2844 // ----------- S t a t e -------------
2832 // -- a0: actual arguments count 2845 // -- a0: actual arguments count
2833 // -- a1: function (passed through to callee) 2846 // -- a1: function (passed through to callee)
2834 // -- a2: expected arguments count 2847 // -- a2: expected arguments count
2835 // -- a3: new target (passed through to callee) 2848 // -- a3: new target (passed through to callee)
2836 // ----------------------------------- 2849 // -----------------------------------
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
2957 } 2970 }
2958 } 2971 }
2959 2972
2960 2973
2961 #undef __ 2974 #undef __
2962 2975
2963 } // namespace internal 2976 } // namespace internal
2964 } // namespace v8 2977 } // namespace v8
2965 2978
2966 #endif // V8_TARGET_ARCH_MIPS 2979 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698