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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 138273005: Share mixin type with interface type in mixin application classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 31796)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -1408,12 +1408,7 @@
// Add the mixin type to the interfaces that the mixin application
// class implements. This is necessary so that type tests work.
const Array& interfaces = Array::Handle(isolate, Array::New(1));
- const Type& interface = Type::Handle(isolate, Type::New(
- mixin_class,
- Object::null_abstract_type_arguments(), // Set again below if generic.
- mixin_app_class.token_pos()));
- ASSERT(!interface.IsFinalized());
- interfaces.SetAt(0, interface);
+ interfaces.SetAt(0, mixin_type);
ASSERT(mixin_app_class.interfaces() == Object::empty_array().raw());
mixin_app_class.set_interfaces(interfaces);
@@ -1473,9 +1468,6 @@
TypeArguments::Handle(isolate, mixin_class.type_parameters());
const TypeArguments& mixin_type_args = TypeArguments::Handle(isolate,
TypeArguments::New(num_mixin_type_params));
- // TODO(regis): Can we share interface type and mixin_type?
- const TypeArguments& interface_type_args = TypeArguments::Handle(isolate,
- TypeArguments::New(num_mixin_type_params));
for (intptr_t i = 0; i < num_mixin_type_params; i++) {
param ^= mixin_params.TypeAt(i);
param_name = param.name();
@@ -1489,7 +1481,6 @@
param_bound,
param.token_pos());
cloned_type_params.SetTypeAt(cloned_index, cloned_param);
- interface_type_args.SetTypeAt(i, cloned_param);
mixin_type_args.SetTypeAt(i, cloned_param);
cloned_index++;
}
@@ -1522,12 +1513,10 @@
}
}
- // Lastly, set the type arguments of the mixin type and of the single
- // interface type.
+ // Lastly, set the type arguments of the mixin type, which is also the
+ // single interface type.
ASSERT(!mixin_type.IsFinalized());
mixin_type.set_arguments(mixin_type_args);
- ASSERT(!interface.IsFinalized());
- interface.set_arguments(interface_type_args);
}
mixin_app_class.set_type_parameters(cloned_type_params);
}
« 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