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/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 DISALLOW_COPY_AND_ASSIGN(ReadOnlyHandles); | 73 DISALLOW_COPY_AND_ASSIGN(ReadOnlyHandles); |
74 }; | 74 }; |
75 | 75 |
76 | 76 |
77 // TODO(turnidge): We should add a corresponding Dart::Cleanup. | 77 // TODO(turnidge): We should add a corresponding Dart::Cleanup. |
78 const char* Dart::InitOnce(Dart_IsolateCreateCallback create, | 78 const char* Dart::InitOnce(Dart_IsolateCreateCallback create, |
79 Dart_IsolateInterruptCallback interrupt, | 79 Dart_IsolateInterruptCallback interrupt, |
80 Dart_IsolateUnhandledExceptionCallback unhandled, | 80 Dart_IsolateUnhandledExceptionCallback unhandled, |
81 Dart_IsolateShutdownCallback shutdown, | 81 Dart_IsolateShutdownCallback shutdown, |
82 Dart_FileOpenCallback file_open, | 82 Dart_FileOpenCallback file_open, |
83 Dart_FileReadCallback file_read, | |
84 Dart_FileWriteCallback file_write, | 83 Dart_FileWriteCallback file_write, |
85 Dart_FileCloseCallback file_close) { | 84 Dart_FileCloseCallback file_close) { |
86 // TODO(iposva): Fix race condition here. | 85 // TODO(iposva): Fix race condition here. |
87 if (vm_isolate_ != NULL || !Flags::Initialized()) { | 86 if (vm_isolate_ != NULL || !Flags::Initialized()) { |
88 return "VM already initialized."; | 87 return "VM already initialized."; |
89 } | 88 } |
90 Isolate::SetFileCallbacks(file_open, file_read, file_write, file_close); | 89 Isolate::SetFileCallbacks(file_open, file_write, file_close); |
91 OS::InitOnce(); | 90 OS::InitOnce(); |
92 VirtualMemory::InitOnce(); | 91 VirtualMemory::InitOnce(); |
93 Isolate::InitOnce(); | 92 Isolate::InitOnce(); |
94 PortMap::InitOnce(); | 93 PortMap::InitOnce(); |
95 FreeListElement::InitOnce(); | 94 FreeListElement::InitOnce(); |
96 Api::InitOnce(); | 95 Api::InitOnce(); |
97 CodeObservers::InitOnce(); | 96 CodeObservers::InitOnce(); |
98 #if defined(USING_SIMULATOR) | 97 #if defined(USING_SIMULATOR) |
99 Simulator::InitOnce(); | 98 Simulator::InitOnce(); |
100 #endif | 99 #endif |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 return predefined_handles_->handles_.AllocateScopedHandle(); | 247 return predefined_handles_->handles_.AllocateScopedHandle(); |
249 } | 248 } |
250 | 249 |
251 | 250 |
252 bool Dart::IsReadOnlyHandle(uword address) { | 251 bool Dart::IsReadOnlyHandle(uword address) { |
253 ASSERT(predefined_handles_ != NULL); | 252 ASSERT(predefined_handles_ != NULL); |
254 return predefined_handles_->handles_.IsValidScopedHandle(address); | 253 return predefined_handles_->handles_.IsValidScopedHandle(address); |
255 } | 254 } |
256 | 255 |
257 } // namespace dart | 256 } // namespace dart |
OLD | NEW |