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

Unified Diff: runtime/vm/code_generator.cc

Issue 10345003: Temporary fix for GrowableArray type arguments: use the type arguments stores in GrowableArray inst… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/code_generator_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 7254)
+++ runtime/vm/code_generator.cc (working copy)
@@ -480,7 +480,10 @@
AbstractTypeArguments& instance_type_arguments =
AbstractTypeArguments::Handle();
const Class& instance_class = Class::Handle(instance.clazz());
+ AbstractTypeArguments& original_instance_type_arguments =
+ AbstractTypeArguments::Handle();
if (instance_class.HasTypeArguments()) {
+ original_instance_type_arguments = instance.GetTypeArguments();
OptimizeTypeArguments(instance);
instance_type_arguments = instance.GetTypeArguments();
}
@@ -500,6 +503,8 @@
// TODO(srdjan): Check instantiator type arguments as well.
Object& last_instance_class = Object::Handle();
Object& last_instance_type_arguments = Object::Handle();
+ // Check for duplicate entries (can happen if we optimized type arguments
+ // above).
for (intptr_t i = 0; i < cache.Length();
i += SubTypeTestCache::kNumEntries) {
last_instance_class = cache.At(i + SubTypeTestCache::kInstanceClass);
@@ -508,7 +513,9 @@
if ((last_instance_class.raw() == instance_class.raw()) &&
(last_instance_type_arguments.raw() ==
instance_type_arguments.raw())) {
- if (FLAG_trace_type_checks) {
+ if (FLAG_trace_type_checks &&
+ (original_instance_type_arguments.raw() ==
+ instance_type_arguments.raw())) {
PrintTypeCheck("WARNING duplicate cache entry", instance, type,
type_instantiator, result);
}
« no previous file with comments | « no previous file | runtime/vm/code_generator_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698