Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 7643cdbfc5ffc2cd79a4b1b9842a94c0f83fca24..612202cdbdfad71f7edd9764589c700f6d161847 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -2022,7 +2022,7 @@ void Class::set_type_parameters(const TypeArguments& value) const { |
intptr_t Class::NumTypeParameters(Isolate* isolate) const { |
- if (IsMixinApplication() && !is_mixin_type_applied()) { |
+ if (IsAnonymousMixinApplication() && !is_mixin_type_applied()) { |
ClassFinalizer::ApplyMixinType(*this); |
} |
if (type_parameters() == TypeArguments::null()) { |
@@ -2049,7 +2049,7 @@ intptr_t Class::NumOwnTypeArguments() const { |
set_num_own_type_arguments(num_type_params); |
return num_type_params; |
} |
- ASSERT(!IsMixinApplication() || is_mixin_type_applied()); |
+ ASSERT(!IsAnonymousMixinApplication() || is_mixin_type_applied()); |
const AbstractType& sup_type = AbstractType::Handle(isolate, super_type()); |
const TypeArguments& sup_type_args = |
TypeArguments::Handle(isolate, sup_type.arguments()); |
@@ -3186,13 +3186,15 @@ void Class::set_mixin(const Type& value) const { |
bool Class::IsMixinApplication() const { |
- return mixin() != Type::null(); |
+ return mixin() != Type::null() || is_mixin_app_alias(); |
rmacnak
2014/03/27 01:01:30
I think the old condition became invalid during th
|
} |
+ |
bool Class::IsAnonymousMixinApplication() const { |
return IsMixinApplication() && !is_mixin_app_alias(); |
} |
+ |
void Class::set_patch_class(const Class& cls) const { |
ASSERT(patch_class() == Class::null()); |
StorePointer(&raw_ptr()->patch_class_, cls.raw()); |
@@ -5081,6 +5083,28 @@ void Function::SetRedirectionTarget(const Function& target) const { |
} |
+bool Function::IsForwardingConstructor() const { |
+ if (!IsImplicitConstructor()) return false; |
+ const Class& owner = Class::Handle(Owner()); |
+ return owner.IsMixinApplication(); |
+} |
+ |
+ |
+RawFunction* Function::ForwardingTarget() const { |
+ ASSERT(IsForwardingConstructor()); |
+ Object& obj = Object::Handle(raw_ptr()->data_); |
+ ASSERT(!obj.IsNull()); |
+ return Function::Cast(obj).raw(); |
+} |
+ |
+ |
+void Function::SetForwardingTarget(const Function& target) const { |
+ ASSERT(IsForwardingConstructor()); |
+ ASSERT(Object::Handle(raw_ptr()->data_).IsNull()); |
+ set_data(target); |
+} |
+ |
+ |
void Function::set_data(const Object& value) const { |
StorePointer(&raw_ptr()->data_, value.raw()); |
} |