| 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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
| 6 | 6 |
| 7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
| 8 | 8 |
| 9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 // Requires CHA, which can be applied in optimized code only, | 1098 // Requires CHA, which can be applied in optimized code only, |
| 1099 if (!FLAG_use_cha || !is_optimizing()) return false; | 1099 if (!FLAG_use_cha || !is_optimizing()) return false; |
| 1100 if (!type.IsInstantiated()) return false; | 1100 if (!type.IsInstantiated()) return false; |
| 1101 const Class& type_class = Class::Handle(type.type_class()); | 1101 const Class& type_class = Class::Handle(type.type_class()); |
| 1102 // Signature classes have different type checking rules. | 1102 // Signature classes have different type checking rules. |
| 1103 if (type_class.IsSignatureClass()) return false; | 1103 if (type_class.IsSignatureClass()) return false; |
| 1104 // Could be an interface check? | 1104 // Could be an interface check? |
| 1105 if (type_class.is_implemented()) return false; | 1105 if (type_class.is_implemented()) return false; |
| 1106 const intptr_t type_cid = type_class.id(); | 1106 const intptr_t type_cid = type_class.id(); |
| 1107 if (CHA::HasSubclasses(type_cid)) return false; | 1107 if (CHA::HasSubclasses(type_cid)) return false; |
| 1108 if (type_class.HasTypeArguments()) { | 1108 if (type_class.NumTypeArguments() > 0) { |
| 1109 // Only raw types can be directly compared, thus disregarding type | 1109 // Only raw types can be directly compared, thus disregarding type |
| 1110 // arguments. | 1110 // arguments. |
| 1111 const AbstractTypeArguments& type_arguments = | 1111 const AbstractTypeArguments& type_arguments = |
| 1112 AbstractTypeArguments::Handle(type.arguments()); | 1112 AbstractTypeArguments::Handle(type.arguments()); |
| 1113 const bool is_raw_type = type_arguments.IsNull() || | 1113 const bool is_raw_type = type_arguments.IsNull() || |
| 1114 type_arguments.IsRaw(type_arguments.Length()); | 1114 type_arguments.IsRaw(type_arguments.Length()); |
| 1115 return is_raw_type; | 1115 return is_raw_type; |
| 1116 } | 1116 } |
| 1117 return true; | 1117 return true; |
| 1118 } | 1118 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1134 | 1134 |
| 1135 for (int i = 0; i < len; i++) { | 1135 for (int i = 0; i < len; i++) { |
| 1136 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), | 1136 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), |
| 1137 &Function::ZoneHandle(ic_data.GetTargetAt(i)), | 1137 &Function::ZoneHandle(ic_data.GetTargetAt(i)), |
| 1138 ic_data.GetCountAt(i))); | 1138 ic_data.GetCountAt(i))); |
| 1139 } | 1139 } |
| 1140 sorted->Sort(HighestCountFirst); | 1140 sorted->Sort(HighestCountFirst); |
| 1141 } | 1141 } |
| 1142 | 1142 |
| 1143 } // namespace dart | 1143 } // namespace dart |
| OLD | NEW |