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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 153 |
153 | 154 |
154 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { | 155 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { |
155 // Initialize the new isolate. | 156 // Initialize the new isolate. |
156 TIMERSCOPE(time_isolate_initialization); | 157 TIMERSCOPE(time_isolate_initialization); |
157 Isolate* isolate = Isolate::Current(); | 158 Isolate* isolate = Isolate::Current(); |
158 ASSERT(isolate != NULL); | 159 ASSERT(isolate != NULL); |
159 StackZone zone(isolate); | 160 StackZone zone(isolate); |
160 HandleScope handle_scope(isolate); | 161 HandleScope handle_scope(isolate); |
161 Heap::Init(isolate); | 162 Heap::Init(isolate); |
| 163 ObjectIdRing::Init(isolate); |
162 ObjectStore::Init(isolate); | 164 ObjectStore::Init(isolate); |
163 | 165 |
164 if (snapshot_buffer == NULL) { | 166 if (snapshot_buffer == NULL) { |
165 const Error& error = Error::Handle(Object::Init(isolate)); | 167 const Error& error = Error::Handle(Object::Init(isolate)); |
166 if (!error.IsNull()) { | 168 if (!error.IsNull()) { |
167 return error.raw(); | 169 return error.raw(); |
168 } | 170 } |
169 } else { | 171 } else { |
170 // Initialize from snapshot (this should replicate the functionality | 172 // Initialize from snapshot (this should replicate the functionality |
171 // of Object::Init(..) in a regular isolate creation path. | 173 // 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(); | 235 return predefined_handles_->handles_.AllocateScopedHandle(); |
234 } | 236 } |
235 | 237 |
236 | 238 |
237 bool Dart::IsReadOnlyHandle(uword address) { | 239 bool Dart::IsReadOnlyHandle(uword address) { |
238 ASSERT(predefined_handles_ != NULL); | 240 ASSERT(predefined_handles_ != NULL); |
239 return predefined_handles_->handles_.IsValidScopedHandle(address); | 241 return predefined_handles_->handles_.IsValidScopedHandle(address); |
240 } | 242 } |
241 | 243 |
242 } // namespace dart | 244 } // namespace dart |
OLD | NEW |