| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 if (right != NULL) { | 1123 if (right != NULL) { |
| 1124 right->RemoveFromGraph(); | 1124 right->RemoveFromGraph(); |
| 1125 } | 1125 } |
| 1126 // Return left subexpression as the replacement for this instruction. | 1126 // Return left subexpression as the replacement for this instruction. |
| 1127 return left; | 1127 return left; |
| 1128 } | 1128 } |
| 1129 return instr; | 1129 return instr; |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 | 1132 |
| 1133 Definition* CheckClassComp::TryReplace(BindInstr* instr) const { |
| 1134 const intptr_t v_cid = value()->ResultCid(); |
| 1135 const intptr_t num_checks = ic_data()->NumberOfChecks(); |
| 1136 if ((num_checks == 1) && |
| 1137 (v_cid == ic_data()->GetReceiverClassIdAt(0))) { |
| 1138 // No checks needed. |
| 1139 return NULL; |
| 1140 } |
| 1141 return instr; |
| 1142 } |
| 1143 |
| 1144 |
| 1133 Definition* CheckSmiComp::TryReplace(BindInstr* instr) const { | 1145 Definition* CheckSmiComp::TryReplace(BindInstr* instr) const { |
| 1134 return (value()->ResultCid() == kSmiCid) ? NULL : instr; | 1146 return (value()->ResultCid() == kSmiCid) ? NULL : instr; |
| 1135 } | 1147 } |
| 1136 | 1148 |
| 1137 | 1149 |
| 1138 Definition* CheckEitherNonSmiComp::TryReplace(BindInstr* instr) const { | 1150 Definition* CheckEitherNonSmiComp::TryReplace(BindInstr* instr) const { |
| 1139 if ((left()->ResultCid() == kDoubleCid) || | 1151 if ((left()->ResultCid() == kDoubleCid) || |
| 1140 (right()->ResultCid() == kDoubleCid)) { | 1152 (right()->ResultCid() == kDoubleCid)) { |
| 1141 return NULL; // Remove from the graph. | 1153 return NULL; // Remove from the graph. |
| 1142 } | 1154 } |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1539 ? UseDefinition(values()[i]->AsUse()->definition()) | 1551 ? UseDefinition(values()[i]->AsUse()->definition()) |
| 1540 : val); | 1552 : val); |
| 1541 } | 1553 } |
| 1542 return copy; | 1554 return copy; |
| 1543 } | 1555 } |
| 1544 | 1556 |
| 1545 | 1557 |
| 1546 #undef __ | 1558 #undef __ |
| 1547 | 1559 |
| 1548 } // namespace dart | 1560 } // namespace dart |
| OLD | NEW |