Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/constant_propagator.h" | 8 #include "vm/constant_propagator.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1250 } else if ((kSmiBits < 32) && value()->Type()->IsInt()) { | 1250 } else if ((kSmiBits < 32) && value()->Type()->IsInt()) { |
| 1251 // Note: we don't support truncation of Bigint values. | 1251 // Note: we don't support truncation of Bigint values. |
| 1252 return !RangeUtils::Fits(value()->definition()->range(), | 1252 return !RangeUtils::Fits(value()->definition()->range(), |
| 1253 RangeBoundary::kRangeBoundaryInt32); | 1253 RangeBoundary::kRangeBoundaryInt32); |
| 1254 } else { | 1254 } else { |
| 1255 return true; | 1255 return true; |
| 1256 } | 1256 } |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 | 1259 |
| 1260 bool UnboxUint32Instr::CanDeoptimize() const { | |
| 1261 ASSERT(is_truncating()); | |
| 1262 if ((value()->Type()->ToCid() == kSmiCid) || | |
| 1263 (value()->Type()->ToCid() == kMintCid)) { | |
| 1264 return false; | |
| 1265 } | |
| 1266 // Check input value's range. | |
| 1267 Range* value_range = value()->definition()->range(); | |
| 1268 if (value_range != NULL && | |
|
Vyacheslav Egorov (Google)
2015/05/27 16:17:35
no need for != NULL check. Fits does it for you (i
Florian Schneider
2015/05/28 08:11:09
Done.
| |
| 1269 RangeUtils::Fits(value_range, RangeBoundary::kRangeBoundaryInt64)) { | |
| 1270 return false; | |
| 1271 } | |
| 1272 return true; | |
| 1273 } | |
| 1274 | |
| 1275 | |
| 1260 bool BinaryInt32OpInstr::CanDeoptimize() const { | 1276 bool BinaryInt32OpInstr::CanDeoptimize() const { |
| 1261 switch (op_kind()) { | 1277 switch (op_kind()) { |
| 1262 case Token::kBIT_AND: | 1278 case Token::kBIT_AND: |
| 1263 case Token::kBIT_OR: | 1279 case Token::kBIT_OR: |
| 1264 case Token::kBIT_XOR: | 1280 case Token::kBIT_XOR: |
| 1265 return false; | 1281 return false; |
| 1266 | 1282 |
| 1267 case Token::kSHR: | 1283 case Token::kSHR: |
| 1268 return false; | 1284 return false; |
| 1269 | 1285 |
| (...skipping 2329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3599 case Token::kTRUNCDIV: return 0; | 3615 case Token::kTRUNCDIV: return 0; |
| 3600 case Token::kMOD: return 1; | 3616 case Token::kMOD: return 1; |
| 3601 default: UNIMPLEMENTED(); return -1; | 3617 default: UNIMPLEMENTED(); return -1; |
| 3602 } | 3618 } |
| 3603 } | 3619 } |
| 3604 | 3620 |
| 3605 | 3621 |
| 3606 #undef __ | 3622 #undef __ |
| 3607 | 3623 |
| 3608 } // namespace dart | 3624 } // namespace dart |
| OLD | NEW |