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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2824 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); | 2824 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); |
2825 __ Branch(&runtime, ne, at, Operand(zero_reg)); | 2825 __ Branch(&runtime, ne, at, Operand(zero_reg)); |
2826 __ IndexFromHash(a2, v0); | 2826 __ IndexFromHash(a2, v0); |
2827 __ Ret(); | 2827 __ Ret(); |
2828 | 2828 |
2829 __ bind(&runtime); | 2829 __ bind(&runtime); |
2830 __ Push(a0); // Push argument. | 2830 __ Push(a0); // Push argument. |
2831 __ TailCallRuntime(Runtime::kStringToNumber); | 2831 __ TailCallRuntime(Runtime::kStringToNumber); |
2832 } | 2832 } |
2833 | 2833 |
2834 void ToLengthStub::Generate(MacroAssembler* masm) { | |
2835 // The ToLength stub takes on argument in a0. | |
2836 Label not_smi, positive_smi; | |
2837 __ JumpIfNotSmi(a0, ¬_smi); | |
2838 STATIC_ASSERT(kSmiTag == 0); | |
2839 __ Branch(&positive_smi, ge, a0, Operand(zero_reg)); | |
2840 __ mov(a0, zero_reg); | |
2841 __ bind(&positive_smi); | |
2842 __ Ret(USE_DELAY_SLOT); | |
2843 __ mov(v0, a0); | |
2844 __ bind(¬_smi); | |
2845 | |
2846 __ push(a0); // Push argument. | |
2847 __ TailCallRuntime(Runtime::kToLength); | |
2848 } | |
2849 | |
2850 | |
2851 void ToStringStub::Generate(MacroAssembler* masm) { | 2834 void ToStringStub::Generate(MacroAssembler* masm) { |
2852 // The ToString stub takes on argument in a0. | 2835 // The ToString stub takes on argument in a0. |
2853 Label is_number; | 2836 Label is_number; |
2854 __ JumpIfSmi(a0, &is_number); | 2837 __ JumpIfSmi(a0, &is_number); |
2855 | 2838 |
2856 Label not_string; | 2839 Label not_string; |
2857 __ GetObjectType(a0, a1, a1); | 2840 __ GetObjectType(a0, a1, a1); |
2858 // a0: receiver | 2841 // a0: receiver |
2859 // a1: receiver instance type | 2842 // a1: receiver instance type |
2860 __ Branch(¬_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); | 2843 __ Branch(¬_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); |
(...skipping 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5744 return_value_operand, NULL); | 5727 return_value_operand, NULL); |
5745 } | 5728 } |
5746 | 5729 |
5747 | 5730 |
5748 #undef __ | 5731 #undef __ |
5749 | 5732 |
5750 } // namespace internal | 5733 } // namespace internal |
5751 } // namespace v8 | 5734 } // namespace v8 |
5752 | 5735 |
5753 #endif // V8_TARGET_ARCH_MIPS | 5736 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |