| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 #if !defined(DART_PRECOMPILED_RUNTIME) | 303 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 304 static RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) { | 304 static RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) { |
| 305 Zone* zone = thread->zone(); | 305 Zone* zone = thread->zone(); |
| 306 kernel::KernelReader reader(program); | 306 kernel::KernelReader reader(program); |
| 307 | 307 |
| 308 Isolate* isolate = thread->isolate(); | 308 Isolate* isolate = thread->isolate(); |
| 309 // Mark the already-pending classes. This mark bit will be used to avoid | 309 // Mark the already-pending classes. This mark bit will be used to avoid |
| 310 // adding classes to the list more than once. | 310 // adding classes to the list more than once. |
| 311 GrowableObjectArray& pending_classes = GrowableObjectArray::Handle( | 311 GrowableObjectArray& pending_classes = GrowableObjectArray::Handle( |
| 312 zone, isolate->object_store()->pending_classes()); | 312 zone, isolate->object_store()->pending_classes()); |
| 313 dart::Class& pending = dart::Class::Handle(zone); | 313 Class& pending = Class::Handle(zone); |
| 314 for (intptr_t i = 0; i < pending_classes.Length(); ++i) { | 314 for (intptr_t i = 0; i < pending_classes.Length(); ++i) { |
| 315 pending ^= pending_classes.At(i); | 315 pending ^= pending_classes.At(i); |
| 316 pending.set_is_marked_for_parsing(); | 316 pending.set_is_marked_for_parsing(); |
| 317 } | 317 } |
| 318 | 318 |
| 319 // Load the bootstrap libraries in order (see object_store.h). | 319 // Load the bootstrap libraries in order (see object_store.h). |
| 320 Library& library = Library::Handle(zone); | 320 Library& library = Library::Handle(zone); |
| 321 String& dart_name = String::Handle(zone); | 321 String& dart_name = String::Handle(zone); |
| 322 for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) { | 322 for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) { |
| 323 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; | 323 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 lib.Register(thread); | 375 lib.Register(thread); |
| 376 isolate->object_store()->set_bootstrap_library(id, lib); | 376 isolate->object_store()->set_bootstrap_library(id, lib); |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 | 379 |
| 380 return (kernel_program == NULL) ? BootstrapFromSource(thread) | 380 return (kernel_program == NULL) ? BootstrapFromSource(thread) |
| 381 : BootstrapFromKernel(thread, kernel_program); | 381 : BootstrapFromKernel(thread, kernel_program); |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace dart | 384 } // namespace dart |
| OLD | NEW |