| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2573 EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result); | 2573 EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result); |
| 2574 } | 2574 } |
| 2575 return; | 2575 return; |
| 2576 } | 2576 } |
| 2577 | 2577 |
| 2578 const bool right_needs_check = | 2578 const bool right_needs_check = |
| 2579 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); | 2579 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); |
| 2580 if (is_truncating) { | 2580 if (is_truncating) { |
| 2581 if (right_needs_check) { | 2581 if (right_needs_check) { |
| 2582 const bool right_may_be_negative = | 2582 const bool right_may_be_negative = |
| 2583 (right_range == NULL) || right_range->IsNegative(); | 2583 (right_range == NULL) || !right_range->IsPositive(); |
| 2584 if (right_may_be_negative) { | 2584 if (right_may_be_negative) { |
| 2585 ASSERT(shift_left->CanDeoptimize()); | 2585 ASSERT(shift_left->CanDeoptimize()); |
| 2586 __ CompareRegisters(right, ZR); | 2586 __ CompareRegisters(right, ZR); |
| 2587 __ b(deopt, MI); | 2587 __ b(deopt, MI); |
| 2588 } | 2588 } |
| 2589 | 2589 |
| 2590 __ CompareImmediate( | 2590 __ CompareImmediate( |
| 2591 right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)), PP); | 2591 right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)), PP); |
| 2592 __ csel(result, ZR, result, CS); | 2592 __ csel(result, ZR, result, CS); |
| 2593 __ SmiUntag(TMP, right); | 2593 __ SmiUntag(TMP, right); |
| (...skipping 2734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5328 compiler->GenerateCall(token_pos(), | 5328 compiler->GenerateCall(token_pos(), |
| 5329 &label, | 5329 &label, |
| 5330 PcDescriptors::kOther, | 5330 PcDescriptors::kOther, |
| 5331 locs()); | 5331 locs()); |
| 5332 __ Drop(ArgumentCount()); // Discard arguments. | 5332 __ Drop(ArgumentCount()); // Discard arguments. |
| 5333 } | 5333 } |
| 5334 | 5334 |
| 5335 } // namespace dart | 5335 } // namespace dart |
| 5336 | 5336 |
| 5337 #endif // defined TARGET_ARCH_ARM64 | 5337 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |