| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 27361)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -11593,13 +11593,33 @@
|
| }
|
|
|
|
|
| +intptr_t MixinAppType::token_pos() const {
|
| + return Class::Handle(MixinAppAt(0)).token_pos();
|
| +}
|
| +
|
| +
|
| +intptr_t MixinAppType::Depth() const {
|
| + const Array& mixin_apps = Array::Handle(mixins());
|
| + return mixin_apps.Length();
|
| +}
|
| +
|
| +
|
| RawString* MixinAppType::Name() const {
|
| - return String::New("MixinApplication");
|
| + return String::New("MixinAppType");
|
| }
|
|
|
|
|
| const char* MixinAppType::ToCString() const {
|
| - return "MixinAppType";
|
| + const char* format = "MixinAppType: super type: %s; first mixin app: %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();
|
| + intptr_t len = OS::SNPrint(
|
| + NULL, 0, format, super_type_cstr, first_mixin_app_cstr) + 1;
|
| + char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
|
| + OS::SNPrint(chars, len, format, super_type_cstr, first_mixin_app_cstr);
|
| + return chars;
|
| }
|
|
|
|
|
| @@ -11608,16 +11628,23 @@
|
| }
|
|
|
|
|
| -void MixinAppType::set_super_type(const AbstractType& value) const {
|
| - StorePointer(&raw_ptr()->super_type_, value.raw());
|
| +RawAbstractType* MixinAppType::SuperType() const {
|
| + return Class::Handle(MixinAppAt(0)).super_type();
|
| }
|
|
|
|
|
| -void MixinAppType::set_mixin_types(const Array& value) const {
|
| - StorePointer(&raw_ptr()->mixin_types_, value.raw());
|
| +RawClass* MixinAppType::MixinAppAt(intptr_t depth) const {
|
| + Class& mixin_app = Class::Handle();
|
| + mixin_app ^= Array::Handle(mixins()).At(depth);
|
| + return mixin_app.raw();
|
| }
|
|
|
|
|
| +void MixinAppType::set_mixins(const Array& value) const {
|
| + StorePointer(&raw_ptr()->mixins_, value.raw());
|
| +}
|
| +
|
| +
|
| RawMixinAppType* MixinAppType::New() {
|
| ASSERT(Isolate::Current()->object_store()->mixin_app_type_class() !=
|
| Class::null());
|
| @@ -11630,11 +11657,9 @@
|
| }
|
|
|
|
|
| -RawMixinAppType* MixinAppType::New(const AbstractType& super_type,
|
| - const Array& mixin_types) {
|
| +RawMixinAppType* MixinAppType::New(const Array& mixins) {
|
| const MixinAppType& result = MixinAppType::Handle(MixinAppType::New());
|
| - result.set_super_type(super_type);
|
| - result.set_mixin_types(mixin_types);
|
| + result.set_mixins(mixins);
|
| return result.raw();
|
| }
|
|
|
|
|