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 2744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2755 | 2755 |
2756 // Check if string has a cached array index. | 2756 // Check if string has a cached array index. |
2757 Label runtime; | 2757 Label runtime; |
2758 __ lwu(a2, FieldMemOperand(a0, String::kHashFieldOffset)); | 2758 __ lwu(a2, FieldMemOperand(a0, String::kHashFieldOffset)); |
2759 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); | 2759 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask)); |
2760 __ Branch(&runtime, ne, at, Operand(zero_reg)); | 2760 __ Branch(&runtime, ne, at, Operand(zero_reg)); |
2761 __ IndexFromHash(a2, v0); | 2761 __ IndexFromHash(a2, v0); |
2762 __ Ret(); | 2762 __ Ret(); |
2763 | 2763 |
2764 __ bind(&runtime); | 2764 __ bind(&runtime); |
2765 __ Push(a0); // Push argument. | 2765 { |
2766 __ TailCallRuntime(Runtime::kStringToNumber); | 2766 FrameScope frame(masm, StackFrame::INTERNAL); |
| 2767 // Push argument. |
| 2768 __ Push(a0); |
| 2769 // We cannot use a tail call here because this builtin can also be called |
| 2770 // from wasm. |
| 2771 __ CallRuntime(Runtime::kStringToNumber); |
| 2772 } |
| 2773 __ Ret(); |
2767 } | 2774 } |
2768 | 2775 |
2769 // static | 2776 // static |
2770 void Builtins::Generate_ToNumber(MacroAssembler* masm) { | 2777 void Builtins::Generate_ToNumber(MacroAssembler* masm) { |
2771 // The ToNumber stub takes one argument in a0. | 2778 // The ToNumber stub takes one argument in a0. |
2772 Label not_smi; | 2779 Label not_smi; |
2773 __ JumpIfNotSmi(a0, ¬_smi); | 2780 __ JumpIfNotSmi(a0, ¬_smi); |
2774 __ Ret(USE_DELAY_SLOT); | 2781 __ Ret(USE_DELAY_SLOT); |
2775 __ mov(v0, a0); | 2782 __ mov(v0, a0); |
2776 __ bind(¬_smi); | 2783 __ bind(¬_smi); |
(...skipping 23 matching lines...) Expand all Loading... |
2800 __ Branch(¬_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); | 2807 __ Branch(¬_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); |
2801 __ Jump(masm->isolate()->builtins()->StringToNumber(), | 2808 __ Jump(masm->isolate()->builtins()->StringToNumber(), |
2802 RelocInfo::CODE_TARGET); | 2809 RelocInfo::CODE_TARGET); |
2803 __ bind(¬_string); | 2810 __ bind(¬_string); |
2804 | 2811 |
2805 Label not_oddball; | 2812 Label not_oddball; |
2806 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); | 2813 __ Branch(¬_oddball, ne, a1, Operand(ODDBALL_TYPE)); |
2807 __ Ret(USE_DELAY_SLOT); | 2814 __ Ret(USE_DELAY_SLOT); |
2808 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. | 2815 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. |
2809 __ bind(¬_oddball); | 2816 __ bind(¬_oddball); |
2810 | 2817 { |
2811 __ Push(a0); // Push argument. | 2818 FrameScope frame(masm, StackFrame::INTERNAL); |
2812 __ TailCallRuntime(Runtime::kToNumber); | 2819 // Push argument. |
| 2820 __ Push(a0); |
| 2821 // We cannot use a tail call here because this builtin can also be called |
| 2822 // from wasm. |
| 2823 __ CallRuntime(Runtime::kToNumber); |
| 2824 } |
| 2825 __ Ret(); |
2813 } | 2826 } |
2814 | 2827 |
2815 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2828 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2816 // State setup as expected by MacroAssembler::InvokePrologue. | 2829 // State setup as expected by MacroAssembler::InvokePrologue. |
2817 // ----------- S t a t e ------------- | 2830 // ----------- S t a t e ------------- |
2818 // -- a0: actual arguments count | 2831 // -- a0: actual arguments count |
2819 // -- a1: function (passed through to callee) | 2832 // -- a1: function (passed through to callee) |
2820 // -- a2: expected arguments count | 2833 // -- a2: expected arguments count |
2821 // -- a3: new target (passed through to callee) | 2834 // -- a3: new target (passed through to callee) |
2822 // ----------------------------------- | 2835 // ----------------------------------- |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2945 } | 2958 } |
2946 } | 2959 } |
2947 | 2960 |
2948 | 2961 |
2949 #undef __ | 2962 #undef __ |
2950 | 2963 |
2951 } // namespace internal | 2964 } // namespace internal |
2952 } // namespace v8 | 2965 } // namespace v8 |
2953 | 2966 |
2954 #endif // V8_TARGET_ARCH_MIPS64 | 2967 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |