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

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

Issue 2153053002: [builtins] Migrate NonNumberToNumber to TurboFan builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tail call to StringToNumber Created 4 years, 5 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/ia32/builtins-ia32.cc ('k') | src/builtins/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 2822 matching lines...) Expand 10 before | Expand all | Expand 10 after
2833 // a1: receiver instance type 2833 // a1: receiver instance type
2834 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE)); 2834 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
2835 __ Ret(USE_DELAY_SLOT); 2835 __ Ret(USE_DELAY_SLOT);
2836 __ mov(v0, a0); 2836 __ mov(v0, a0);
2837 __ bind(&not_heap_number); 2837 __ bind(&not_heap_number);
2838 2838
2839 __ Jump(masm->isolate()->builtins()->NonNumberToNumber(), 2839 __ Jump(masm->isolate()->builtins()->NonNumberToNumber(),
2840 RelocInfo::CODE_TARGET); 2840 RelocInfo::CODE_TARGET);
2841 } 2841 }
2842 2842
2843 // static
2844 void Builtins::Generate_NonNumberToNumber(MacroAssembler* masm) {
2845 // The NonNumberToNumber stub takes on argument in a0.
2846 __ AssertNotNumber(a0);
2847
2848 Label not_string;
2849 __ GetObjectType(a0, a1, a1);
2850 // a0: receiver
2851 // a1: receiver instance type
2852 __ Branch(&not_string, hs, a1, Operand(FIRST_NONSTRING_TYPE));
2853 __ Jump(masm->isolate()->builtins()->StringToNumber(),
2854 RelocInfo::CODE_TARGET);
2855 __ bind(&not_string);
2856
2857 Label not_oddball;
2858 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2859 __ Ret(USE_DELAY_SLOT);
2860 __ lw(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot.
2861 __ bind(&not_oddball);
2862 {
2863 FrameScope frame(masm, StackFrame::INTERNAL);
2864 // Push argument.
2865 __ Push(a0);
2866 // We cannot use a tail call here because this builtin can also be called
2867 // from wasm.
2868 __ CallRuntime(Runtime::kToNumber);
2869 }
2870 __ Ret();
2871 }
2872
2873 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 2843 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
2874 // State setup as expected by MacroAssembler::InvokePrologue. 2844 // State setup as expected by MacroAssembler::InvokePrologue.
2875 // ----------- S t a t e ------------- 2845 // ----------- S t a t e -------------
2876 // -- a0: actual arguments count 2846 // -- a0: actual arguments count
2877 // -- a1: function (passed through to callee) 2847 // -- a1: function (passed through to callee)
2878 // -- a2: expected arguments count 2848 // -- a2: expected arguments count
2879 // -- a3: new target (passed through to callee) 2849 // -- a3: new target (passed through to callee)
2880 // ----------------------------------- 2850 // -----------------------------------
2881 2851
2882 Label invoke, dont_adapt_arguments, stack_overflow; 2852 Label invoke, dont_adapt_arguments, stack_overflow;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2999 __ break_(0xCC); 2969 __ break_(0xCC);
3000 } 2970 }
3001 } 2971 }
3002 2972
3003 #undef __ 2973 #undef __
3004 2974
3005 } // namespace internal 2975 } // namespace internal
3006 } // namespace v8 2976 } // namespace v8
3007 2977
3008 #endif // V8_TARGET_ARCH_MIPS 2978 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/builtins/ia32/builtins-ia32.cc ('k') | src/builtins/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698