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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // Set the library tag handler for the isolate to the bootstrap | 288 // Set the library tag handler for the isolate to the bootstrap |
289 // library tag handler so that we can load all the bootstrap libraries. | 289 // library tag handler so that we can load all the bootstrap libraries. |
290 isolate->set_library_tag_handler(BootstrapLibraryTagHandler); | 290 isolate->set_library_tag_handler(BootstrapLibraryTagHandler); |
291 | 291 |
292 HANDLESCOPE(thread); | 292 HANDLESCOPE(thread); |
293 | 293 |
294 // Create library objects for all the bootstrap libraries. | 294 // Create library objects for all the bootstrap libraries. |
295 for (intptr_t i = 0; | 295 for (intptr_t i = 0; |
296 bootstrap_libraries[i].index_ != ObjectStore::kNone; | 296 bootstrap_libraries[i].index_ != ObjectStore::kNone; |
297 ++i) { | 297 ++i) { |
| 298 #ifdef PRODUCT |
| 299 if (bootstrap_libraries[i].index_ == ObjectStore::kMirrors) { |
| 300 continue; |
| 301 } |
| 302 #endif // !PRODUCT |
298 uri = Symbols::New(bootstrap_libraries[i].uri_); | 303 uri = Symbols::New(bootstrap_libraries[i].uri_); |
299 lib = Library::LookupLibrary(uri); | 304 lib = Library::LookupLibrary(uri); |
300 if (lib.IsNull()) { | 305 if (lib.IsNull()) { |
301 lib = Library::NewLibraryHelper(uri, false); | 306 lib = Library::NewLibraryHelper(uri, false); |
302 lib.SetLoadRequested(); | 307 lib.SetLoadRequested(); |
303 lib.Register(); | 308 lib.Register(); |
304 } | 309 } |
305 isolate->object_store()->set_bootstrap_library( | 310 isolate->object_store()->set_bootstrap_library( |
306 bootstrap_libraries[i].index_, lib); | 311 bootstrap_libraries[i].index_, lib); |
307 } | 312 } |
308 | 313 |
309 // Load, compile and patch bootstrap libraries. | 314 // Load, compile and patch bootstrap libraries. |
310 for (intptr_t i = 0; | 315 for (intptr_t i = 0; |
311 bootstrap_libraries[i].index_ != ObjectStore::kNone; | 316 bootstrap_libraries[i].index_ != ObjectStore::kNone; |
312 ++i) { | 317 ++i) { |
| 318 #ifdef PRODUCT |
| 319 if (bootstrap_libraries[i].index_ == ObjectStore::kMirrors) { |
| 320 continue; |
| 321 } |
| 322 #endif // PRODUCT |
313 uri = Symbols::New(bootstrap_libraries[i].uri_); | 323 uri = Symbols::New(bootstrap_libraries[i].uri_); |
314 lib = Library::LookupLibrary(uri); | 324 lib = Library::LookupLibrary(uri); |
315 ASSERT(!lib.IsNull()); | 325 ASSERT(!lib.IsNull()); |
316 source = GetLibrarySource(lib, uri, false); | 326 source = GetLibrarySource(lib, uri, false); |
317 if (source.IsNull()) { | 327 if (source.IsNull()) { |
318 const String& message = String::Handle( | 328 const String& message = String::Handle( |
319 String::NewFormatted("Unable to find dart source for %s", | 329 String::NewFormatted("Unable to find dart source for %s", |
320 uri.ToCString())); | 330 uri.ToCString())); |
321 error ^= ApiError::New(message); | 331 error ^= ApiError::New(message); |
322 break; | 332 break; |
(...skipping 27 matching lines...) Expand all Loading... |
350 Compiler::CompileClass(cls); | 360 Compiler::CompileClass(cls); |
351 } | 361 } |
352 | 362 |
353 // Restore the library tag handler for the isolate. | 363 // Restore the library tag handler for the isolate. |
354 isolate->set_library_tag_handler(saved_tag_handler); | 364 isolate->set_library_tag_handler(saved_tag_handler); |
355 | 365 |
356 return error.raw(); | 366 return error.raw(); |
357 } | 367 } |
358 | 368 |
359 } // namespace dart | 369 } // namespace dart |
OLD | NEW |