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

Unified Diff: runtime/vm/object.cc

Issue 12779008: Mixins with Generics (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698