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

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: 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..ca2a64d17cae4f3d34fc917ee9c5fd6d5f911ec3 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);
// Allocate and initialize the free list element class.
@@ -849,19 +848,6 @@ RawError* Object::Init(Isolate* isolate) {
// well as the core implementation dictionary have been setup, preallocate
// remaining classes and register them by name in the dictionaries.
String& name = String::Handle();
- cls = Class::New<Bool>();
- object_store->set_bool_class(cls);
- 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();
- 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);
pending_classes.Add(cls, Heap::kOld);
@@ -929,6 +915,17 @@ RawError* Object::Init(Isolate* isolate) {
type = Type::NewNonParameterizedType(cls);
object_store->set_object_type(type);
+ cls = Class::New<Bool>();
+ object_store->set_bool_class(cls);
+ RegisterClass(cls, Symbols::Bool(), core_lib);
+ pending_classes.Add(cls, Heap::kOld);
+
+ cls = Class::New<Instance>(kNullCid);
+ cls.set_is_prefinalized();
+ object_store->set_null_class(cls);
+ RegisterClass(cls, Symbols::Null(), core_lib);
+ pending_classes.Add(cls, Heap::kOld);
+
cls = object_store->type_class();
RegisterPrivateClass(cls, Symbols::Type(), core_lib);
pending_classes.Add(cls, Heap::kOld);
@@ -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