Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: runtime/vm/intermediate_language_arm64.cc

Issue 321593004: Refactor RangeBoundary +/- infinity to be distinct RangeBoundary kinds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after
2572 EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result); 2572 EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result);
2573 } 2573 }
2574 return; 2574 return;
2575 } 2575 }
2576 2576
2577 const bool right_needs_check = 2577 const bool right_needs_check =
2578 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); 2578 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1));
2579 if (is_truncating) { 2579 if (is_truncating) {
2580 if (right_needs_check) { 2580 if (right_needs_check) {
2581 const bool right_may_be_negative = 2581 const bool right_may_be_negative =
2582 (right_range == NULL) || 2582 (right_range == NULL) || right_range->IsNegative();
2583 !right_range->IsWithin(0, RangeBoundary::kPlusInfinity);
2584 if (right_may_be_negative) { 2583 if (right_may_be_negative) {
2585 ASSERT(shift_left->CanDeoptimize()); 2584 ASSERT(shift_left->CanDeoptimize());
2586 __ CompareRegisters(right, ZR); 2585 __ CompareRegisters(right, ZR);
2587 __ b(deopt, MI); 2586 __ b(deopt, MI);
2588 } 2587 }
2589 2588
2590 __ CompareImmediate( 2589 __ CompareImmediate(
2591 right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)), PP); 2590 right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)), PP);
2592 __ csel(result, ZR, result, CS); 2591 __ csel(result, ZR, result, CS);
2593 __ SmiUntag(TMP, right); 2592 __ SmiUntag(TMP, right);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
2906 } 2905 }
2907 case Token::kSHR: { 2906 case Token::kSHR: {
2908 if (CanDeoptimize()) { 2907 if (CanDeoptimize()) {
2909 __ CompareRegisters(right, ZR); 2908 __ CompareRegisters(right, ZR);
2910 __ b(deopt, LT); 2909 __ b(deopt, LT);
2911 } 2910 }
2912 __ SmiUntag(TMP, right); 2911 __ SmiUntag(TMP, right);
2913 // sarl operation masks the count to 6 bits. 2912 // sarl operation masks the count to 6 bits.
2914 const intptr_t kCountLimit = 0x3F; 2913 const intptr_t kCountLimit = 0x3F;
2915 if ((right_range == NULL) || 2914 if ((right_range == NULL) ||
2916 !right_range->IsWithin(RangeBoundary::kMinusInfinity, kCountLimit)) { 2915 !right_range->OnlyLessThanOrEqualTo(kCountLimit)) {
2917 __ LoadImmediate(TMP2, kCountLimit, PP); 2916 __ LoadImmediate(TMP2, kCountLimit, PP);
2918 __ CompareRegisters(TMP, TMP2); 2917 __ CompareRegisters(TMP, TMP2);
2919 __ csel(TMP, TMP2, TMP, GT); 2918 __ csel(TMP, TMP2, TMP, GT);
2920 } 2919 }
2921 const Register temp = locs()->temp(0).reg(); 2920 const Register temp = locs()->temp(0).reg();
2922 __ SmiUntag(temp, left); 2921 __ SmiUntag(temp, left);
2923 __ asrv(result, temp, TMP); 2922 __ asrv(result, temp, TMP);
2924 __ SmiTag(result); 2923 __ SmiTag(result);
2925 break; 2924 break;
2926 } 2925 }
(...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after
5328 compiler->GenerateCall(token_pos(), 5327 compiler->GenerateCall(token_pos(),
5329 &label, 5328 &label,
5330 PcDescriptors::kOther, 5329 PcDescriptors::kOther,
5331 locs()); 5330 locs());
5332 __ Drop(ArgumentCount()); // Discard arguments. 5331 __ Drop(ArgumentCount()); // Discard arguments.
5333 } 5332 }
5334 5333
5335 } // namespace dart 5334 } // namespace dart
5336 5335
5337 #endif // defined TARGET_ARCH_ARM64 5336 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698