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/object_id_ring.h" | |
17 #include "vm/port.h" | 18 #include "vm/port.h" |
18 #include "vm/simulator.h" | 19 #include "vm/simulator.h" |
19 #include "vm/snapshot.h" | 20 #include "vm/snapshot.h" |
20 #include "vm/stub_code.h" | 21 #include "vm/stub_code.h" |
21 #include "vm/symbols.h" | 22 #include "vm/symbols.h" |
22 #include "vm/thread_pool.h" | 23 #include "vm/thread_pool.h" |
23 #include "vm/virtual_memory.h" | 24 #include "vm/virtual_memory.h" |
24 #include "vm/zone.h" | 25 #include "vm/zone.h" |
25 | 26 |
26 namespace dart { | 27 namespace dart { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 // Create the VM isolate and finish the VM initialization. | 104 // Create the VM isolate and finish the VM initialization. |
104 ASSERT(thread_pool_ == NULL); | 105 ASSERT(thread_pool_ == NULL); |
105 thread_pool_ = new ThreadPool(); | 106 thread_pool_ = new ThreadPool(); |
106 { | 107 { |
107 ASSERT(vm_isolate_ == NULL); | 108 ASSERT(vm_isolate_ == NULL); |
108 ASSERT(Flags::Initialized()); | 109 ASSERT(Flags::Initialized()); |
109 vm_isolate_ = Isolate::Init("vm-isolate"); | 110 vm_isolate_ = Isolate::Init("vm-isolate"); |
110 StackZone zone(vm_isolate_); | 111 StackZone zone(vm_isolate_); |
111 HandleScope handle_scope(vm_isolate_); | 112 HandleScope handle_scope(vm_isolate_); |
112 Heap::Init(vm_isolate_); | 113 Heap::Init(vm_isolate_); |
114 ObjectIdRing::Init(vm_isolate_); | |
Ivan Posva
2013/07/10 01:10:13
Does the VM isolate really need an object id ring?
Cutch
2013/07/10 17:23:10
Done.
| |
113 ObjectStore::Init(vm_isolate_); | 115 ObjectStore::Init(vm_isolate_); |
114 Object::InitOnce(); | 116 Object::InitOnce(); |
115 ArgumentsDescriptor::InitOnce(); | 117 ArgumentsDescriptor::InitOnce(); |
116 StubCode::InitOnce(); | 118 StubCode::InitOnce(); |
117 Scanner::InitOnce(); | 119 Scanner::InitOnce(); |
118 Symbols::InitOnce(vm_isolate_); | 120 Symbols::InitOnce(vm_isolate_); |
119 Object::CreateInternalMetaData(); | 121 Object::CreateInternalMetaData(); |
120 CPUFeatures::InitOnce(); | 122 CPUFeatures::InitOnce(); |
121 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 123 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
122 // Dart VM requires at least SSE2. | 124 // Dart VM requires at least SSE2. |
(...skipping 29 matching lines...) Expand all Loading... | |
152 | 154 |
153 | 155 |
154 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { | 156 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { |
155 // Initialize the new isolate. | 157 // Initialize the new isolate. |
156 TIMERSCOPE(time_isolate_initialization); | 158 TIMERSCOPE(time_isolate_initialization); |
157 Isolate* isolate = Isolate::Current(); | 159 Isolate* isolate = Isolate::Current(); |
158 ASSERT(isolate != NULL); | 160 ASSERT(isolate != NULL); |
159 StackZone zone(isolate); | 161 StackZone zone(isolate); |
160 HandleScope handle_scope(isolate); | 162 HandleScope handle_scope(isolate); |
161 Heap::Init(isolate); | 163 Heap::Init(isolate); |
164 ObjectIdRing::Init(isolate); | |
162 ObjectStore::Init(isolate); | 165 ObjectStore::Init(isolate); |
163 | 166 |
164 if (snapshot_buffer == NULL) { | 167 if (snapshot_buffer == NULL) { |
165 const Error& error = Error::Handle(Object::Init(isolate)); | 168 const Error& error = Error::Handle(Object::Init(isolate)); |
166 if (!error.IsNull()) { | 169 if (!error.IsNull()) { |
167 return error.raw(); | 170 return error.raw(); |
168 } | 171 } |
169 } else { | 172 } else { |
170 // Initialize from snapshot (this should replicate the functionality | 173 // Initialize from snapshot (this should replicate the functionality |
171 // of Object::Init(..) in a regular isolate creation path. | 174 // of Object::Init(..) in a regular isolate creation path. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 return predefined_handles_->handles_.AllocateScopedHandle(); | 236 return predefined_handles_->handles_.AllocateScopedHandle(); |
234 } | 237 } |
235 | 238 |
236 | 239 |
237 bool Dart::IsReadOnlyHandle(uword address) { | 240 bool Dart::IsReadOnlyHandle(uword address) { |
238 ASSERT(predefined_handles_ != NULL); | 241 ASSERT(predefined_handles_ != NULL); |
239 return predefined_handles_->handles_.IsValidScopedHandle(address); | 242 return predefined_handles_->handles_.IsValidScopedHandle(address); |
240 } | 243 } |
241 | 244 |
242 } // namespace dart | 245 } // namespace dart |
OLD | NEW |