| 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/become.h" | 7 #include "vm/become.h" |
| 8 #include "vm/clustered_snapshot.h" | 8 #include "vm/clustered_snapshot.h" |
| 9 #include "vm/code_observers.h" | 9 #include "vm/code_observers.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 208)); | 118 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 208)); |
| 119 #endif | 119 #endif |
| 120 #undef CHECK_OFFSET | 120 #undef CHECK_OFFSET |
| 121 } | 121 } |
| 122 | 122 |
| 123 | 123 |
| 124 char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot, | 124 char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot, |
| 125 const uint8_t* instructions_snapshot, | 125 const uint8_t* instructions_snapshot, |
| 126 Dart_IsolateCreateCallback create, | 126 Dart_IsolateCreateCallback create, |
| 127 Dart_IsolateShutdownCallback shutdown, | 127 Dart_IsolateShutdownCallback shutdown, |
| 128 Dart_IsolateCleanupCallback cleanup, |
| 128 Dart_ThreadExitCallback thread_exit, | 129 Dart_ThreadExitCallback thread_exit, |
| 129 Dart_FileOpenCallback file_open, | 130 Dart_FileOpenCallback file_open, |
| 130 Dart_FileReadCallback file_read, | 131 Dart_FileReadCallback file_read, |
| 131 Dart_FileWriteCallback file_write, | 132 Dart_FileWriteCallback file_write, |
| 132 Dart_FileCloseCallback file_close, | 133 Dart_FileCloseCallback file_close, |
| 133 Dart_EntropySource entropy_source, | 134 Dart_EntropySource entropy_source, |
| 134 Dart_GetVMServiceAssetsArchive get_service_assets) { | 135 Dart_GetVMServiceAssetsArchive get_service_assets) { |
| 135 CheckOffsets(); | 136 CheckOffsets(); |
| 136 // TODO(iposva): Fix race condition here. | 137 // TODO(iposva): Fix race condition here. |
| 137 if (vm_isolate_ != NULL || !Flags::Initialized()) { | 138 if (vm_isolate_ != NULL || !Flags::Initialized()) { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 vm_isolate_->heap()->Verify(kRequireMarked); | 307 vm_isolate_->heap()->Verify(kRequireMarked); |
| 307 #endif | 308 #endif |
| 308 } | 309 } |
| 309 // Allocate the "persistent" scoped handles for the predefined API | 310 // Allocate the "persistent" scoped handles for the predefined API |
| 310 // values (such as Dart_True, Dart_False and Dart_Null). | 311 // values (such as Dart_True, Dart_False and Dart_Null). |
| 311 Api::InitHandles(); | 312 Api::InitHandles(); |
| 312 | 313 |
| 313 Thread::ExitIsolate(); // Unregister the VM isolate from this thread. | 314 Thread::ExitIsolate(); // Unregister the VM isolate from this thread. |
| 314 Isolate::SetCreateCallback(create); | 315 Isolate::SetCreateCallback(create); |
| 315 Isolate::SetShutdownCallback(shutdown); | 316 Isolate::SetShutdownCallback(shutdown); |
| 317 Isolate::SetCleanupCallback(cleanup); |
| 316 | 318 |
| 317 if (FLAG_support_service) { | 319 if (FLAG_support_service) { |
| 318 Service::SetGetServiceAssetsCallback(get_service_assets); | 320 Service::SetGetServiceAssetsCallback(get_service_assets); |
| 319 } | 321 } |
| 320 | 322 |
| 321 ServiceIsolate::Run(); | 323 ServiceIsolate::Run(); |
| 322 | 324 |
| 323 #ifndef DART_PRECOMPILED_RUNTIME | 325 #ifndef DART_PRECOMPILED_RUNTIME |
| 324 KernelIsolate::Run(); | 326 KernelIsolate::Run(); |
| 325 #endif // DART_PRECOMPILED_RUNTIME | 327 #endif // DART_PRECOMPILED_RUNTIME |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 return predefined_handles_->handles_.IsValidScopedHandle(address); | 760 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 759 } | 761 } |
| 760 | 762 |
| 761 | 763 |
| 762 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 764 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 763 ASSERT(predefined_handles_ != NULL); | 765 ASSERT(predefined_handles_ != NULL); |
| 764 return predefined_handles_->api_handles_.IsValidHandle(handle); | 766 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 765 } | 767 } |
| 766 | 768 |
| 767 } // namespace dart | 769 } // namespace dart |
| OLD | NEW |