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/cpu.h" |
8 #include "vm/dart_api_state.h" | 9 #include "vm/dart_api_state.h" |
9 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
10 #include "vm/flags.h" | 11 #include "vm/flags.h" |
11 #include "vm/freelist.h" | 12 #include "vm/freelist.h" |
12 #include "vm/handles.h" | 13 #include "vm/handles.h" |
13 #include "vm/heap.h" | 14 #include "vm/heap.h" |
14 #include "vm/isolate.h" | 15 #include "vm/isolate.h" |
15 #include "vm/object.h" | 16 #include "vm/object.h" |
16 #include "vm/object_store.h" | 17 #include "vm/object_store.h" |
17 #include "vm/object_id_ring.h" | 18 #include "vm/object_id_ring.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 StackZone zone(vm_isolate_); | 116 StackZone zone(vm_isolate_); |
116 HandleScope handle_scope(vm_isolate_); | 117 HandleScope handle_scope(vm_isolate_); |
117 Heap::Init(vm_isolate_); | 118 Heap::Init(vm_isolate_); |
118 ObjectStore::Init(vm_isolate_); | 119 ObjectStore::Init(vm_isolate_); |
119 Object::InitOnce(); | 120 Object::InitOnce(); |
120 ArgumentsDescriptor::InitOnce(); | 121 ArgumentsDescriptor::InitOnce(); |
121 StubCode::InitOnce(); | 122 StubCode::InitOnce(); |
122 Symbols::InitOnce(vm_isolate_); | 123 Symbols::InitOnce(vm_isolate_); |
123 Scanner::InitOnce(); | 124 Scanner::InitOnce(); |
124 Object::CreateInternalMetaData(); | 125 Object::CreateInternalMetaData(); |
125 CPUFeatures::InitOnce(); | 126 TargetCPUFeatures::InitOnce(); |
126 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 127 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
127 // Dart VM requires at least SSE2. | 128 // Dart VM requires at least SSE2. |
128 if (!CPUFeatures::sse2_supported()) { | 129 if (!TargetCPUFeatures::sse2_supported()) { |
129 return "SSE2 is required."; | 130 return "SSE2 is required."; |
130 } | 131 } |
131 #endif | 132 #endif |
132 PremarkingVisitor premarker(vm_isolate_); | 133 PremarkingVisitor premarker(vm_isolate_); |
133 vm_isolate_->heap()->IterateOldObjects(&premarker); | 134 vm_isolate_->heap()->IterateOldObjects(&premarker); |
134 vm_isolate_->heap()->WriteProtect(true); | 135 vm_isolate_->heap()->WriteProtect(true); |
135 } | 136 } |
136 // There is a planned and known asymmetry here: We enter one scope for the VM | 137 // There is a planned and known asymmetry here: We enter one scope for the VM |
137 // isolate so that we can allocate the "persistent" scoped handles for the | 138 // isolate so that we can allocate the "persistent" scoped handles for the |
138 // predefined API values (such as Dart_True, Dart_False and Dart_Null). | 139 // predefined API values (such as Dart_True, Dart_False and Dart_Null). |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 return predefined_handles_->handles_.AllocateScopedHandle(); | 272 return predefined_handles_->handles_.AllocateScopedHandle(); |
272 } | 273 } |
273 | 274 |
274 | 275 |
275 bool Dart::IsReadOnlyHandle(uword address) { | 276 bool Dart::IsReadOnlyHandle(uword address) { |
276 ASSERT(predefined_handles_ != NULL); | 277 ASSERT(predefined_handles_ != NULL); |
277 return predefined_handles_->handles_.IsValidScopedHandle(address); | 278 return predefined_handles_->handles_.IsValidScopedHandle(address); |
278 } | 279 } |
279 | 280 |
280 } // namespace dart | 281 } // namespace dart |
OLD | NEW |