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

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

Issue 402913002: Don't force range of the RangeBoundary::Shl into the Smi. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix the tests Created 6 years, 5 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
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 ASSERT(value_boundary.IsConstant()); 2725 ASSERT(value_boundary.IsConstant());
2726 ASSERT(shift_count >= 0); 2726 ASSERT(shift_count >= 0);
2727 int64_t limit = 64 - shift_count; 2727 int64_t limit = 64 - shift_count;
2728 int64_t value = static_cast<int64_t>(value_boundary.ConstantValue()); 2728 int64_t value = static_cast<int64_t>(value_boundary.ConstantValue());
2729 2729
2730 if ((value == 0) || 2730 if ((value == 0) ||
2731 (shift_count == 0) || 2731 (shift_count == 0) ||
2732 ((limit > 0) && (Utils::IsInt(limit, value)))) { 2732 ((limit > 0) && (Utils::IsInt(limit, value)))) {
2733 // Result stays in 64 bit range. 2733 // Result stays in 64 bit range.
2734 int64_t result = value << shift_count; 2734 int64_t result = value << shift_count;
2735 return Smi::IsValid(result) ? RangeBoundary(result) : overflow; 2735 return RangeBoundary(result);
2736 } 2736 }
2737 2737
2738 return overflow; 2738 return overflow;
2739 } 2739 }
2740 2740
2741 2741
2742 static RangeBoundary CanonicalizeBoundary(const RangeBoundary& a, 2742 static RangeBoundary CanonicalizeBoundary(const RangeBoundary& a,
2743 const RangeBoundary& overflow) { 2743 const RangeBoundary& overflow) {
2744 if (a.IsConstant() || a.IsInfinity()) { 2744 if (a.IsConstant() || a.IsInfinity()) {
2745 return a; 2745 return a;
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
4105 case Token::kTRUNCDIV: return 0; 4105 case Token::kTRUNCDIV: return 0;
4106 case Token::kMOD: return 1; 4106 case Token::kMOD: return 1;
4107 default: UNIMPLEMENTED(); return -1; 4107 default: UNIMPLEMENTED(); return -1;
4108 } 4108 }
4109 } 4109 }
4110 4110
4111 4111
4112 #undef __ 4112 #undef __
4113 4113
4114 } // namespace dart 4114 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698