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

Unified Diff: runtime/vm/object.cc

Issue 9420038: Heartbeat implementation of dart:mirrors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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
===================================================================
--- runtime/vm/object.cc (revision 5107)
+++ runtime/vm/object.cc (working copy)
@@ -672,7 +672,6 @@
if (!error.IsNull()) {
return error.raw();
}
-
const Script& isolate_script = Script::Handle(Bootstrap::LoadIsolateScript());
Library::InitIsolateLibrary(isolate);
Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
@@ -681,7 +680,14 @@
if (!error.IsNull()) {
return error.raw();
}
-
+ const Script& mirrors_script = Script::Handle(Bootstrap::LoadMirrorsScript());
+ Library::InitMirrorsLibrary(isolate);
+ Library& mirrors_lib = Library::Handle(Library::MirrorsLibrary());
+ ASSERT(!mirrors_lib.IsNull());
+ error = Bootstrap::Compile(mirrors_lib, mirrors_script);
+ if (!error.IsNull()) {
+ return error.raw();
+ }
Bootstrap::SetupNativeResolver();
// Remove the Object superclass cycle by setting the super type to null (not
@@ -4881,6 +4887,16 @@
}
+void Library::InitMirrorsLibrary(Isolate* isolate) {
+ const String& url = String::Handle(String::NewSymbol("dart:mirrors"));
+ const Library& lib = Library::Handle(Library::New(url));
+ lib.Register();
+ const Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
+ lib.AddImport(isolate_lib);
+ isolate->object_store()->set_mirrors_library(lib);
+}
+
+
void Library::InitNativeWrappersLibrary(Isolate* isolate) {
static const int kNumNativeWrappersClasses = 4;
ASSERT(kNumNativeWrappersClasses > 0 && kNumNativeWrappersClasses < 10);
@@ -4993,6 +5009,11 @@
}
+RawLibrary* Library::MirrorsLibrary() {
+ return Isolate::Current()->object_store()->mirrors_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