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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2012 switch (op) { | 2012 switch (op) { |
2013 case Token::SAR: | 2013 case Token::SAR: |
2014 __ Ubfx(right, right, kSmiShift, 5); | 2014 __ Ubfx(right, right, kSmiShift, 5); |
2015 __ Asr(result, left, right); | 2015 __ Asr(result, left, right); |
2016 __ Bic(result, result, kSmiShiftMask); | 2016 __ Bic(result, result, kSmiShiftMask); |
2017 break; | 2017 break; |
2018 case Token::SHL: | 2018 case Token::SHL: |
2019 __ Ubfx(right, right, kSmiShift, 5); | 2019 __ Ubfx(right, right, kSmiShift, 5); |
2020 __ Lsl(result, left, right); | 2020 __ Lsl(result, left, right); |
2021 break; | 2021 break; |
2022 case Token::SHR: { | 2022 case Token::SHR: |
2023 Label right_not_zero; | 2023 // If `left >>> right` >= 0x80000000, the result is not representable in a |
2024 __ Cbnz(right, &right_not_zero); | 2024 // signed 32-bit smi. |
2025 __ Tbnz(left, kXSignBit, &stub_call); | |
2026 __ Bind(&right_not_zero); | |
2027 __ Ubfx(right, right, kSmiShift, 5); | 2025 __ Ubfx(right, right, kSmiShift, 5); |
2028 __ Lsr(result, left, right); | 2026 __ Lsr(x10, left, right); |
2029 __ Bic(result, result, kSmiShiftMask); | 2027 __ Tbnz(x10, kXSignBit, &stub_call); |
| 2028 __ Bic(result, x10, kSmiShiftMask); |
2030 break; | 2029 break; |
2031 } | |
2032 case Token::ADD: | 2030 case Token::ADD: |
2033 __ Adds(x10, left, right); | 2031 __ Adds(x10, left, right); |
2034 __ B(vs, &stub_call); | 2032 __ B(vs, &stub_call); |
2035 __ Mov(result, x10); | 2033 __ Mov(result, x10); |
2036 break; | 2034 break; |
2037 case Token::SUB: | 2035 case Token::SUB: |
2038 __ Subs(x10, left, right); | 2036 __ Subs(x10, left, right); |
2039 __ B(vs, &stub_call); | 2037 __ B(vs, &stub_call); |
2040 __ Mov(result, x10); | 2038 __ Mov(result, x10); |
2041 break; | 2039 break; |
(...skipping 2870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4912 return previous_; | 4910 return previous_; |
4913 } | 4911 } |
4914 | 4912 |
4915 | 4913 |
4916 #undef __ | 4914 #undef __ |
4917 | 4915 |
4918 | 4916 |
4919 } } // namespace v8::internal | 4917 } } // namespace v8::internal |
4920 | 4918 |
4921 #endif // V8_TARGET_ARCH_ARM64 | 4919 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |