Index: runtime/vm/object.cc |
=================================================================== |
--- runtime/vm/object.cc (revision 20082) |
+++ runtime/vm/object.cc (working copy) |
@@ -705,6 +705,9 @@ |
cls = Class::New<BoundedType>(); |
object_store->set_bounded_type_class(cls); |
+ cls = Class::New<MixinAppType>(); |
+ object_store->set_mixin_app_type_class(cls); |
+ |
// Pre-allocate the OneByteString class needed by the symbol table. |
cls = Class::NewStringClass(kOneByteStringCid); |
object_store->set_one_byte_string_class(cls); |
@@ -1050,6 +1053,9 @@ |
cls = Class::New<BoundedType>(); |
object_store->set_bounded_type_class(cls); |
+ cls = Class::New<MixinAppType>(); |
+ object_store->set_mixin_app_type_class(cls); |
+ |
cls = Class::New<Array>(); |
object_store->set_array_class(cls); |
@@ -1593,7 +1599,10 @@ |
void Class::set_super_type(const AbstractType& value) const { |
- ASSERT(value.IsNull() || value.IsType() || value.IsBoundedType()); |
+ ASSERT(value.IsNull() || |
+ value.IsType() || |
+ value.IsBoundedType() || |
+ value.IsMixinAppType()); |
StorePointer(&raw_ptr()->super_type_, value.raw()); |
} |
@@ -9878,6 +9887,48 @@ |
} |
+ |
+RawString* MixinAppType::Name() const { |
+ return String::New("MixinApplication"); |
+} |
+ |
+ |
+const char* MixinAppType::ToCString() const { |
+ return "MixinAppType"; |
+} |
+ |
+ |
+void MixinAppType::set_super_type(const AbstractType& value) const { |
+ StorePointer(&raw_ptr()->super_type_, value.raw()); |
+} |
+ |
+ |
+void MixinAppType::set_mixin_types(const Array& value) const { |
+ StorePointer(&raw_ptr()->mixin_types_, value.raw()); |
+} |
+ |
+ |
+RawMixinAppType* MixinAppType::New() { |
+ ASSERT(Isolate::Current()->object_store()->mixin_app_type_class() != |
+ Class::null()); |
+ // MixinAppType objects do not survive finalization, so allocate |
+ // on new heap. |
+ RawObject* raw = Object::Allocate(MixinAppType::kClassId, |
+ MixinAppType::InstanceSize(), |
+ Heap::kNew); |
+ return reinterpret_cast<RawMixinAppType*>(raw); |
+} |
+ |
+ |
+RawMixinAppType* MixinAppType::New(const AbstractType& super_type, |
+ const Array& mixin_types) { |
+ const MixinAppType& result = MixinAppType::Handle(MixinAppType::New()); |
+ result.set_super_type(super_type); |
+ result.set_mixin_types(mixin_types); |
+ return result.raw(); |
+} |
+ |
+ |
const char* Number::ToCString() const { |
// Number is an interface. No instances of Number should exist. |
UNREACHABLE(); |