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

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

Issue 11640025: Fix test failure issue 7471: Signature classes have different type checking rules, i.e., they have … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 | « no previous file | no next file » | 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) 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/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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 } 1013 }
1014 1014
1015 1015
1016 // Returns true if checking against this type is a direct class id comparison. 1016 // Returns true if checking against this type is a direct class id comparison.
1017 bool FlowGraphCompiler::TypeCheckAsClassEquality(const AbstractType& type) { 1017 bool FlowGraphCompiler::TypeCheckAsClassEquality(const AbstractType& type) {
1018 ASSERT(type.IsFinalized() && !type.IsMalformed()); 1018 ASSERT(type.IsFinalized() && !type.IsMalformed());
1019 // Requires CHA, which can be applied in optimized code only, 1019 // Requires CHA, which can be applied in optimized code only,
1020 if (!FLAG_use_cha || !is_optimizing()) return false; 1020 if (!FLAG_use_cha || !is_optimizing()) return false;
1021 if (!type.IsInstantiated()) return false; 1021 if (!type.IsInstantiated()) return false;
1022 const Class& type_class = Class::Handle(type.type_class()); 1022 const Class& type_class = Class::Handle(type.type_class());
1023 // Signature classes have different type checking rules.
1024 if (type_class.IsSignatureClass()) return false;
1023 // Could be an interface check? 1025 // Could be an interface check?
1024 if (type_class.is_implemented()) return false; 1026 if (type_class.is_implemented()) return false;
1025 const intptr_t type_cid = type_class.id(); 1027 const intptr_t type_cid = type_class.id();
1026 if (CHA::HasSubclasses(type_cid)) return false; 1028 if (CHA::HasSubclasses(type_cid)) return false;
1027 if (type_class.HasTypeArguments()) { 1029 if (type_class.HasTypeArguments()) {
1028 // Only raw types can be directly compared, thus disregarding type 1030 // Only raw types can be directly compared, thus disregarding type
1029 // arguments. 1031 // arguments.
1030 const AbstractTypeArguments& type_arguments = 1032 const AbstractTypeArguments& type_arguments =
1031 AbstractTypeArguments::Handle(type.arguments()); 1033 AbstractTypeArguments::Handle(type.arguments());
1032 const bool is_raw_type = type_arguments.IsNull() || 1034 const bool is_raw_type = type_arguments.IsNull() ||
1033 type_arguments.IsRaw(type_arguments.Length()); 1035 type_arguments.IsRaw(type_arguments.Length());
1034 return is_raw_type; 1036 return is_raw_type;
1035 } 1037 }
1036 return true; 1038 return true;
1037 } 1039 }
1038 1040
1039 } // namespace dart 1041 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698