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 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2840 // -- x1 : message_id as Smi | 2840 // -- x1 : message_id as Smi |
2841 // -- lr : return address | 2841 // -- lr : return address |
2842 // ----------------------------------- | 2842 // ----------------------------------- |
2843 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); | 2843 MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); |
2844 __ Push(x1); | 2844 __ Push(x1); |
2845 __ Move(cp, Smi::FromInt(0)); | 2845 __ Move(cp, Smi::FromInt(0)); |
2846 __ TailCallRuntime(Runtime::kAbort); | 2846 __ TailCallRuntime(Runtime::kAbort); |
2847 } | 2847 } |
2848 | 2848 |
2849 // static | 2849 // static |
2850 void Builtins::Generate_StringToNumber(MacroAssembler* masm) { | |
2851 // The StringToNumber stub takes one argument in x0. | |
2852 __ AssertString(x0); | |
2853 | |
2854 // Check if string has a cached array index. | |
2855 Label runtime; | |
2856 __ Ldr(x2, FieldMemOperand(x0, String::kHashFieldOffset)); | |
2857 __ Tst(x2, Operand(String::kContainsCachedArrayIndexMask)); | |
2858 __ B(ne, &runtime); | |
2859 __ IndexFromHash(x2, x0); | |
2860 __ Ret(); | |
2861 | |
2862 __ Bind(&runtime); | |
2863 { | |
2864 FrameScope frame(masm, StackFrame::INTERNAL); | |
2865 // Push argument. | |
2866 __ Push(x0); | |
2867 // We cannot use a tail call here because this builtin can also be called | |
2868 // from wasm. | |
2869 __ CallRuntime(Runtime::kStringToNumber); | |
2870 } | |
2871 __ Ret(); | |
2872 } | |
2873 | |
2874 // static | |
2875 void Builtins::Generate_ToNumber(MacroAssembler* masm) { | 2850 void Builtins::Generate_ToNumber(MacroAssembler* masm) { |
2876 // The ToNumber stub takes one argument in x0. | 2851 // The ToNumber stub takes one argument in x0. |
2877 Label not_smi; | 2852 Label not_smi; |
2878 __ JumpIfNotSmi(x0, ¬_smi); | 2853 __ JumpIfNotSmi(x0, ¬_smi); |
2879 __ Ret(); | 2854 __ Ret(); |
2880 __ Bind(¬_smi); | 2855 __ Bind(¬_smi); |
2881 | 2856 |
2882 Label not_heap_number; | 2857 Label not_heap_number; |
2883 __ CompareObjectType(x0, x1, x1, HEAP_NUMBER_TYPE); | 2858 __ CompareObjectType(x0, x1, x1, HEAP_NUMBER_TYPE); |
2884 // x0: receiver | 2859 // x0: receiver |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3035 __ Unreachable(); | 3010 __ Unreachable(); |
3036 } | 3011 } |
3037 } | 3012 } |
3038 | 3013 |
3039 #undef __ | 3014 #undef __ |
3040 | 3015 |
3041 } // namespace internal | 3016 } // namespace internal |
3042 } // namespace v8 | 3017 } // namespace v8 |
3043 | 3018 |
3044 #endif // V8_TARGET_ARCH_ARM | 3019 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |