OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
8 #include "vm/flags.h" | 9 #include "vm/flags.h" |
9 #include "vm/freelist.h" | 10 #include "vm/freelist.h" |
10 #include "vm/handles.h" | 11 #include "vm/handles.h" |
11 #include "vm/heap.h" | 12 #include "vm/heap.h" |
12 #include "vm/isolate.h" | 13 #include "vm/isolate.h" |
13 #include "vm/object.h" | 14 #include "vm/object.h" |
14 #include "vm/object_store.h" | 15 #include "vm/object_store.h" |
15 #include "vm/port.h" | 16 #include "vm/port.h" |
16 #include "vm/snapshot.h" | 17 #include "vm/snapshot.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // TODO(iposva): Fix race condition here. | 55 // TODO(iposva): Fix race condition here. |
55 if (vm_isolate_ != NULL || !Flags::Initialized()) { | 56 if (vm_isolate_ != NULL || !Flags::Initialized()) { |
56 return "VM already initialized."; | 57 return "VM already initialized."; |
57 } | 58 } |
58 OS::InitOnce(); | 59 OS::InitOnce(); |
59 VirtualMemory::InitOnce(); | 60 VirtualMemory::InitOnce(); |
60 Isolate::InitOnce(); | 61 Isolate::InitOnce(); |
61 PortMap::InitOnce(); | 62 PortMap::InitOnce(); |
62 FreeListElement::InitOnce(); | 63 FreeListElement::InitOnce(); |
63 Api::InitOnce(); | 64 Api::InitOnce(); |
| 65 CodeObservers::InitOnce(); |
64 // Create the VM isolate and finish the VM initialization. | 66 // Create the VM isolate and finish the VM initialization. |
65 ASSERT(thread_pool_ == NULL); | 67 ASSERT(thread_pool_ == NULL); |
66 thread_pool_ = new ThreadPool(); | 68 thread_pool_ = new ThreadPool(); |
67 { | 69 { |
68 ASSERT(vm_isolate_ == NULL); | 70 ASSERT(vm_isolate_ == NULL); |
69 ASSERT(Flags::Initialized()); | 71 ASSERT(Flags::Initialized()); |
70 vm_isolate_ = Isolate::Init("vm-isolate"); | 72 vm_isolate_ = Isolate::Init("vm-isolate"); |
71 StackZone zone(vm_isolate_); | 73 StackZone zone(vm_isolate_); |
72 HandleScope handle_scope(vm_isolate_); | 74 HandleScope handle_scope(vm_isolate_); |
73 Heap::Init(vm_isolate_); | 75 Heap::Init(vm_isolate_); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 void* callback_data = isolate->init_callback_data(); | 186 void* callback_data = isolate->init_callback_data(); |
185 isolate->Shutdown(); | 187 isolate->Shutdown(); |
186 delete isolate; | 188 delete isolate; |
187 | 189 |
188 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); | 190 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); |
189 if (callback != NULL) { | 191 if (callback != NULL) { |
190 (callback)(callback_data); | 192 (callback)(callback_data); |
191 } | 193 } |
192 } | 194 } |
193 | 195 |
| 196 |
194 } // namespace dart | 197 } // namespace dart |
OLD | NEW |