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

Unified Diff: runtime/vm/object.cc

Issue 10830045: - Add the ability to protect VirtualMemory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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/heap.cc ('k') | runtime/vm/pages.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 9969)
+++ runtime/vm/object.cc (working copy)
@@ -428,6 +428,9 @@
isolate->object_store()->set_array_class(cls);
cls = Class::New<OneByteString>();
isolate->object_store()->set_one_byte_string_class(cls);
+
+ // TODO(asiva): Assign the names of shared classes instead of relying on the
+ // lookup switch in Object::GetSingletonClassName.
}
@@ -765,11 +768,11 @@
// because their names are reserved keywords. Their names are not heap
// allocated, because the classes reside in the VM isolate.
// The corresponding types are stored in the object store.
- cls = null_class_;
+ cls = null_class();
type = Type::NewNonParameterizedType(cls);
object_store->set_null_type(type);
- cls = void_class_;
+ cls = void_class();
type = Type::NewNonParameterizedType(cls);
object_store->set_void_type(type);
@@ -777,10 +780,9 @@
// is a built-in identifier, rather than a reserved keyword. Its name is not
// heap allocated, because the class resides in the VM isolate.
// The corresponding type, the "unknown type", is stored in the object store.
- cls = dynamic_class_;
+ cls = dynamic_class();
type = Type::NewNonParameterizedType(cls);
object_store->set_dynamic_type(type);
- core_lib.AddClass(cls);
// Allocate pre-initialized values.
Bool& bool_value = Bool::Handle();
@@ -6051,6 +6053,12 @@
core_lib.AddImport(core_impl_lib);
core_impl_lib.AddImport(core_lib);
isolate->object_store()->set_root_library(Library::Handle());
+
+ // Hook up predefined classes without setting their library pointers. These
+ // classes are coming from the VM isolate, and are shared between multiple
+ // isolates so setting their library pointers would be wrong.
+ const Class& cls = Class::Handle(Object::dynamic_class());
+ core_lib.AddObject(cls, String::Handle(cls.Name()));
}
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698