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

Unified Diff: runtime/vm/object.cc

Issue 22819005: Make Null a public class of dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase on dart2js's putback 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 34fccc0da35f0e2f171071406b9559af35f44eef..420adcbe459c13b4881e0ff027b050864b7b3468 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -417,7 +417,6 @@ void Object::InitOnce() {
// Allocate and initialize the null class.
cls = Class::New<Instance>(kNullCid);
- cls.set_is_prefinalized();
isolate->object_store()->set_null_class(cls);
regis 2013/08/15 17:27:26 Shouldn't this be done in Object::InitFromSnapshot
rmacnak 2013/08/15 17:56:04 object_class is also created in both Init(Isolate*
// Allocate and initialize the free list element class.
@@ -854,11 +853,9 @@ RawError* Object::Init(Isolate* isolate) {
RegisterClass(cls, Symbols::Bool(), core_lib);
pending_classes.Add(cls, Heap::kOld);
- // 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);
- object_store->set_null_class(cls);
cls.set_is_prefinalized();
+ object_store->set_null_class(cls);
RegisterClass(cls, Symbols::Null(), core_lib);
pending_classes.Add(cls, Heap::kOld);
regis 2013/08/15 17:27:26 Shouldn't this paragraph be moved to after the com
rmacnak 2013/08/15 17:56:04 Moved null and bool down.
@@ -10468,13 +10465,13 @@ RawString* AbstractType::ClassName() const {
bool AbstractType::IsNullType() const {
return HasResolvedTypeClass() &&
- (type_class() == Type::Handle(Type::NullType()).type_class());
+ (type_class() == Isolate::Current()->object_store()->null_class());
}
bool AbstractType::IsBoolType() const {
return HasResolvedTypeClass() &&
- (type_class() == Type::Handle(Type::BoolType()).type_class());
+ (type_class() == Isolate::Current()->object_store()->bool_class());
}

Powered by Google App Engine
This is Rietveld 408576698