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/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 3860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3871 __ B(ne, ¬_oddball); | 3871 __ B(ne, ¬_oddball); |
3872 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToStringOffset)); | 3872 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToStringOffset)); |
3873 __ Ret(); | 3873 __ Ret(); |
3874 __ Bind(¬_oddball); | 3874 __ Bind(¬_oddball); |
3875 | 3875 |
3876 __ Push(x0); // Push argument. | 3876 __ Push(x0); // Push argument. |
3877 __ TailCallRuntime(Runtime::kToString); | 3877 __ TailCallRuntime(Runtime::kToString); |
3878 } | 3878 } |
3879 | 3879 |
3880 | 3880 |
| 3881 void ToNameStub::Generate(MacroAssembler* masm) { |
| 3882 // The ToName stub takes one argument in x0. |
| 3883 Label is_number; |
| 3884 __ JumpIfSmi(x0, &is_number); |
| 3885 |
| 3886 Label not_name; |
| 3887 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); |
| 3888 __ JumpIfObjectType(x0, x1, x1, LAST_NAME_TYPE, ¬_name, hi); |
| 3889 // x0: receiver |
| 3890 // x1: receiver instance type |
| 3891 __ Ret(); |
| 3892 __ Bind(¬_name); |
| 3893 |
| 3894 Label not_heap_number; |
| 3895 __ Cmp(x1, HEAP_NUMBER_TYPE); |
| 3896 __ B(ne, ¬_heap_number); |
| 3897 __ Bind(&is_number); |
| 3898 NumberToStringStub stub(isolate()); |
| 3899 __ TailCallStub(&stub); |
| 3900 __ Bind(¬_heap_number); |
| 3901 |
| 3902 Label not_oddball; |
| 3903 __ Cmp(x1, ODDBALL_TYPE); |
| 3904 __ B(ne, ¬_oddball); |
| 3905 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToStringOffset)); |
| 3906 __ Ret(); |
| 3907 __ Bind(¬_oddball); |
| 3908 |
| 3909 __ Push(x0); // Push argument. |
| 3910 __ TailCallRuntime(Runtime::kToName); |
| 3911 } |
| 3912 |
| 3913 |
3881 void StringHelper::GenerateFlatOneByteStringEquals( | 3914 void StringHelper::GenerateFlatOneByteStringEquals( |
3882 MacroAssembler* masm, Register left, Register right, Register scratch1, | 3915 MacroAssembler* masm, Register left, Register right, Register scratch1, |
3883 Register scratch2, Register scratch3) { | 3916 Register scratch2, Register scratch3) { |
3884 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); | 3917 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); |
3885 Register result = x0; | 3918 Register result = x0; |
3886 Register left_length = scratch1; | 3919 Register left_length = scratch1; |
3887 Register right_length = scratch2; | 3920 Register right_length = scratch2; |
3888 | 3921 |
3889 // Compare lengths. If lengths differ, strings can't be equal. Lengths are | 3922 // Compare lengths. If lengths differ, strings can't be equal. Lengths are |
3890 // smis, and don't need to be untagged. | 3923 // smis, and don't need to be untagged. |
(...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5854 MemOperand(fp, 6 * kPointerSize), NULL); | 5887 MemOperand(fp, 6 * kPointerSize), NULL); |
5855 } | 5888 } |
5856 | 5889 |
5857 | 5890 |
5858 #undef __ | 5891 #undef __ |
5859 | 5892 |
5860 } // namespace internal | 5893 } // namespace internal |
5861 } // namespace v8 | 5894 } // namespace v8 |
5862 | 5895 |
5863 #endif // V8_TARGET_ARCH_ARM64 | 5896 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |