| 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 #if !defined(DART_PRECOMPILED_RUNTIME) | 9 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) { | 71 RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) { |
| 72 Zone* zone = thread->zone(); | 72 Zone* zone = thread->zone(); |
| 73 kernel::KernelReader reader(program); | 73 kernel::KernelReader reader(program); |
| 74 Isolate* isolate = thread->isolate(); | 74 Isolate* isolate = thread->isolate(); |
| 75 // Mark the already-pending classes. This mark bit will be used to avoid | 75 // Mark the already-pending classes. This mark bit will be used to avoid |
| 76 // adding classes to the list more than once. | 76 // adding classes to the list more than once. |
| 77 GrowableObjectArray& pending_classes = GrowableObjectArray::Handle( | 77 GrowableObjectArray& pending_classes = GrowableObjectArray::Handle( |
| 78 zone, isolate->object_store()->pending_classes()); | 78 zone, isolate->object_store()->pending_classes()); |
| 79 dart::Class& pending = dart::Class::Handle(zone); | 79 Class& pending = Class::Handle(zone); |
| 80 for (intptr_t i = 0; i < pending_classes.Length(); ++i) { | 80 for (intptr_t i = 0; i < pending_classes.Length(); ++i) { |
| 81 pending ^= pending_classes.At(i); | 81 pending ^= pending_classes.At(i); |
| 82 pending.set_is_marked_for_parsing(); | 82 pending.set_is_marked_for_parsing(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Load the bootstrap libraries in order (see object_store.h). | 85 // Load the bootstrap libraries in order (see object_store.h). |
| 86 Library& library = Library::Handle(zone); | 86 Library& library = Library::Handle(zone); |
| 87 String& dart_name = String::Handle(zone); | 87 String& dart_name = String::Handle(zone); |
| 88 for (intptr_t i = 0; i < bootstrap_library_count; ++i) { | 88 for (intptr_t i = 0; i < bootstrap_library_count; ++i) { |
| 89 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; | 89 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return BootstrapFromKernel(thread, program); | 140 return BootstrapFromKernel(thread, program); |
| 141 } | 141 } |
| 142 #else | 142 #else |
| 143 RawError* Bootstrap::DoBootstrapping(kernel::Program* program) { | 143 RawError* Bootstrap::DoBootstrapping(kernel::Program* program) { |
| 144 UNREACHABLE(); | 144 UNREACHABLE(); |
| 145 return Error::null(); | 145 return Error::null(); |
| 146 } | 146 } |
| 147 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 147 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 148 | 148 |
| 149 } // namespace dart | 149 } // namespace dart |
| OLD | NEW |