| 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 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 return TwoByteString::data_offset(); | 1091 return TwoByteString::data_offset(); |
| 1092 default: | 1092 default: |
| 1093 UNIMPLEMENTED(); | 1093 UNIMPLEMENTED(); |
| 1094 return Array::data_offset(); | 1094 return Array::data_offset(); |
| 1095 } | 1095 } |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 | 1098 |
| 1099 // Returns true if checking against this type is a direct class id comparison. | 1099 // Returns true if checking against this type is a direct class id comparison. |
| 1100 bool FlowGraphCompiler::TypeCheckAsClassEquality(const AbstractType& type) { | 1100 bool FlowGraphCompiler::TypeCheckAsClassEquality(const AbstractType& type) { |
| 1101 ASSERT(type.IsFinalized() && !type.IsMalformed()); | 1101 ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded()); |
| 1102 // Requires CHA, which can be applied in optimized code only, | 1102 // Requires CHA, which can be applied in optimized code only, |
| 1103 if (!FLAG_use_cha || !is_optimizing()) return false; | 1103 if (!FLAG_use_cha || !is_optimizing()) return false; |
| 1104 if (!type.IsInstantiated()) return false; | 1104 if (!type.IsInstantiated()) return false; |
| 1105 const Class& type_class = Class::Handle(type.type_class()); | 1105 const Class& type_class = Class::Handle(type.type_class()); |
| 1106 // Signature classes have different type checking rules. | 1106 // Signature classes have different type checking rules. |
| 1107 if (type_class.IsSignatureClass()) return false; | 1107 if (type_class.IsSignatureClass()) return false; |
| 1108 // Could be an interface check? | 1108 // Could be an interface check? |
| 1109 if (type_class.is_implemented()) return false; | 1109 if (type_class.is_implemented()) return false; |
| 1110 const intptr_t type_cid = type_class.id(); | 1110 const intptr_t type_cid = type_class.id(); |
| 1111 if (CHA::HasSubclasses(type_cid)) return false; | 1111 if (CHA::HasSubclasses(type_cid)) return false; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1138 | 1138 |
| 1139 for (int i = 0; i < len; i++) { | 1139 for (int i = 0; i < len; i++) { |
| 1140 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), | 1140 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), |
| 1141 &Function::ZoneHandle(ic_data.GetTargetAt(i)), | 1141 &Function::ZoneHandle(ic_data.GetTargetAt(i)), |
| 1142 ic_data.GetCountAt(i))); | 1142 ic_data.GetCountAt(i))); |
| 1143 } | 1143 } |
| 1144 sorted->Sort(HighestCountFirst); | 1144 sorted->Sort(HighestCountFirst); |
| 1145 } | 1145 } |
| 1146 | 1146 |
| 1147 } // namespace dart | 1147 } // namespace dart |
| OLD | NEW |