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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2956 __ B(ne, ¬_oddball); | 2956 __ B(ne, ¬_oddball); |
2957 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToStringOffset)); | 2957 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToStringOffset)); |
2958 __ Ret(); | 2958 __ Ret(); |
2959 __ Bind(¬_oddball); | 2959 __ Bind(¬_oddball); |
2960 | 2960 |
2961 __ Push(x0); // Push argument. | 2961 __ Push(x0); // Push argument. |
2962 __ TailCallRuntime(Runtime::kToString); | 2962 __ TailCallRuntime(Runtime::kToString); |
2963 } | 2963 } |
2964 | 2964 |
2965 | 2965 |
2966 void ToNameStub::Generate(MacroAssembler* masm) { | |
2967 // The ToName stub takes one argument in x0. | |
2968 Label is_number; | |
2969 __ JumpIfSmi(x0, &is_number); | |
2970 | |
2971 Label not_name; | |
2972 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); | |
2973 __ JumpIfObjectType(x0, x1, x1, LAST_NAME_TYPE, ¬_name, hi); | |
2974 // x0: receiver | |
2975 // x1: receiver instance type | |
2976 __ Ret(); | |
2977 __ Bind(¬_name); | |
2978 | |
2979 Label not_heap_number; | |
2980 __ Cmp(x1, HEAP_NUMBER_TYPE); | |
2981 __ B(ne, ¬_heap_number); | |
2982 __ Bind(&is_number); | |
2983 NumberToStringStub stub(isolate()); | |
2984 __ TailCallStub(&stub); | |
2985 __ Bind(¬_heap_number); | |
2986 | |
2987 Label not_oddball; | |
2988 __ Cmp(x1, ODDBALL_TYPE); | |
2989 __ B(ne, ¬_oddball); | |
2990 __ Ldr(x0, FieldMemOperand(x0, Oddball::kToStringOffset)); | |
2991 __ Ret(); | |
2992 __ Bind(¬_oddball); | |
2993 | |
2994 __ Push(x0); // Push argument. | |
2995 __ TailCallRuntime(Runtime::kToName); | |
2996 } | |
2997 | |
2998 | |
2999 void StringHelper::GenerateFlatOneByteStringEquals( | 2966 void StringHelper::GenerateFlatOneByteStringEquals( |
3000 MacroAssembler* masm, Register left, Register right, Register scratch1, | 2967 MacroAssembler* masm, Register left, Register right, Register scratch1, |
3001 Register scratch2, Register scratch3) { | 2968 Register scratch2, Register scratch3) { |
3002 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); | 2969 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); |
3003 Register result = x0; | 2970 Register result = x0; |
3004 Register left_length = scratch1; | 2971 Register left_length = scratch1; |
3005 Register right_length = scratch2; | 2972 Register right_length = scratch2; |
3006 | 2973 |
3007 // Compare lengths. If lengths differ, strings can't be equal. Lengths are | 2974 // Compare lengths. If lengths differ, strings can't be equal. Lengths are |
3008 // smis, and don't need to be untagged. | 2975 // smis, and don't need to be untagged. |
(...skipping 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5575 kStackUnwindSpace, NULL, spill_offset, | 5542 kStackUnwindSpace, NULL, spill_offset, |
5576 return_value_operand, NULL); | 5543 return_value_operand, NULL); |
5577 } | 5544 } |
5578 | 5545 |
5579 #undef __ | 5546 #undef __ |
5580 | 5547 |
5581 } // namespace internal | 5548 } // namespace internal |
5582 } // namespace v8 | 5549 } // namespace v8 |
5583 | 5550 |
5584 #endif // V8_TARGET_ARCH_ARM64 | 5551 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |