| 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 2804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2815 // ----------- S t a t e ------------- | 2815 // ----------- S t a t e ------------- |
| 2816 // -- a0 : message_id as Smi | 2816 // -- a0 : message_id as Smi |
| 2817 // -- ra : return address | 2817 // -- ra : return address |
| 2818 // ----------------------------------- | 2818 // ----------------------------------- |
| 2819 __ Push(a0); | 2819 __ Push(a0); |
| 2820 __ Move(cp, Smi::FromInt(0)); | 2820 __ Move(cp, Smi::FromInt(0)); |
| 2821 __ TailCallRuntime(Runtime::kAbort); | 2821 __ TailCallRuntime(Runtime::kAbort); |
| 2822 } | 2822 } |
| 2823 | 2823 |
| 2824 // static | 2824 // static |
| 2825 void Builtins::Generate_StringToNumber(MacroAssembler* masm) { | |
| 2826 // The StringToNumber stub takes on argument in a0. | |
| 2827 __ AssertString(a0); | |
| 2828 | |
| 2829 // Check if string has a cached array index. | |
| 2830 Label runtime; | |
| 2831 __ lwu(a2, FieldMemOperand(a0, String::kHashFieldOffset)); | |
| 2832 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); | |
| 2833 __ Branch(&runtime, ne, at, Operand(zero_reg)); | |
| 2834 __ IndexFromHash(a2, v0); | |
| 2835 __ Ret(); | |
| 2836 | |
| 2837 __ bind(&runtime); | |
| 2838 { | |
| 2839 FrameScope frame(masm, StackFrame::INTERNAL); | |
| 2840 // Push argument. | |
| 2841 __ Push(a0); | |
| 2842 // We cannot use a tail call here because this builtin can also be called | |
| 2843 // from wasm. | |
| 2844 __ CallRuntime(Runtime::kStringToNumber); | |
| 2845 } | |
| 2846 __ Ret(); | |
| 2847 } | |
| 2848 | |
| 2849 // static | |
| 2850 void Builtins::Generate_ToNumber(MacroAssembler* masm) { | 2825 void Builtins::Generate_ToNumber(MacroAssembler* masm) { |
| 2851 // The ToNumber stub takes one argument in a0. | 2826 // The ToNumber stub takes one argument in a0. |
| 2852 Label not_smi; | 2827 Label not_smi; |
| 2853 __ JumpIfNotSmi(a0, ¬_smi); | 2828 __ JumpIfNotSmi(a0, ¬_smi); |
| 2854 __ Ret(USE_DELAY_SLOT); | 2829 __ Ret(USE_DELAY_SLOT); |
| 2855 __ mov(v0, a0); | 2830 __ mov(v0, a0); |
| 2856 __ bind(¬_smi); | 2831 __ bind(¬_smi); |
| 2857 | 2832 |
| 2858 Label not_heap_number; | 2833 Label not_heap_number; |
| 2859 __ GetObjectType(a0, a1, a1); | 2834 __ GetObjectType(a0, a1, a1); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2999 __ break_(0xCC); | 2974 __ break_(0xCC); |
| 3000 } | 2975 } |
| 3001 } | 2976 } |
| 3002 | 2977 |
| 3003 #undef __ | 2978 #undef __ |
| 3004 | 2979 |
| 3005 } // namespace internal | 2980 } // namespace internal |
| 3006 } // namespace v8 | 2981 } // namespace v8 |
| 3007 | 2982 |
| 3008 #endif // V8_TARGET_ARCH_MIPS64 | 2983 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |