| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // Eagerly compile Bool class, bool constants are used from within compiler. | 52 // Eagerly compile Bool class, bool constants are used from within compiler. |
| 53 cls = object_store->bool_class(); | 53 cls = object_store->bool_class(); |
| 54 Compiler::CompileClass(cls); | 54 Compiler::CompileClass(cls); |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 RawError* BootstrapFromKernel(Thread* thread, | 58 RawError* BootstrapFromKernel(Thread* thread, |
| 59 const uint8_t* buffer, | 59 const uint8_t* buffer, |
| 60 intptr_t buffer_length) { | 60 intptr_t buffer_length) { |
| 61 Zone* zone = thread->zone(); | 61 Zone* zone = thread->zone(); |
| 62 kernel::KernelReader reader(buffer, buffer_length, true); | 62 kernel::KernelReader reader(buffer, buffer_length); |
| 63 kernel::Program* program = reader.ReadPrecompiledProgram(); | 63 kernel::Program* program = reader.ReadPrecompiledProgram(); |
| 64 if (program == NULL) { | 64 if (program == NULL) { |
| 65 const String& message = | 65 const String& message = |
| 66 String::Handle(zone, String::New("Failed to read Kernel file")); | 66 String::Handle(zone, String::New("Failed to read Kernel file")); |
| 67 return ApiError::New(message); | 67 return ApiError::New(message); |
| 68 } | 68 } |
| 69 | 69 |
| 70 Isolate* isolate = thread->isolate(); | 70 Isolate* isolate = thread->isolate(); |
| 71 // Mark the already-pending classes. This mark bit will be used to avoid | 71 // Mark the already-pending classes. This mark bit will be used to avoid |
| 72 // adding classes to the list more than once. | 72 // adding classes to the list more than once. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 #else | 132 #else |
| 133 RawError* Bootstrap::DoBootstrapping(const uint8_t* kernel_buffer, | 133 RawError* Bootstrap::DoBootstrapping(const uint8_t* kernel_buffer, |
| 134 intptr_t kernel_buffer_length) { | 134 intptr_t kernel_buffer_length) { |
| 135 UNREACHABLE(); | 135 UNREACHABLE(); |
| 136 return Error::null(); | 136 return Error::null(); |
| 137 } | 137 } |
| 138 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 138 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 139 | 139 |
| 140 } // namespace dart | 140 } // namespace dart |
| OLD | NEW |