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

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 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result); 2571 EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result);
2572 } 2572 }
2573 return; 2573 return;
2574 } 2574 }
2575 2575
2576 const bool right_needs_check = 2576 const bool right_needs_check =
2577 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); 2577 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1));
2578 if (is_truncating) { 2578 if (is_truncating) {
2579 if (right_needs_check) { 2579 if (right_needs_check) {
2580 const bool right_may_be_negative = 2580 const bool right_may_be_negative =
2581 (right_range == NULL) || 2581 (right_range == NULL) || right_range->IsNegative();
2582 !right_range->IsWithin(0, RangeBoundary::kPlusInfinity);
2583 if (right_may_be_negative) { 2582 if (right_may_be_negative) {
2584 ASSERT(shift_left->CanDeoptimize()); 2583 ASSERT(shift_left->CanDeoptimize());
2585 __ CompareRegisters(right, ZR); 2584 __ CompareRegisters(right, ZR);
2586 __ b(deopt, MI); 2585 __ b(deopt, MI);
2587 } 2586 }
2588 2587
2589 __ CompareImmediate( 2588 __ CompareImmediate(
2590 right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)), PP); 2589 right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)), PP);
2591 __ csel(result, ZR, result, CS); 2590 __ csel(result, ZR, result, CS);
2592 __ SmiUntag(TMP, right); 2591 __ SmiUntag(TMP, right);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
2905 } 2904 }
2906 case Token::kSHR: { 2905 case Token::kSHR: {
2907 if (CanDeoptimize()) { 2906 if (CanDeoptimize()) {
2908 __ CompareRegisters(right, ZR); 2907 __ CompareRegisters(right, ZR);
2909 __ b(deopt, LT); 2908 __ b(deopt, LT);
2910 } 2909 }
2911 __ SmiUntag(TMP, right); 2910 __ SmiUntag(TMP, right);
2912 // sarl operation masks the count to 6 bits. 2911 // sarl operation masks the count to 6 bits.
2913 const intptr_t kCountLimit = 0x3F; 2912 const intptr_t kCountLimit = 0x3F;
2914 if ((right_range == NULL) || 2913 if ((right_range == NULL) ||
2915 !right_range->IsWithin(RangeBoundary::kMinusInfinity, kCountLimit)) { 2914 !right_range->OnlyLessThanOrEqualTo(kCountLimit)) {
2916 __ LoadImmediate(TMP2, kCountLimit, PP); 2915 __ LoadImmediate(TMP2, kCountLimit, PP);
2917 __ CompareRegisters(TMP, TMP2); 2916 __ CompareRegisters(TMP, TMP2);
2918 __ csel(TMP, TMP2, TMP, GT); 2917 __ csel(TMP, TMP2, TMP, GT);
2919 } 2918 }
2920 const Register temp = locs()->temp(0).reg(); 2919 const Register temp = locs()->temp(0).reg();
2921 __ SmiUntag(temp, left); 2920 __ SmiUntag(temp, left);
2922 __ asrv(result, temp, TMP); 2921 __ asrv(result, temp, TMP);
2923 __ SmiTag(result); 2922 __ SmiTag(result);
2924 break; 2923 break;
2925 } 2924 }
(...skipping 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after
5325 compiler->GenerateCall(token_pos(), 5324 compiler->GenerateCall(token_pos(),
5326 &label, 5325 &label,
5327 PcDescriptors::kOther, 5326 PcDescriptors::kOther,
5328 locs()); 5327 locs());
5329 __ Drop(ArgumentCount()); // Discard arguments. 5328 __ Drop(ArgumentCount()); // Discard arguments.
5330 } 5329 }
5331 5330
5332 } // namespace dart 5331 } // namespace dart
5333 5332
5334 #endif // defined TARGET_ARCH_ARM64 5333 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698