OLD | NEW |
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 Loading... |
2833 // a1: receiver instance type | 2833 // a1: receiver instance type |
2834 __ Branch(¬_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE)); | 2834 __ Branch(¬_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(¬_heap_number); | 2837 __ bind(¬_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(¬_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); | |
2853 __ Jump(masm->isolate()->builtins()->StringToNumber(), | |
2854 RelocInfo::CODE_TARGET); | |
2855 __ bind(¬_string); | |
2856 | |
2857 Label not_oddball; | |
2858 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); | |
2859 __ Ret(USE_DELAY_SLOT); | |
2860 __ lw(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. | |
2861 __ bind(¬_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 Loading... |
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 |
OLD | NEW |