| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/dart.h" | 5 #include "vm/dart.h" |
| 6 | 6 |
| 7 #include "vm/code_observers.h" | 7 #include "vm/code_observers.h" |
| 8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/dart_api_state.h" | 9 #include "vm/dart_api_state.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 Dart_FileReadCallback file_read, | 124 Dart_FileReadCallback file_read, |
| 125 Dart_FileWriteCallback file_write, | 125 Dart_FileWriteCallback file_write, |
| 126 Dart_FileCloseCallback file_close, | 126 Dart_FileCloseCallback file_close, |
| 127 Dart_EntropySource entropy_source, | 127 Dart_EntropySource entropy_source, |
| 128 Dart_GetVMServiceAssetsArchive get_service_assets) { | 128 Dart_GetVMServiceAssetsArchive get_service_assets) { |
| 129 CheckOffsets(); | 129 CheckOffsets(); |
| 130 // TODO(iposva): Fix race condition here. | 130 // TODO(iposva): Fix race condition here. |
| 131 if (vm_isolate_ != NULL || !Flags::Initialized()) { | 131 if (vm_isolate_ != NULL || !Flags::Initialized()) { |
| 132 return "VM already initialized or flags not initialized."; | 132 return "VM already initialized or flags not initialized."; |
| 133 } | 133 } |
| 134 #if defined(DART_PRECOMPILED_RUNTIME) |
| 135 if (instructions_snapshot == NULL) { |
| 136 return "Precompiled runtime requires a precompiled snapshot"; |
| 137 } |
| 138 #else |
| 139 if (instructions_snapshot != NULL) { |
| 140 return "JIT runtime cannot run a precompiled snapshot"; |
| 141 } |
| 142 #endif |
| 134 set_thread_exit_callback(thread_exit); | 143 set_thread_exit_callback(thread_exit); |
| 135 SetFileCallbacks(file_open, file_read, file_write, file_close); | 144 SetFileCallbacks(file_open, file_read, file_write, file_close); |
| 136 set_entropy_source_callback(entropy_source); | 145 set_entropy_source_callback(entropy_source); |
| 137 OS::InitOnce(); | 146 OS::InitOnce(); |
| 138 VirtualMemory::InitOnce(); | 147 VirtualMemory::InitOnce(); |
| 139 OSThread::InitOnce(); | 148 OSThread::InitOnce(); |
| 140 if (FLAG_support_timeline) { | 149 if (FLAG_support_timeline) { |
| 141 Timeline::InitOnce(); | 150 Timeline::InitOnce(); |
| 142 } | 151 } |
| 143 NOT_IN_PRODUCT(TimelineDurationScope tds(Timeline::GetVMStream(), | 152 NOT_IN_PRODUCT(TimelineDurationScope tds(Timeline::GetVMStream(), |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 return predefined_handles_->handles_.IsValidScopedHandle(address); | 628 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 620 } | 629 } |
| 621 | 630 |
| 622 | 631 |
| 623 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 632 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 624 ASSERT(predefined_handles_ != NULL); | 633 ASSERT(predefined_handles_ != NULL); |
| 625 return predefined_handles_->api_handles_.IsValidHandle(handle); | 634 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 626 } | 635 } |
| 627 | 636 |
| 628 } // namespace dart | 637 } // namespace dart |
| OLD | NEW |