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

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

Issue 770303002: Support non-deoptimizing version of UnboxInt32 for integer definitions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cpu.h" 8 #include "vm/cpu.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_allocator.h" 10 #include "vm/flow_graph_allocator.h"
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 const intptr_t value_cid = value()->Type()->ToCid(); 1195 const intptr_t value_cid = value()->Type()->ToCid();
1196 if (value_cid == kSmiCid) { 1196 if (value_cid == kSmiCid) {
1197 return (kSmiBits > 32) && 1197 return (kSmiBits > 32) &&
1198 !is_truncating() && 1198 !is_truncating() &&
1199 !RangeUtils::Fits(value()->definition()->range(), 1199 !RangeUtils::Fits(value()->definition()->range(),
1200 RangeBoundary::kRangeBoundaryInt32); 1200 RangeBoundary::kRangeBoundaryInt32);
1201 } else if (value_cid == kMintCid) { 1201 } else if (value_cid == kMintCid) {
1202 return !is_truncating() && 1202 return !is_truncating() &&
1203 !RangeUtils::Fits(value()->definition()->range(), 1203 !RangeUtils::Fits(value()->definition()->range(),
1204 RangeBoundary::kRangeBoundaryInt32); 1204 RangeBoundary::kRangeBoundaryInt32);
1205 } else if ((kSmiBits < 32) && value()->Type()->IsInt()) {
1206 // Note: we don't support truncation of Bigint values.
1207 return !RangeUtils::Fits(value()->definition()->range(),
1208 RangeBoundary::kRangeBoundaryInt32);
1205 } else { 1209 } else {
1206 return true; 1210 return true;
1207 } 1211 }
1208 } 1212 }
1209 1213
1210 1214
1211 bool BinaryInt32OpInstr::CanDeoptimize() const { 1215 bool BinaryInt32OpInstr::CanDeoptimize() const {
1212 switch (op_kind()) { 1216 switch (op_kind()) {
1213 case Token::kBIT_AND: 1217 case Token::kBIT_AND:
1214 case Token::kBIT_OR: 1218 case Token::kBIT_OR:
(...skipping 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after
3434 case Token::kTRUNCDIV: return 0; 3438 case Token::kTRUNCDIV: return 0;
3435 case Token::kMOD: return 1; 3439 case Token::kMOD: return 1;
3436 default: UNIMPLEMENTED(); return -1; 3440 default: UNIMPLEMENTED(); return -1;
3437 } 3441 }
3438 } 3442 }
3439 3443
3440 3444
3441 #undef __ 3445 #undef __
3442 3446
3443 } // namespace dart 3447 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_arm.cc » ('j') | runtime/vm/intermediate_language_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698