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

Unified Diff: runtime/vm/object.cc

Issue 8585004: Support correct factory syntax in the VM as decribed in the spec. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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_test.cc » ('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 1593)
+++ runtime/vm/object.cc (working copy)
@@ -878,20 +878,40 @@
}
+bool Class::HasFactoryClass() const {
+ const Object& factory_class = Object::Handle(raw_ptr()->factory_class_);
+ return !factory_class.IsNull();
+}
+
+
+bool Class::HasResolvedFactoryClass() const {
+ ASSERT(HasFactoryClass());
+ const Object& factory_class = Object::Handle(raw_ptr()->factory_class_);
+ return factory_class.IsClass();
+}
+
+
RawClass* Class::FactoryClass() const {
- const Type& fact_type = Type::Handle(factory_type());
- if (fact_type.IsNull()) {
- return Class::null();
- }
- return fact_type.type_class();
+ ASSERT(HasResolvedFactoryClass());
+ Class& type_class = Class::Handle();
+ type_class ^= raw_ptr()->factory_class_;
+ return type_class.raw();
}
-void Class::set_factory_type(const Type& value) const {
- StorePointer(&raw_ptr()->factory_type_, value.raw());
+RawUnresolvedClass* Class::UnresolvedFactoryClass() const {
+ ASSERT(!HasResolvedFactoryClass());
+ UnresolvedClass& unresolved_factory_class = UnresolvedClass::Handle();
+ unresolved_factory_class ^= raw_ptr()->factory_class_;
+ return unresolved_factory_class.raw();
}
+void Class::set_factory_class(const Object& value) const {
+ StorePointer(&raw_ptr()->factory_class_, value.raw());
+}
+
+
// Return a TypeParameter if the type_name is a type parameter of this class.
// Return null otherwise.
RawTypeParameter* Class::LookupTypeParameter(const String& type_name) const {
@@ -1582,6 +1602,11 @@
}
+void UnresolvedClass::set_factory_signature_class(const Class& value) const {
+ StorePointer(&raw_ptr()->factory_signature_class_, value.raw());
+}
+
+
RawString* UnresolvedClass::Name() const {
if (qualifier() != String::null()) {
String& name = String::Handle();
@@ -1965,6 +1990,9 @@
bool ParameterizedType::IsResolved() const {
+ if (IsFinalized()) {
+ return true;
+ }
if (!HasResolvedTypeClass()) {
return false;
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698