| 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 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 __ B(vs, &stub_call); | 2022 __ B(vs, &stub_call); |
| 2023 __ Mov(result, x10); | 2023 __ Mov(result, x10); |
| 2024 break; | 2024 break; |
| 2025 case Token::SUB: | 2025 case Token::SUB: |
| 2026 __ Subs(x10, left, right); | 2026 __ Subs(x10, left, right); |
| 2027 __ B(vs, &stub_call); | 2027 __ B(vs, &stub_call); |
| 2028 __ Mov(result, x10); | 2028 __ Mov(result, x10); |
| 2029 break; | 2029 break; |
| 2030 case Token::MUL: { | 2030 case Token::MUL: { |
| 2031 Label not_minus_zero, done; | 2031 Label not_minus_zero, done; |
| 2032 STATIC_ASSERT(kSmiShift == (kXRegSizeInBits / 2)); | |
| 2033 STATIC_ASSERT(kSmiTag == 0); | |
| 2034 __ Smulh(x10, left, right); | 2032 __ Smulh(x10, left, right); |
| 2035 __ Cbnz(x10, ¬_minus_zero); | 2033 __ Cbnz(x10, ¬_minus_zero); |
| 2036 __ Eor(x11, left, right); | 2034 __ Eor(x11, left, right); |
| 2037 __ Tbnz(x11, kXSignBit, &stub_call); | 2035 __ Tbnz(x11, kXSignBit, &stub_call); |
| 2036 STATIC_ASSERT(kSmiTag == 0); |
| 2038 __ Mov(result, x10); | 2037 __ Mov(result, x10); |
| 2039 __ B(&done); | 2038 __ B(&done); |
| 2040 __ Bind(¬_minus_zero); | 2039 __ Bind(¬_minus_zero); |
| 2041 __ Cls(x11, x10); | 2040 __ Cls(x11, x10); |
| 2042 __ Cmp(x11, kXRegSizeInBits - kSmiShift); | 2041 __ Cmp(x11, kXRegSizeInBits - kSmiShift); |
| 2043 __ B(lt, &stub_call); | 2042 __ B(lt, &stub_call); |
| 2044 __ SmiTag(result, x10); | 2043 __ SmiTag(result, x10); |
| 2045 __ Bind(&done); | 2044 __ Bind(&done); |
| 2046 break; | 2045 break; |
| 2047 } | 2046 } |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2586 | 2585 |
| 2587 VisitForAccumulatorValue(args->at(0)); | 2586 VisitForAccumulatorValue(args->at(0)); |
| 2588 | 2587 |
| 2589 Label materialize_true, materialize_false; | 2588 Label materialize_true, materialize_false; |
| 2590 Label* if_true = NULL; | 2589 Label* if_true = NULL; |
| 2591 Label* if_false = NULL; | 2590 Label* if_false = NULL; |
| 2592 Label* fall_through = NULL; | 2591 Label* fall_through = NULL; |
| 2593 context()->PrepareTest(&materialize_true, &materialize_false, | 2592 context()->PrepareTest(&materialize_true, &materialize_false, |
| 2594 &if_true, &if_false, &fall_through); | 2593 &if_true, &if_false, &fall_through); |
| 2595 | 2594 |
| 2596 uint64_t sign_mask = V8_UINT64_C(1) << (kSmiShift + kSmiValueSize - 1); | |
| 2597 | |
| 2598 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 2595 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 2599 __ TestAndSplit(x0, kSmiTagMask | sign_mask, if_true, if_false, fall_through); | 2596 __ TestAndSplit(x0, kSmiTagMask | (0x80000000UL << kSmiShift), if_true, |
| 2597 if_false, fall_through); |
| 2600 | 2598 |
| 2601 context()->Plug(if_true, if_false); | 2599 context()->Plug(if_true, if_false); |
| 2602 } | 2600 } |
| 2603 | 2601 |
| 2604 | 2602 |
| 2605 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | 2603 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { |
| 2606 ZoneList<Expression*>* args = expr->arguments(); | 2604 ZoneList<Expression*>* args = expr->arguments(); |
| 2607 ASSERT(args->length() == 1); | 2605 ASSERT(args->length() == 1); |
| 2608 | 2606 |
| 2609 VisitForAccumulatorValue(args->at(0)); | 2607 VisitForAccumulatorValue(args->at(0)); |
| (...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4891 return previous_; | 4889 return previous_; |
| 4892 } | 4890 } |
| 4893 | 4891 |
| 4894 | 4892 |
| 4895 #undef __ | 4893 #undef __ |
| 4896 | 4894 |
| 4897 | 4895 |
| 4898 } } // namespace v8::internal | 4896 } } // namespace v8::internal |
| 4899 | 4897 |
| 4900 #endif // V8_TARGET_ARCH_ARM64 | 4898 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |