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, |
83 Dart_FileWriteCallback file_write, | 84 Dart_FileWriteCallback file_write, |
84 Dart_FileCloseCallback file_close) { | 85 Dart_FileCloseCallback file_close) { |
85 // TODO(iposva): Fix race condition here. | 86 // TODO(iposva): Fix race condition here. |
86 if (vm_isolate_ != NULL || !Flags::Initialized()) { | 87 if (vm_isolate_ != NULL || !Flags::Initialized()) { |
87 return "VM already initialized."; | 88 return "VM already initialized."; |
88 } | 89 } |
89 Isolate::SetFileCallbacks(file_open, file_write, file_close); | 90 Isolate::SetFileCallbacks(file_open, file_read, file_write, file_close); |
90 OS::InitOnce(); | 91 OS::InitOnce(); |
91 VirtualMemory::InitOnce(); | 92 VirtualMemory::InitOnce(); |
92 Isolate::InitOnce(); | 93 Isolate::InitOnce(); |
93 PortMap::InitOnce(); | 94 PortMap::InitOnce(); |
94 FreeListElement::InitOnce(); | 95 FreeListElement::InitOnce(); |
95 Api::InitOnce(); | 96 Api::InitOnce(); |
96 CodeObservers::InitOnce(); | 97 CodeObservers::InitOnce(); |
97 #if defined(USING_SIMULATOR) | 98 #if defined(USING_SIMULATOR) |
98 Simulator::InitOnce(); | 99 Simulator::InitOnce(); |
99 #endif | 100 #endif |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 return predefined_handles_->handles_.AllocateScopedHandle(); | 248 return predefined_handles_->handles_.AllocateScopedHandle(); |
248 } | 249 } |
249 | 250 |
250 | 251 |
251 bool Dart::IsReadOnlyHandle(uword address) { | 252 bool Dart::IsReadOnlyHandle(uword address) { |
252 ASSERT(predefined_handles_ != NULL); | 253 ASSERT(predefined_handles_ != NULL); |
253 return predefined_handles_->handles_.IsValidScopedHandle(address); | 254 return predefined_handles_->handles_.IsValidScopedHandle(address); |
254 } | 255 } |
255 | 256 |
256 } // namespace dart | 257 } // namespace dart |
OLD | NEW |