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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 3815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3826 StringCharAtGenerator generator(input_string, from, result_length, x0, | 3826 StringCharAtGenerator generator(input_string, from, result_length, x0, |
3827 &runtime, &runtime, &runtime, | 3827 &runtime, &runtime, &runtime, |
3828 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3828 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); |
3829 generator.GenerateFast(masm); | 3829 generator.GenerateFast(masm); |
3830 __ Drop(3); | 3830 __ Drop(3); |
3831 __ Ret(); | 3831 __ Ret(); |
3832 generator.SkipSlow(masm, &runtime); | 3832 generator.SkipSlow(masm, &runtime); |
3833 } | 3833 } |
3834 | 3834 |
3835 | 3835 |
| 3836 void ToNumberStub::Generate(MacroAssembler* masm) { |
| 3837 // The ToNumber stub takes one argument in x0. |
| 3838 Label check_heap_number, call_builtin; |
| 3839 __ JumpIfNotSmi(x0, &check_heap_number); |
| 3840 __ Ret(); |
| 3841 |
| 3842 __ bind(&check_heap_number); |
| 3843 __ JumpIfNotHeapNumber(x0, &call_builtin); |
| 3844 __ Ret(); |
| 3845 |
| 3846 __ bind(&call_builtin); |
| 3847 __ push(x0); |
| 3848 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); |
| 3849 } |
| 3850 |
| 3851 |
3836 void StringHelper::GenerateFlatOneByteStringEquals( | 3852 void StringHelper::GenerateFlatOneByteStringEquals( |
3837 MacroAssembler* masm, Register left, Register right, Register scratch1, | 3853 MacroAssembler* masm, Register left, Register right, Register scratch1, |
3838 Register scratch2, Register scratch3) { | 3854 Register scratch2, Register scratch3) { |
3839 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); | 3855 DCHECK(!AreAliased(left, right, scratch1, scratch2, scratch3)); |
3840 Register result = x0; | 3856 Register result = x0; |
3841 Register left_length = scratch1; | 3857 Register left_length = scratch1; |
3842 Register right_length = scratch2; | 3858 Register right_length = scratch2; |
3843 | 3859 |
3844 // Compare lengths. If lengths differ, strings can't be equal. Lengths are | 3860 // Compare lengths. If lengths differ, strings can't be equal. Lengths are |
3845 // smis, and don't need to be untagged. | 3861 // smis, and don't need to be untagged. |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5101 MemOperand(fp, 6 * kPointerSize), | 5117 MemOperand(fp, 6 * kPointerSize), |
5102 NULL); | 5118 NULL); |
5103 } | 5119 } |
5104 | 5120 |
5105 | 5121 |
5106 #undef __ | 5122 #undef __ |
5107 | 5123 |
5108 } } // namespace v8::internal | 5124 } } // namespace v8::internal |
5109 | 5125 |
5110 #endif // V8_TARGET_ARCH_ARM64 | 5126 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |