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

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 2916 matching lines...) Expand 10 before | Expand all | Expand 10 after
2927 __ Lsl(result, left, IP); 2927 __ Lsl(result, left, IP);
2928 } 2928 }
2929 return; 2929 return;
2930 } 2930 }
2931 2931
2932 const bool right_needs_check = 2932 const bool right_needs_check =
2933 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1)); 2933 (right_range == NULL) || !right_range->IsWithin(0, (Smi::kBits - 1));
2934 if (is_truncating) { 2934 if (is_truncating) {
2935 if (right_needs_check) { 2935 if (right_needs_check) {
2936 const bool right_may_be_negative = 2936 const bool right_may_be_negative =
2937 (right_range == NULL) || 2937 (right_range == NULL) || right_range->IsNegative();
2938 !right_range->IsWithin(0, RangeBoundary::kPlusInfinity);
2939 if (right_may_be_negative) { 2938 if (right_may_be_negative) {
2940 ASSERT(shift_left->CanDeoptimize()); 2939 ASSERT(shift_left->CanDeoptimize());
2941 __ cmp(right, Operand(0)); 2940 __ cmp(right, Operand(0));
2942 __ b(deopt, MI); 2941 __ b(deopt, MI);
2943 } 2942 }
2944 2943
2945 __ cmp(right, Operand(reinterpret_cast<int32_t>(Smi::New(Smi::kBits)))); 2944 __ cmp(right, Operand(reinterpret_cast<int32_t>(Smi::New(Smi::kBits))));
2946 __ mov(result, Operand(0), CS); 2945 __ mov(result, Operand(0), CS);
2947 __ SmiUntag(IP, right, CC); // SmiUntag right into IP if CC. 2946 __ SmiUntag(IP, right, CC); // SmiUntag right into IP if CC.
2948 __ Lsl(result, left, IP, CC); 2947 __ Lsl(result, left, IP, CC);
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
3315 } 3314 }
3316 case Token::kSHR: { 3315 case Token::kSHR: {
3317 if (CanDeoptimize()) { 3316 if (CanDeoptimize()) {
3318 __ CompareImmediate(right, 0); 3317 __ CompareImmediate(right, 0);
3319 __ b(deopt, LT); 3318 __ b(deopt, LT);
3320 } 3319 }
3321 __ SmiUntag(IP, right); 3320 __ SmiUntag(IP, right);
3322 // sarl operation masks the count to 5 bits. 3321 // sarl operation masks the count to 5 bits.
3323 const intptr_t kCountLimit = 0x1F; 3322 const intptr_t kCountLimit = 0x1F;
3324 if ((right_range == NULL) || 3323 if ((right_range == NULL) ||
3325 !right_range->IsWithin(RangeBoundary::kMinusInfinity, kCountLimit)) { 3324 !right_range->OnlyLessThanOrEqualTo(kCountLimit)) {
3326 __ CompareImmediate(IP, kCountLimit); 3325 __ CompareImmediate(IP, kCountLimit);
3327 __ LoadImmediate(IP, kCountLimit, GT); 3326 __ LoadImmediate(IP, kCountLimit, GT);
3328 } 3327 }
3329 const Register temp = locs()->temp(0).reg(); 3328 const Register temp = locs()->temp(0).reg();
3330 __ SmiUntag(temp, left); 3329 __ SmiUntag(temp, left);
3331 __ Asr(result, temp, IP); 3330 __ Asr(result, temp, IP);
3332 __ SmiTag(result); 3331 __ SmiTag(result);
3333 break; 3332 break;
3334 } 3333 }
3335 case Token::kDIV: { 3334 case Token::kDIV: {
(...skipping 3017 matching lines...) Expand 10 before | Expand all | Expand 10 after
6353 compiler->GenerateCall(token_pos(), 6352 compiler->GenerateCall(token_pos(),
6354 &label, 6353 &label,
6355 PcDescriptors::kOther, 6354 PcDescriptors::kOther,
6356 locs()); 6355 locs());
6357 __ Drop(ArgumentCount()); // Discard arguments. 6356 __ Drop(ArgumentCount()); // Discard arguments.
6358 } 6357 }
6359 6358
6360 } // namespace dart 6359 } // namespace dart
6361 6360
6362 #endif // defined TARGET_ARCH_ARM 6361 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698