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_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 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2827 // a1: receiver instance type | 2827 // a1: receiver instance type |
2828 __ Branch(¬_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE)); | 2828 __ Branch(¬_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE)); |
2829 __ Ret(USE_DELAY_SLOT); | 2829 __ Ret(USE_DELAY_SLOT); |
2830 __ mov(v0, a0); | 2830 __ mov(v0, a0); |
2831 __ bind(¬_heap_number); | 2831 __ bind(¬_heap_number); |
2832 | 2832 |
2833 __ Jump(masm->isolate()->builtins()->NonNumberToNumber(), | 2833 __ Jump(masm->isolate()->builtins()->NonNumberToNumber(), |
2834 RelocInfo::CODE_TARGET); | 2834 RelocInfo::CODE_TARGET); |
2835 } | 2835 } |
2836 | 2836 |
2837 // static | |
2838 void Builtins::Generate_NonNumberToNumber(MacroAssembler* masm) { | |
2839 // The NonNumberToNumber stub takes on argument in a0. | |
2840 __ AssertNotNumber(a0); | |
2841 | |
2842 Label not_string; | |
2843 __ GetObjectType(a0, a1, a1); | |
2844 // a0: receiver | |
2845 // a1: receiver instance type | |
2846 __ Branch(¬_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); | |
2847 __ Jump(masm->isolate()->builtins()->StringToNumber(), | |
2848 RelocInfo::CODE_TARGET); | |
2849 __ bind(¬_string); | |
2850 | |
2851 Label not_oddball; | |
2852 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); | |
2853 __ Ret(USE_DELAY_SLOT); | |
2854 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. | |
2855 __ bind(¬_oddball); | |
2856 { | |
2857 FrameScope frame(masm, StackFrame::INTERNAL); | |
2858 // Push argument. | |
2859 __ Push(a0); | |
2860 // We cannot use a tail call here because this builtin can also be called | |
2861 // from wasm. | |
2862 __ CallRuntime(Runtime::kToNumber); | |
2863 } | |
2864 __ Ret(); | |
2865 } | |
2866 | |
2867 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2837 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2868 // State setup as expected by MacroAssembler::InvokePrologue. | 2838 // State setup as expected by MacroAssembler::InvokePrologue. |
2869 // ----------- S t a t e ------------- | 2839 // ----------- S t a t e ------------- |
2870 // -- a0: actual arguments count | 2840 // -- a0: actual arguments count |
2871 // -- a1: function (passed through to callee) | 2841 // -- a1: function (passed through to callee) |
2872 // -- a2: expected arguments count | 2842 // -- a2: expected arguments count |
2873 // -- a3: new target (passed through to callee) | 2843 // -- a3: new target (passed through to callee) |
2874 // ----------------------------------- | 2844 // ----------------------------------- |
2875 | 2845 |
2876 Label invoke, dont_adapt_arguments, stack_overflow; | 2846 Label invoke, dont_adapt_arguments, stack_overflow; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2995 __ break_(0xCC); | 2965 __ break_(0xCC); |
2996 } | 2966 } |
2997 } | 2967 } |
2998 | 2968 |
2999 #undef __ | 2969 #undef __ |
3000 | 2970 |
3001 } // namespace internal | 2971 } // namespace internal |
3002 } // namespace v8 | 2972 } // namespace v8 |
3003 | 2973 |
3004 #endif // V8_TARGET_ARCH_MIPS64 | 2974 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |