| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 | 44 |
| 45 bool Value::Equals(Value* other) const { | 45 bool Value::Equals(Value* other) const { |
| 46 return definition() == other->definition(); | 46 return definition() == other->definition(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 bool CheckClassComp::AttributesEqual(Computation* other) const { | 50 bool CheckClassComp::AttributesEqual(Computation* other) const { |
| 51 CheckClassComp* other_check = other->AsCheckClass(); | 51 CheckClassComp* other_check = other->AsCheckClass(); |
| 52 if (other_check == NULL) return false; | 52 if (other_check == NULL) return false; |
| 53 if (ic_data()->NumberOfChecks() != other->ic_data()->NumberOfChecks()) { | 53 if (unary_checks().NumberOfChecks() != |
| 54 other_check->unary_checks().NumberOfChecks()) { |
| 54 return false; | 55 return false; |
| 55 } | 56 } |
| 56 for (intptr_t i = 0; i < ic_data()->NumberOfChecks(); ++i) { | 57 for (intptr_t i = 0; i < unary_checks().NumberOfChecks(); ++i) { |
| 57 // TODO(fschneider): Make sure ic_data are sorted to hit more cases. | 58 // TODO(fschneider): Make sure ic_data are sorted to hit more cases. |
| 58 if (ic_data()->GetReceiverClassIdAt(i) != | 59 if (unary_checks().GetReceiverClassIdAt(i) != |
| 59 other->ic_data()->GetReceiverClassIdAt(i)) { | 60 other_check->unary_checks().GetReceiverClassIdAt(i)) { |
| 60 return false; | 61 return false; |
| 61 } | 62 } |
| 62 } | 63 } |
| 63 return true; | 64 return true; |
| 64 } | 65 } |
| 65 | 66 |
| 66 | 67 |
| 67 bool CheckArrayBoundComp::AttributesEqual(Computation* other) const { | 68 bool CheckArrayBoundComp::AttributesEqual(Computation* other) const { |
| 68 CheckArrayBoundComp* other_check = other->AsCheckArrayBound(); | 69 CheckArrayBoundComp* other_check = other->AsCheckArrayBound(); |
| 69 if (other_check == NULL) return false; | 70 if (other_check == NULL) return false; |
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 } | 1102 } |
| 1102 // Return left subexpression as the replacement for this instruction. | 1103 // Return left subexpression as the replacement for this instruction. |
| 1103 return left_defn; | 1104 return left_defn; |
| 1104 } | 1105 } |
| 1105 return instr; | 1106 return instr; |
| 1106 } | 1107 } |
| 1107 | 1108 |
| 1108 | 1109 |
| 1109 Definition* CheckClassComp::TryReplace(BindInstr* instr) const { | 1110 Definition* CheckClassComp::TryReplace(BindInstr* instr) const { |
| 1110 const intptr_t v_cid = value()->ResultCid(); | 1111 const intptr_t v_cid = value()->ResultCid(); |
| 1111 const intptr_t num_checks = ic_data()->NumberOfChecks(); | 1112 const intptr_t num_checks = unary_checks().NumberOfChecks(); |
| 1112 if ((num_checks == 1) && | 1113 if ((num_checks == 1) && |
| 1113 (v_cid == ic_data()->GetReceiverClassIdAt(0))) { | 1114 (v_cid == unary_checks().GetReceiverClassIdAt(0))) { |
| 1114 // No checks needed. | 1115 // No checks needed. |
| 1115 return NULL; | 1116 return NULL; |
| 1116 } | 1117 } |
| 1117 return instr; | 1118 return instr; |
| 1118 } | 1119 } |
| 1119 | 1120 |
| 1120 | 1121 |
| 1121 Definition* CheckSmiComp::TryReplace(BindInstr* instr) const { | 1122 Definition* CheckSmiComp::TryReplace(BindInstr* instr) const { |
| 1122 return (value()->ResultCid() == kSmiCid) ? NULL : instr; | 1123 return (value()->ResultCid() == kSmiCid) ? NULL : instr; |
| 1123 } | 1124 } |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 value->set_use_index(i); | 1524 value->set_use_index(i); |
| 1524 value->AddToEnvUseList(); | 1525 value->AddToEnvUseList(); |
| 1525 } | 1526 } |
| 1526 instr->set_env(copy); | 1527 instr->set_env(copy); |
| 1527 } | 1528 } |
| 1528 | 1529 |
| 1529 | 1530 |
| 1530 #undef __ | 1531 #undef __ |
| 1531 | 1532 |
| 1532 } // namespace dart | 1533 } // namespace dart |
| OLD | NEW |