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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2828 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); | 2828 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); |
2829 __ Branch(&runtime, ne, at, Operand(zero_reg)); | 2829 __ Branch(&runtime, ne, at, Operand(zero_reg)); |
2830 __ IndexFromHash(a2, v0); | 2830 __ IndexFromHash(a2, v0); |
2831 __ Ret(); | 2831 __ Ret(); |
2832 | 2832 |
2833 __ bind(&runtime); | 2833 __ bind(&runtime); |
2834 __ Push(a0); // Push argument. | 2834 __ Push(a0); // Push argument. |
2835 __ TailCallRuntime(Runtime::kStringToNumber); | 2835 __ TailCallRuntime(Runtime::kStringToNumber); |
2836 } | 2836 } |
2837 | 2837 |
2838 void ToLengthStub::Generate(MacroAssembler* masm) { | |
2839 // The ToLength stub takes on argument in a0. | |
2840 Label not_smi, positive_smi; | |
2841 __ JumpIfNotSmi(a0, ¬_smi); | |
2842 STATIC_ASSERT(kSmiTag == 0); | |
2843 __ Branch(&positive_smi, ge, a0, Operand(zero_reg)); | |
2844 __ mov(a0, zero_reg); | |
2845 __ bind(&positive_smi); | |
2846 __ Ret(USE_DELAY_SLOT); | |
2847 __ mov(v0, a0); | |
2848 __ bind(¬_smi); | |
2849 | |
2850 __ push(a0); // Push argument. | |
2851 __ TailCallRuntime(Runtime::kToLength); | |
2852 } | |
2853 | |
2854 | |
2855 void ToStringStub::Generate(MacroAssembler* masm) { | 2838 void ToStringStub::Generate(MacroAssembler* masm) { |
2856 // The ToString stub takes on argument in a0. | 2839 // The ToString stub takes on argument in a0. |
2857 Label is_number; | 2840 Label is_number; |
2858 __ JumpIfSmi(a0, &is_number); | 2841 __ JumpIfSmi(a0, &is_number); |
2859 | 2842 |
2860 Label not_string; | 2843 Label not_string; |
2861 __ GetObjectType(a0, a1, a1); | 2844 __ GetObjectType(a0, a1, a1); |
2862 // a0: receiver | 2845 // a0: receiver |
2863 // a1: receiver instance type | 2846 // a1: receiver instance type |
2864 __ Branch(¬_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); | 2847 __ Branch(¬_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); |
(...skipping 2907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5772 return_value_operand, NULL); | 5755 return_value_operand, NULL); |
5773 } | 5756 } |
5774 | 5757 |
5775 | 5758 |
5776 #undef __ | 5759 #undef __ |
5777 | 5760 |
5778 } // namespace internal | 5761 } // namespace internal |
5779 } // namespace v8 | 5762 } // namespace v8 |
5780 | 5763 |
5781 #endif // V8_TARGET_ARCH_MIPS64 | 5764 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |