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

Unified Diff: runtime/vm/object.cc

Issue 9422019: isolates refactor: this change introduces 'dart:isolate' as a library. This is a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 10 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/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 562c4921023de034b0fce2d697f359da7524615d..97caee3c32285dea59f7e76fe521d2ef77166f6f 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -663,6 +663,15 @@ RawError* Object::Init(Isolate* isolate) {
return error.raw();
}
+ const Script& isolate_script = Script::Handle(Bootstrap::LoadIsolateScript());
+ Library::InitIsolateLibrary(isolate);
+ Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
+ ASSERT(!isolate_lib.IsNull());
+ error = Bootstrap::Compile(isolate_lib, isolate_script);
+ if (!error.IsNull()) {
+ return error.raw();
+ }
+
Bootstrap::SetupNativeResolver();
// Remove the Object superclass cycle by setting the super type to null (not
@@ -4627,6 +4636,14 @@ void Library::InitCoreLibrary(Isolate* isolate) {
}
+void Library::InitIsolateLibrary(Isolate* isolate) {
+ const String& url = String::Handle(String::NewSymbol("dart:isolate"));
+ const Library& lib = Library::Handle(Library::New(url));
+ lib.Register();
+ isolate->object_store()->set_isolate_library(lib);
+}
+
+
void Library::InitNativeWrappersLibrary(Isolate* isolate) {
static const int kNumNativeWrappersClasses = 4;
ASSERT(kNumNativeWrappersClasses > 0 && kNumNativeWrappersClasses < 10);
@@ -4734,6 +4751,11 @@ RawLibrary* Library::CoreImplLibrary() {
}
+RawLibrary* Library::IsolateLibrary() {
+ return Isolate::Current()->object_store()->isolate_library();
+}
+
+
RawLibrary* Library::NativeWrappersLibrary() {
return Isolate::Current()->object_store()->native_wrappers_library();
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698