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" |
11 #include "vm/freelist.h" | 11 #include "vm/freelist.h" |
12 #include "vm/handles.h" | 12 #include "vm/handles.h" |
13 #include "vm/heap.h" | 13 #include "vm/heap.h" |
14 #include "vm/isolate.h" | 14 #include "vm/isolate.h" |
15 #include "vm/object.h" | 15 #include "vm/object.h" |
16 #include "vm/object_store.h" | 16 #include "vm/object_store.h" |
17 #include "vm/port.h" | 17 #include "vm/port.h" |
| 18 #include "vm/simulator.h" |
18 #include "vm/snapshot.h" | 19 #include "vm/snapshot.h" |
19 #include "vm/stub_code.h" | 20 #include "vm/stub_code.h" |
20 #include "vm/symbols.h" | 21 #include "vm/symbols.h" |
21 #include "vm/thread_pool.h" | 22 #include "vm/thread_pool.h" |
22 #include "vm/virtual_memory.h" | 23 #include "vm/virtual_memory.h" |
23 #include "vm/zone.h" | 24 #include "vm/zone.h" |
24 | 25 |
25 namespace dart { | 26 namespace dart { |
26 | 27 |
27 DEFINE_FLAG(bool, heap_profile_initialize, false, | 28 DEFINE_FLAG(bool, heap_profile_initialize, false, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_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(); |
| 98 #if defined(USING_SIMULATOR) |
| 99 Simulator::InitOnce(); |
| 100 #endif |
97 // Create the read-only handles area. | 101 // Create the read-only handles area. |
98 ASSERT(predefined_handles_ == NULL); | 102 ASSERT(predefined_handles_ == NULL); |
99 predefined_handles_ = new ReadOnlyHandles(); | 103 predefined_handles_ = new ReadOnlyHandles(); |
100 // Create the VM isolate and finish the VM initialization. | 104 // Create the VM isolate and finish the VM initialization. |
101 ASSERT(thread_pool_ == NULL); | 105 ASSERT(thread_pool_ == NULL); |
102 thread_pool_ = new ThreadPool(); | 106 thread_pool_ = new ThreadPool(); |
103 { | 107 { |
104 ASSERT(vm_isolate_ == NULL); | 108 ASSERT(vm_isolate_ == NULL); |
105 ASSERT(Flags::Initialized()); | 109 ASSERT(Flags::Initialized()); |
106 vm_isolate_ = Isolate::Init("vm-isolate"); | 110 vm_isolate_ = Isolate::Init("vm-isolate"); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 return predefined_handles_->handles_.AllocateScopedHandle(); | 255 return predefined_handles_->handles_.AllocateScopedHandle(); |
252 } | 256 } |
253 | 257 |
254 | 258 |
255 bool Dart::IsReadOnlyHandle(uword address) { | 259 bool Dart::IsReadOnlyHandle(uword address) { |
256 ASSERT(predefined_handles_ != NULL); | 260 ASSERT(predefined_handles_ != NULL); |
257 return predefined_handles_->handles_.IsValidScopedHandle(address); | 261 return predefined_handles_->handles_.IsValidScopedHandle(address); |
258 } | 262 } |
259 | 263 |
260 } // namespace dart | 264 } // namespace dart |
OLD | NEW |