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

Unified Diff: runtime/vm/object.cc

Issue 212883009: Handle creating ParameterMirrors for the parameters of forwarding constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
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());
}
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698