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

Unified Diff: runtime/vm/object.cc

Issue 42723003: Register synthesized mixin application classes in the library and reuse them (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
===================================================================
--- runtime/vm/object.cc (revision 29229)
+++ runtime/vm/object.cc (working copy)
@@ -2610,7 +2610,6 @@
void Class::set_mixin(const Type& value) const {
- // Resolution and application of mixin type occurs in finalizer.
ASSERT(!value.IsNull());
StorePointer(&raw_ptr()->mixin_, value.raw());
}
@@ -12239,13 +12238,12 @@
intptr_t MixinAppType::token_pos() const {
- return Class::Handle(MixinAppAt(0)).token_pos();
+ return AbstractType::Handle(MixinTypeAt(0)).token_pos();
hausner 2013/10/25 17:11:49 Should this be the position of the super type inst
regis 2013/10/25 18:34:25 I think the position of the first mixin type is be
}
intptr_t MixinAppType::Depth() const {
- const Array& mixin_apps = Array::Handle(mixins());
- return mixin_apps.Length();
+ return Array::Handle(mixin_types()).Length();
}
@@ -12255,15 +12253,15 @@
const char* MixinAppType::ToCString() const {
- const char* format = "MixinAppType: super type: %s; first mixin app: %s";
+ const char* format = "MixinAppType: super type: %s; first mixin type: %s";
const char* super_type_cstr = String::Handle(AbstractType::Handle(
- SuperType()).Name()).ToCString();
- const char* first_mixin_app_cstr = String::Handle(Class::Handle(
- MixinAppAt(0)).Name()).ToCString();
+ super_type()).Name()).ToCString();
+ const char* first_mixin_type_cstr = String::Handle(AbstractType::Handle(
+ MixinTypeAt(0)).Name()).ToCString();
intptr_t len = OS::SNPrint(
- NULL, 0, format, super_type_cstr, first_mixin_app_cstr) + 1;
+ NULL, 0, format, super_type_cstr, first_mixin_type_cstr) + 1;
char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
- OS::SNPrint(chars, len, format, super_type_cstr, first_mixin_app_cstr);
+ OS::SNPrint(chars, len, format, super_type_cstr, first_mixin_type_cstr);
return chars;
}
@@ -12273,18 +12271,18 @@
}
-RawAbstractType* MixinAppType::SuperType() const {
- return Class::Handle(MixinAppAt(0)).super_type();
+RawAbstractType* MixinAppType::MixinTypeAt(intptr_t depth) const {
+ return AbstractType::RawCast(Array::Handle(mixin_types()).At(depth));
}
-RawClass* MixinAppType::MixinAppAt(intptr_t depth) const {
- return Class::RawCast(Array::Handle(mixins()).At(depth));
+void MixinAppType::set_super_type(const AbstractType& value) const {
+ StorePointer(&raw_ptr()->super_type_, value.raw());
}
-void MixinAppType::set_mixins(const Array& value) const {
- StorePointer(&raw_ptr()->mixins_, value.raw());
+void MixinAppType::set_mixin_types(const Array& value) const {
+ StorePointer(&raw_ptr()->mixin_types_, value.raw());
}
@@ -12300,9 +12298,11 @@
}
-RawMixinAppType* MixinAppType::New(const Array& mixins) {
+RawMixinAppType* MixinAppType::New(const AbstractType& super_type,
+ const Array& mixin_types) {
const MixinAppType& result = MixinAppType::Handle(MixinAppType::New());
- result.set_mixins(mixins);
+ result.set_super_type(super_type);
+ result.set_mixin_types(mixin_types);
return result.raw();
}
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698