| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/bootstrap.h" | 5 #include "vm/bootstrap.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/bootstrap_natives.h" | 9 #include "vm/bootstrap_natives.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 String& source = String::Handle(); | 249 String& source = String::Handle(); |
| 250 Script& script = Script::Handle(); | 250 Script& script = Script::Handle(); |
| 251 Library& lib = Library::Handle(); | 251 Library& lib = Library::Handle(); |
| 252 Error& error = Error::Handle(); | 252 Error& error = Error::Handle(); |
| 253 Dart_LibraryTagHandler saved_tag_handler = isolate->library_tag_handler(); | 253 Dart_LibraryTagHandler saved_tag_handler = isolate->library_tag_handler(); |
| 254 | 254 |
| 255 // Set the library tag handler for the isolate to the bootstrap | 255 // Set the library tag handler for the isolate to the bootstrap |
| 256 // library tag handler so that we can load all the bootstrap libraries. | 256 // library tag handler so that we can load all the bootstrap libraries. |
| 257 isolate->set_library_tag_handler(BootstrapLibraryTagHandler); | 257 isolate->set_library_tag_handler(BootstrapLibraryTagHandler); |
| 258 | 258 |
| 259 // Enter the Dart Scope as we will be calling back into the library | 259 HANDLESCOPE(isolate); |
| 260 // tag handler when compiling the bootstrap libraries. | |
| 261 Dart_EnterScope(); | |
| 262 | 260 |
| 263 // Create library objects for all the bootstrap libraries. | 261 // Create library objects for all the bootstrap libraries. |
| 264 for (intptr_t i = 0; | 262 for (intptr_t i = 0; |
| 265 bootstrap_libraries[i].index_ != ObjectStore::kNone; | 263 bootstrap_libraries[i].index_ != ObjectStore::kNone; |
| 266 ++i) { | 264 ++i) { |
| 267 uri = Symbols::New(bootstrap_libraries[i].uri_); | 265 uri = Symbols::New(bootstrap_libraries[i].uri_); |
| 268 lib = Library::LookupLibrary(uri); | 266 lib = Library::LookupLibrary(uri); |
| 269 if (lib.IsNull()) { | 267 if (lib.IsNull()) { |
| 270 lib = Library::NewLibraryHelper(uri, false); | 268 lib = Library::NewLibraryHelper(uri, false); |
| 271 lib.Register(); | 269 lib.Register(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 302 bootstrap_libraries[i].patch_paths_); | 300 bootstrap_libraries[i].patch_paths_); |
| 303 if (!error.IsNull()) { | 301 if (!error.IsNull()) { |
| 304 break; | 302 break; |
| 305 } | 303 } |
| 306 } | 304 } |
| 307 } | 305 } |
| 308 if (error.IsNull()) { | 306 if (error.IsNull()) { |
| 309 SetupNativeResolver(); | 307 SetupNativeResolver(); |
| 310 } | 308 } |
| 311 | 309 |
| 312 // Exit the Dart scope. | |
| 313 Dart_ExitScope(); | |
| 314 | |
| 315 // Restore the library tag handler for the isolate. | 310 // Restore the library tag handler for the isolate. |
| 316 isolate->set_library_tag_handler(saved_tag_handler); | 311 isolate->set_library_tag_handler(saved_tag_handler); |
| 317 | 312 |
| 318 return error.raw(); | 313 return error.raw(); |
| 319 } | 314 } |
| 320 | 315 |
| 321 } // namespace dart | 316 } // namespace dart |
| OLD | NEW |