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

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

Issue 154393003: Implement eager instantiation and canonicalization of type arguments at run (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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
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 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 // Could be an interface check? 1247 // Could be an interface check?
1248 if (type_class.is_implemented()) return false; 1248 if (type_class.is_implemented()) return false;
1249 const intptr_t type_cid = type_class.id(); 1249 const intptr_t type_cid = type_class.id();
1250 if (CHA::HasSubclasses(type_cid)) return false; 1250 if (CHA::HasSubclasses(type_cid)) return false;
1251 const intptr_t num_type_args = type_class.NumTypeArguments(); 1251 const intptr_t num_type_args = type_class.NumTypeArguments();
1252 if (num_type_args > 0) { 1252 if (num_type_args > 0) {
1253 // Only raw types can be directly compared, thus disregarding type 1253 // Only raw types can be directly compared, thus disregarding type
1254 // arguments. 1254 // arguments.
1255 const intptr_t num_type_params = type_class.NumTypeParameters(); 1255 const intptr_t num_type_params = type_class.NumTypeParameters();
1256 const intptr_t from_index = num_type_args - num_type_params; 1256 const intptr_t from_index = num_type_args - num_type_params;
1257 const AbstractTypeArguments& type_arguments = 1257 const TypeArguments& type_arguments =
1258 AbstractTypeArguments::Handle(type.arguments()); 1258 TypeArguments::Handle(type.arguments());
1259 const bool is_raw_type = type_arguments.IsNull() || 1259 const bool is_raw_type = type_arguments.IsNull() ||
1260 type_arguments.IsRaw(from_index, num_type_params); 1260 type_arguments.IsRaw(from_index, num_type_params);
1261 return is_raw_type; 1261 return is_raw_type;
1262 } 1262 }
1263 return true; 1263 return true;
1264 } 1264 }
1265 1265
1266 1266
1267 static int HighestCountFirst(const CidTarget* a, const CidTarget* b) { 1267 static int HighestCountFirst(const CidTarget* a, const CidTarget* b) {
1268 // Negative if 'a' should sort before 'b'. 1268 // Negative if 'a' should sort before 'b'.
(...skipping 11 matching lines...) Expand all
1280 1280
1281 for (int i = 0; i < len; i++) { 1281 for (int i = 0; i < len; i++) {
1282 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), 1282 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i),
1283 &Function::ZoneHandle(ic_data.GetTargetAt(i)), 1283 &Function::ZoneHandle(ic_data.GetTargetAt(i)),
1284 ic_data.GetCountAt(i))); 1284 ic_data.GetCountAt(i)));
1285 } 1285 }
1286 sorted->Sort(HighestCountFirst); 1286 sorted->Sort(HighestCountFirst);
1287 } 1287 }
1288 1288
1289 } // namespace dart 1289 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698