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

Side by Side Diff: src/mips64/builtins-mips64.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/mips/builtins-mips.cc ('k') | src/x64/builtins-x64.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 2744 matching lines...) Expand 10 before | Expand all | Expand 10 after
2755 2755
2756 // Check if string has a cached array index. 2756 // Check if string has a cached array index.
2757 Label runtime; 2757 Label runtime;
2758 __ lwu(a2, FieldMemOperand(a0, String::kHashFieldOffset)); 2758 __ lwu(a2, FieldMemOperand(a0, String::kHashFieldOffset));
2759 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); 2759 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask));
2760 __ Branch(&runtime, ne, at, Operand(zero_reg)); 2760 __ Branch(&runtime, ne, at, Operand(zero_reg));
2761 __ IndexFromHash(a2, v0); 2761 __ IndexFromHash(a2, v0);
2762 __ Ret(); 2762 __ Ret();
2763 2763
2764 __ bind(&runtime); 2764 __ bind(&runtime);
2765 __ Push(a0); // Push argument. 2765 {
2766 __ TailCallRuntime(Runtime::kStringToNumber); 2766 FrameScope frame(masm, StackFrame::INTERNAL);
2767 // Push argument.
2768 __ Push(a0);
2769 // We cannot use a tail call here because this builtin can also be called
2770 // from wasm.
2771 __ CallRuntime(Runtime::kStringToNumber);
2772 }
2773 __ Ret();
2767 } 2774 }
2768 2775
2769 // static 2776 // static
2770 void Builtins::Generate_ToNumber(MacroAssembler* masm) { 2777 void Builtins::Generate_ToNumber(MacroAssembler* masm) {
2771 // The ToNumber stub takes one argument in a0. 2778 // The ToNumber stub takes one argument in a0.
2772 Label not_smi; 2779 Label not_smi;
2773 __ JumpIfNotSmi(a0, &not_smi); 2780 __ JumpIfNotSmi(a0, &not_smi);
2774 __ Ret(USE_DELAY_SLOT); 2781 __ Ret(USE_DELAY_SLOT);
2775 __ mov(v0, a0); 2782 __ mov(v0, a0);
2776 __ bind(&not_smi); 2783 __ bind(&not_smi);
(...skipping 23 matching lines...) Expand all
2800 __ Branch(&not_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); 2807 __ Branch(&not_string, hs, a1, Operand(FIRST_NONSTRING_TYPE));
2801 __ Jump(masm->isolate()->builtins()->StringToNumber(), 2808 __ Jump(masm->isolate()->builtins()->StringToNumber(),
2802 RelocInfo::CODE_TARGET); 2809 RelocInfo::CODE_TARGET);
2803 __ bind(&not_string); 2810 __ bind(&not_string);
2804 2811
2805 Label not_oddball; 2812 Label not_oddball;
2806 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE)); 2813 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2807 __ Ret(USE_DELAY_SLOT); 2814 __ Ret(USE_DELAY_SLOT);
2808 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. 2815 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot.
2809 __ bind(&not_oddball); 2816 __ bind(&not_oddball);
2810 2817 {
2811 __ Push(a0); // Push argument. 2818 FrameScope frame(masm, StackFrame::INTERNAL);
2812 __ TailCallRuntime(Runtime::kToNumber); 2819 // Push argument.
2820 __ Push(a0);
2821 // We cannot use a tail call here because this builtin can also be called
2822 // from wasm.
2823 __ CallRuntime(Runtime::kToNumber);
2824 }
2825 __ Ret();
2813 } 2826 }
2814 2827
2815 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 2828 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
2816 // State setup as expected by MacroAssembler::InvokePrologue. 2829 // State setup as expected by MacroAssembler::InvokePrologue.
2817 // ----------- S t a t e ------------- 2830 // ----------- S t a t e -------------
2818 // -- a0: actual arguments count 2831 // -- a0: actual arguments count
2819 // -- a1: function (passed through to callee) 2832 // -- a1: function (passed through to callee)
2820 // -- a2: expected arguments count 2833 // -- a2: expected arguments count
2821 // -- a3: new target (passed through to callee) 2834 // -- a3: new target (passed through to callee)
2822 // ----------------------------------- 2835 // -----------------------------------
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 } 2958 }
2946 } 2959 }
2947 2960
2948 2961
2949 #undef __ 2962 #undef __
2950 2963
2951 } // namespace internal 2964 } // namespace internal
2952 } // namespace v8 2965 } // namespace v8
2953 2966
2954 #endif // V8_TARGET_ARCH_MIPS64 2967 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698