| 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();
|
| }
|
|
|