Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: runtime/vm/flow_graph_compiler.cc

Issue 75713002: Distinguish between malformed and malbounded types more efficiently using the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 return TwoByteString::data_offset(); 1170 return TwoByteString::data_offset();
1171 default: 1171 default:
1172 UNIMPLEMENTED(); 1172 UNIMPLEMENTED();
1173 return Array::data_offset(); 1173 return Array::data_offset();
1174 } 1174 }
1175 } 1175 }
1176 1176
1177 1177
1178 // Returns true if checking against this type is a direct class id comparison. 1178 // Returns true if checking against this type is a direct class id comparison.
1179 bool FlowGraphCompiler::TypeCheckAsClassEquality(const AbstractType& type) { 1179 bool FlowGraphCompiler::TypeCheckAsClassEquality(const AbstractType& type) {
1180 ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded()); 1180 ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded());
1181 // Requires CHA, which can be applied in optimized code only, 1181 // Requires CHA, which can be applied in optimized code only,
1182 if (!FLAG_use_cha || !is_optimizing()) return false; 1182 if (!FLAG_use_cha || !is_optimizing()) return false;
1183 if (!type.IsInstantiated()) return false; 1183 if (!type.IsInstantiated()) return false;
1184 const Class& type_class = Class::Handle(type.type_class()); 1184 const Class& type_class = Class::Handle(type.type_class());
1185 // Signature classes have different type checking rules. 1185 // Signature classes have different type checking rules.
1186 if (type_class.IsSignatureClass()) return false; 1186 if (type_class.IsSignatureClass()) return false;
1187 // Could be an interface check? 1187 // Could be an interface check?
1188 if (type_class.is_implemented()) return false; 1188 if (type_class.is_implemented()) return false;
1189 const intptr_t type_cid = type_class.id(); 1189 const intptr_t type_cid = type_class.id();
1190 if (CHA::HasSubclasses(type_cid)) return false; 1190 if (CHA::HasSubclasses(type_cid)) return false;
(...skipping 26 matching lines...) Expand all
1217 1217
1218 for (int i = 0; i < len; i++) { 1218 for (int i = 0; i < len; i++) {
1219 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), 1219 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i),
1220 &Function::ZoneHandle(ic_data.GetTargetAt(i)), 1220 &Function::ZoneHandle(ic_data.GetTargetAt(i)),
1221 ic_data.GetCountAt(i))); 1221 ic_data.GetCountAt(i)));
1222 } 1222 }
1223 sorted->Sort(HighestCountFirst); 1223 sorted->Sort(HighestCountFirst);
1224 } 1224 }
1225 1225
1226 } // namespace dart 1226 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698