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

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

Issue 23190035: Distinguish between malformed and malbounded types (fix issues 12552 and 12554). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 months 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 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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