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/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 error = lib.Patch(script); | 246 error = lib.Patch(script); |
247 if (!error.IsNull()) { | 247 if (!error.IsNull()) { |
248 return error.raw(); | 248 return error.raw(); |
249 } | 249 } |
250 } | 250 } |
251 return Error::null(); | 251 return Error::null(); |
252 } | 252 } |
253 | 253 |
254 | 254 |
255 RawError* Bootstrap::LoadandCompileScripts() { | 255 RawError* Bootstrap::LoadandCompileScripts() { |
256 Isolate* isolate = Isolate::Current(); | 256 Thread* thread = Thread::Current(); |
| 257 Isolate* isolate = thread->isolate(); |
257 String& uri = String::Handle(isolate); | 258 String& uri = String::Handle(isolate); |
258 String& patch_uri = String::Handle(isolate); | 259 String& patch_uri = String::Handle(isolate); |
259 String& source = String::Handle(isolate); | 260 String& source = String::Handle(isolate); |
260 Script& script = Script::Handle(isolate); | 261 Script& script = Script::Handle(isolate); |
261 Library& lib = Library::Handle(isolate); | 262 Library& lib = Library::Handle(isolate); |
262 Error& error = Error::Handle(isolate); | 263 Error& error = Error::Handle(isolate); |
263 Dart_LibraryTagHandler saved_tag_handler = isolate->library_tag_handler(); | 264 Dart_LibraryTagHandler saved_tag_handler = isolate->library_tag_handler(); |
264 | 265 |
265 // Set the library tag handler for the isolate to the bootstrap | 266 // Set the library tag handler for the isolate to the bootstrap |
266 // library tag handler so that we can load all the bootstrap libraries. | 267 // library tag handler so that we can load all the bootstrap libraries. |
267 isolate->set_library_tag_handler(BootstrapLibraryTagHandler); | 268 isolate->set_library_tag_handler(BootstrapLibraryTagHandler); |
268 | 269 |
269 HANDLESCOPE(isolate); | 270 HANDLESCOPE(thread); |
270 | 271 |
271 // Create library objects for all the bootstrap libraries. | 272 // Create library objects for all the bootstrap libraries. |
272 for (intptr_t i = 0; | 273 for (intptr_t i = 0; |
273 bootstrap_libraries[i].index_ != ObjectStore::kNone; | 274 bootstrap_libraries[i].index_ != ObjectStore::kNone; |
274 ++i) { | 275 ++i) { |
275 uri = Symbols::New(bootstrap_libraries[i].uri_); | 276 uri = Symbols::New(bootstrap_libraries[i].uri_); |
276 lib = Library::LookupLibrary(uri); | 277 lib = Library::LookupLibrary(uri); |
277 if (lib.IsNull()) { | 278 if (lib.IsNull()) { |
278 lib = Library::NewLibraryHelper(uri, false); | 279 lib = Library::NewLibraryHelper(uri, false); |
279 lib.SetLoadRequested(); | 280 lib.SetLoadRequested(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 Compiler::CompileClass(cls); | 330 Compiler::CompileClass(cls); |
330 } | 331 } |
331 | 332 |
332 // Restore the library tag handler for the isolate. | 333 // Restore the library tag handler for the isolate. |
333 isolate->set_library_tag_handler(saved_tag_handler); | 334 isolate->set_library_tag_handler(saved_tag_handler); |
334 | 335 |
335 return error.raw(); | 336 return error.raw(); |
336 } | 337 } |
337 | 338 |
338 } // namespace dart | 339 } // namespace dart |
OLD | NEW |