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/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3992 __ B(ne, ¬_oddball); | 3992 __ B(ne, ¬_oddball); |
3993 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset)); | 3993 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToNumberOffset)); |
3994 __ Ret(); | 3994 __ Ret(); |
3995 __ Bind(¬_oddball); | 3995 __ Bind(¬_oddball); |
3996 | 3996 |
3997 __ Push(x0); // Push argument. | 3997 __ Push(x0); // Push argument. |
3998 __ TailCallRuntime(Runtime::kToNumber, 1, 1); | 3998 __ TailCallRuntime(Runtime::kToNumber, 1, 1); |
3999 } | 3999 } |
4000 | 4000 |
4001 | 4001 |
| 4002 void ToStringStub::Generate(MacroAssembler* masm) { |
| 4003 // The ToString stub takes one argument in x0. |
| 4004 Label is_number; |
| 4005 __ JumpIfSmi(x0, &is_number); |
| 4006 |
| 4007 Label not_string; |
| 4008 __ JumpIfObjectType(x0, x1, x1, FIRST_NONSTRING_TYPE, ¬_string, hs); |
| 4009 // x0: receiver |
| 4010 // x1: receiver instance type |
| 4011 __ Ret(); |
| 4012 __ Bind(¬_string); |
| 4013 |
| 4014 Label not_heap_number; |
| 4015 __ Cmp(x1, HEAP_NUMBER_TYPE); |
| 4016 __ B(ne, ¬_heap_number); |
| 4017 __ Bind(&is_number); |
| 4018 NumberToStringStub stub(isolate()); |
| 4019 __ TailCallStub(&stub); |
| 4020 __ Bind(¬_heap_number); |
| 4021 |
| 4022 Label not_oddball; |
| 4023 __ Cmp(x1, ODDBALL_TYPE); |
| 4024 __ B(ne, ¬_oddball); |
| 4025 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToStringOffset)); |
| 4026 __ Ret(); |
| 4027 __ Bind(¬_oddball); |
| 4028 |
| 4029 __ Push(x0); // Push argument. |
| 4030 __ TailCallRuntime(Runtime::kToString, 1, 1); |
| 4031 } |
| 4032 |
| 4033 |
4002 void StringHelper::GenerateFlatOneByteStringEquals( | 4034 void StringHelper::GenerateFlatOneByteStringEquals( |
4003 MacroAssembler* masm, Register left, Register right, Register scratch1, | 4035 MacroAssembler* masm, Register left, Register right, Register scratch1, |
4004 Register scratch2, Register scratch3) { | 4036 Register scratch2, Register scratch3) { |
4005 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); | 4037 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); |
4006 Register result = x0; | 4038 Register result = x0; |
4007 Register left_length = scratch1; | 4039 Register left_length = scratch1; |
4008 Register right_length = scratch2; | 4040 Register right_length = scratch2; |
4009 | 4041 |
4010 // Compare lengths. If lengths differ, strings can't be equal. Lengths are | 4042 // Compare lengths. If lengths differ, strings can't be equal. Lengths are |
4011 // smis, and don't need to be untagged. | 4043 // smis, and don't need to be untagged. |
(...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5911 MemOperand(fp, 6 * kPointerSize), NULL); | 5943 MemOperand(fp, 6 * kPointerSize), NULL); |
5912 } | 5944 } |
5913 | 5945 |
5914 | 5946 |
5915 #undef __ | 5947 #undef __ |
5916 | 5948 |
5917 } // namespace internal | 5949 } // namespace internal |
5918 } // namespace v8 | 5950 } // namespace v8 |
5919 | 5951 |
5920 #endif // V8_TARGET_ARCH_ARM64 | 5952 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |