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

Unified Diff: runtime/vm/object.cc

Issue 23012003: Add Null class to dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Marked test failing due to new dart2js mirror bug. Created 7 years, 4 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
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index b92355efc05b96497b1532fac38a09a2d74283a6..34fccc0da35f0e2f171071406b9559af35f44eef 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -417,8 +417,7 @@ void Object::InitOnce() {
// Allocate and initialize the null class.
cls = Class::New<Instance>(kNullCid);
- cls.set_is_finalized();
- cls.set_is_type_finalized();
+ cls.set_is_prefinalized();
Ivan Posva 2013/08/16 23:13:47 Please change this back to set_is_finalized().
isolate->object_store()->set_null_class(cls);
// Allocate and initialize the free list element class.
@@ -858,18 +857,10 @@ RawError* Object::Init(Isolate* isolate) {
// TODO(12364): The class 'Null' is not registered in the class dictionary
// because it is not exported by dart:core.
cls = Class::New<Instance>(kNullCid);
- cls.set_name(Symbols::Null());
- // We immediately mark Null as finalized because it has no corresponding
- // source.
- cls.set_is_finalized();
- cls.set_is_type_finalized();
object_store->set_null_class(cls);
- cls.set_library(core_lib); // A sort of fiction for the mirrors.
- // When/if we promote Null to an ordinary class, it should be added to the
- // core library, given source and added to the list of classes pending
- // finalization.
- // RegisterClass(cls, Symbols::Null(), core_lib);
- // pending_classes.Add(cls, Heap::kOld);
+ cls.set_is_prefinalized();
+ RegisterClass(cls, Symbols::Null(), core_lib);
+ pending_classes.Add(cls, Heap::kOld);
cls = object_store->array_class(); // Was allocated above.
RegisterPrivateClass(cls, Symbols::ObjectArray(), core_lib);
@@ -10476,8 +10467,8 @@ RawString* AbstractType::ClassName() const {
bool AbstractType::IsNullType() const {
- ASSERT(Type::Handle(Type::NullType()).IsCanonical());
- return raw() == Type::NullType();
+ return HasResolvedTypeClass() &&
+ (type_class() == Type::Handle(Type::NullType()).type_class());
}

Powered by Google App Engine
This is Rietveld 408576698