OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 2774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2785 | 2785 |
2786 // Check if string has a cached array index. | 2786 // Check if string has a cached array index. |
2787 Label runtime; | 2787 Label runtime; |
2788 __ Ldr(x2, FieldMemOperand(x0, String::kHashFieldOffset)); | 2788 __ Ldr(x2, FieldMemOperand(x0, String::kHashFieldOffset)); |
2789 __ Tst(x2, Operand(String::kContainsCachedArrayIndexMask)); | 2789 __ Tst(x2, Operand(String::kContainsCachedArrayIndexMask)); |
2790 __ B(ne, &runtime); | 2790 __ B(ne, &runtime); |
2791 __ IndexFromHash(x2, x0); | 2791 __ IndexFromHash(x2, x0); |
2792 __ Ret(); | 2792 __ Ret(); |
2793 | 2793 |
2794 __ Bind(&runtime); | 2794 __ Bind(&runtime); |
2795 __ Push(x0); // Push argument. | 2795 { |
2796 __ TailCallRuntime(Runtime::kStringToNumber); | 2796 FrameScope frame(masm, StackFrame::INTERNAL); |
| 2797 // Push argument. |
| 2798 __ Push(x0); |
| 2799 // We cannot use a tail call here because this builtin can also be called |
| 2800 // from wasm. |
| 2801 __ CallRuntime(Runtime::kStringToNumber); |
| 2802 } |
| 2803 __ Ret(); |
2797 } | 2804 } |
2798 | 2805 |
2799 // static | 2806 // static |
2800 void Builtins::Generate_ToNumber(MacroAssembler* masm) { | 2807 void Builtins::Generate_ToNumber(MacroAssembler* masm) { |
2801 // The ToNumber stub takes one argument in x0. | 2808 // The ToNumber stub takes one argument in x0. |
2802 Label not_smi; | 2809 Label not_smi; |
2803 __ JumpIfNotSmi(x0, ¬_smi); | 2810 __ JumpIfNotSmi(x0, ¬_smi); |
2804 __ Ret(); | 2811 __ Ret(); |
2805 __ Bind(¬_smi); | 2812 __ Bind(¬_smi); |
2806 | 2813 |
(...skipping 22 matching lines...) Expand all Loading... |
2829 __ Jump(masm->isolate()->builtins()->StringToNumber(), | 2836 __ Jump(masm->isolate()->builtins()->StringToNumber(), |
2830 RelocInfo::CODE_TARGET); | 2837 RelocInfo::CODE_TARGET); |
2831 __ Bind(¬_string); | 2838 __ Bind(¬_string); |
2832 | 2839 |
2833 Label not_oddball; | 2840 Label not_oddball; |
2834 __ Cmp(x1, ODDBALL_TYPE); | 2841 __ Cmp(x1, ODDBALL_TYPE); |
2835 __ B(ne, ¬_oddball); | 2842 __ B(ne, ¬_oddball); |
2836 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset)); | 2843 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset)); |
2837 __ Ret(); | 2844 __ Ret(); |
2838 __ Bind(¬_oddball); | 2845 __ Bind(¬_oddball); |
2839 | 2846 { |
2840 __ Push(x0); // Push argument. | 2847 FrameScope frame(masm, StackFrame::INTERNAL); |
2841 __ TailCallRuntime(Runtime::kToNumber); | 2848 // Push argument. |
| 2849 __ Push(x0); |
| 2850 // We cannot use a tail call here because this builtin can also be called |
| 2851 // from wasm. |
| 2852 __ CallRuntime(Runtime::kToNumber); |
| 2853 } |
| 2854 __ Ret(); |
2842 } | 2855 } |
2843 | 2856 |
2844 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2857 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2845 ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); | 2858 ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); |
2846 // ----------- S t a t e ------------- | 2859 // ----------- S t a t e ------------- |
2847 // -- x0 : actual number of arguments | 2860 // -- x0 : actual number of arguments |
2848 // -- x1 : function (passed through to callee) | 2861 // -- x1 : function (passed through to callee) |
2849 // -- x2 : expected number of arguments | 2862 // -- x2 : expected number of arguments |
2850 // -- x3 : new target (passed through to callee) | 2863 // -- x3 : new target (passed through to callee) |
2851 // ----------------------------------- | 2864 // ----------------------------------- |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2986 } | 2999 } |
2987 } | 3000 } |
2988 | 3001 |
2989 | 3002 |
2990 #undef __ | 3003 #undef __ |
2991 | 3004 |
2992 } // namespace internal | 3005 } // namespace internal |
2993 } // namespace v8 | 3006 } // namespace v8 |
2994 | 3007 |
2995 #endif // V8_TARGET_ARCH_ARM | 3008 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |