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

Side by Side Diff: runtime/vm/intermediate_language_arm.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 2915 matching lines...) Expand 10 before | Expand all | Expand 10 after
2926 __ Lsl(result, left, IP); 2926 __ Lsl(result, left, IP);
2927 } 2927 }
2928 return; 2928 return;
2929 } 2929 }
2930 2930
2931 const bool right_needs_check = 2931 const bool right_needs_check =
2932 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); 2932 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1));
2933 if (is_truncating) { 2933 if (is_truncating) {
2934 if (right_needs_check) { 2934 if (right_needs_check) {
2935 const bool right_may_be_negative = 2935 const bool right_may_be_negative =
2936 (right_range == NULL) || 2936 (right_range == NULL) || right_range->IsNegative();
2937 !right_range->IsWithin(0, RangeBoundary::kPlusInfinity);
2938 if (right_may_be_negative) { 2937 if (right_may_be_negative) {
2939 ASSERT(shift_left->CanDeoptimize()); 2938 ASSERT(shift_left->CanDeoptimize());
2940 __ cmp(right, Operand(0)); 2939 __ cmp(right, Operand(0));
2941 __ b(deopt, MI); 2940 __ b(deopt, MI);
2942 } 2941 }
2943 2942
2944 __ cmp(right, Operand(reinterpret_cast<int32_t>(Smi::New(Smi::kBits)))); 2943 __ cmp(right, Operand(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
2945 __ mov(result, Operand(0), CS); 2944 __ mov(result, Operand(0), CS);
2946 __ SmiUntag(IP, right, CC); // SmiUntag right into IP if CC. 2945 __ SmiUntag(IP, right, CC); // SmiUntag right into IP if CC.
2947 __ Lsl(result, left, IP, CC); 2946 __ Lsl(result, left, IP, CC);
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
3314 } 3313 }
3315 case Token::kSHR: { 3314 case Token::kSHR: {
3316 if (CanDeoptimize()) { 3315 if (CanDeoptimize()) {
3317 __ CompareImmediate(right, 0); 3316 __ CompareImmediate(right, 0);
3318 __ b(deopt, LT); 3317 __ b(deopt, LT);
3319 } 3318 }
3320 __ SmiUntag(IP, right); 3319 __ SmiUntag(IP, right);
3321 // sarl operation masks the count to 5 bits. 3320 // sarl operation masks the count to 5 bits.
3322 const intptr_t kCountLimit = 0x1F; 3321 const intptr_t kCountLimit = 0x1F;
3323 if ((right_range == NULL) || 3322 if ((right_range == NULL) ||
3324 !right_range->IsWithin(RangeBoundary::kMinusInfinity, kCountLimit)) { 3323 !right_range->OnlyLessThanOrEqualTo(kCountLimit)) {
3325 __ CompareImmediate(IP, kCountLimit); 3324 __ CompareImmediate(IP, kCountLimit);
3326 __ LoadImmediate(IP, kCountLimit, GT); 3325 __ LoadImmediate(IP, kCountLimit, GT);
3327 } 3326 }
3328 const Register temp = locs()->temp(0).reg(); 3327 const Register temp = locs()->temp(0).reg();
3329 __ SmiUntag(temp, left); 3328 __ SmiUntag(temp, left);
3330 __ Asr(result, temp, IP); 3329 __ Asr(result, temp, IP);
3331 __ SmiTag(result); 3330 __ SmiTag(result);
3332 break; 3331 break;
3333 } 3332 }
3334 case Token::kDIV: { 3333 case Token::kDIV: {
(...skipping 3015 matching lines...) Expand 10 before | Expand all | Expand 10 after
6350 compiler->GenerateCall(token_pos(), 6349 compiler->GenerateCall(token_pos(),
6351 &label, 6350 &label,
6352 PcDescriptors::kOther, 6351 PcDescriptors::kOther,
6353 locs()); 6352 locs());
6354 __ Drop(ArgumentCount()); // Discard arguments. 6353 __ Drop(ArgumentCount()); // Discard arguments.
6355 } 6354 }
6356 6355
6357 } // namespace dart 6356 } // namespace dart
6358 6357
6359 #endif // defined TARGET_ARCH_ARM 6358 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698