| 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/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 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 | 1166 |
| 1167 void Instruction::Goto(JoinEntryInstr* entry) { | 1167 void Instruction::Goto(JoinEntryInstr* entry) { |
| 1168 LinkTo(new GotoInstr(entry)); | 1168 LinkTo(new GotoInstr(entry)); |
| 1169 } | 1169 } |
| 1170 | 1170 |
| 1171 | 1171 |
| 1172 bool UnboxedIntConverterInstr::CanDeoptimize() const { | 1172 bool UnboxedIntConverterInstr::CanDeoptimize() const { |
| 1173 return (to() == kUnboxedInt32) && | 1173 return (to() == kUnboxedInt32) && |
| 1174 !Range::Fits(value()->definition()->range(), | 1174 !RangeUtils::Fits(value()->definition()->range(), |
| 1175 RangeBoundary::kRangeBoundaryInt32); | 1175 RangeBoundary::kRangeBoundaryInt32); |
| 1176 } | 1176 } |
| 1177 | 1177 |
| 1178 | 1178 |
| 1179 bool UnboxInt32Instr::CanDeoptimize() const { | 1179 bool UnboxInt32Instr::CanDeoptimize() const { |
| 1180 const intptr_t value_cid = value()->Type()->ToCid(); | 1180 const intptr_t value_cid = value()->Type()->ToCid(); |
| 1181 if (value_cid == kSmiCid) { | 1181 if (value_cid == kSmiCid) { |
| 1182 return false; | 1182 return false; |
| 1183 } else if (value_cid == kMintCid) { | 1183 } else if (value_cid == kMintCid) { |
| 1184 return !Range::Fits(value()->definition()->range(), | 1184 return !RangeUtils::Fits(value()->definition()->range(), |
| 1185 RangeBoundary::kRangeBoundaryInt32); | 1185 RangeBoundary::kRangeBoundaryInt32); |
| 1186 } else { | 1186 } else { |
| 1187 return true; | 1187 return true; |
| 1188 } | 1188 } |
| 1189 } | 1189 } |
| 1190 | 1190 |
| 1191 | 1191 |
| 1192 bool BinaryInt32OpInstr::CanDeoptimize() const { | 1192 bool BinaryInt32OpInstr::CanDeoptimize() const { |
| 1193 switch (op_kind()) { | 1193 switch (op_kind()) { |
| 1194 case Token::kBIT_AND: | 1194 case Token::kBIT_AND: |
| 1195 case Token::kBIT_OR: | 1195 case Token::kBIT_OR: |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1704 if ((defn != NULL) && (defn->value()->Type()->ToCid() == kDoubleCid)) { | 1704 if ((defn != NULL) && (defn->value()->Type()->ToCid() == kDoubleCid)) { |
| 1705 return defn->value()->definition(); | 1705 return defn->value()->definition(); |
| 1706 } | 1706 } |
| 1707 | 1707 |
| 1708 return this; | 1708 return this; |
| 1709 } | 1709 } |
| 1710 | 1710 |
| 1711 | 1711 |
| 1712 bool BoxIntNInstr::ValueFitsSmi() const { | 1712 bool BoxIntNInstr::ValueFitsSmi() const { |
| 1713 Range* range = value()->definition()->range(); | 1713 Range* range = value()->definition()->range(); |
| 1714 return Range::Fits(range, RangeBoundary::kRangeBoundarySmi); | 1714 return RangeUtils::Fits(range, RangeBoundary::kRangeBoundarySmi); |
| 1715 } | 1715 } |
| 1716 | 1716 |
| 1717 | 1717 |
| 1718 Definition* BoxIntNInstr::Canonicalize(FlowGraph* flow_graph) { | 1718 Definition* BoxIntNInstr::Canonicalize(FlowGraph* flow_graph) { |
| 1719 if ((input_use_list() == NULL) && !HasTryBlockUse(env_use_list())) { | 1719 if ((input_use_list() == NULL) && !HasTryBlockUse(env_use_list())) { |
| 1720 // Environments can accomodate any representation. No need to box. | 1720 // Environments can accomodate any representation. No need to box. |
| 1721 return value()->definition(); | 1721 return value()->definition(); |
| 1722 } | 1722 } |
| 1723 | 1723 |
| 1724 return this; | 1724 return this; |
| (...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3088 case Token::kTRUNCDIV: return 0; | 3088 case Token::kTRUNCDIV: return 0; |
| 3089 case Token::kMOD: return 1; | 3089 case Token::kMOD: return 1; |
| 3090 default: UNIMPLEMENTED(); return -1; | 3090 default: UNIMPLEMENTED(); return -1; |
| 3091 } | 3091 } |
| 3092 } | 3092 } |
| 3093 | 3093 |
| 3094 | 3094 |
| 3095 #undef __ | 3095 #undef __ |
| 3096 | 3096 |
| 3097 } // namespace dart | 3097 } // namespace dart |
| OLD | NEW |