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