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" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 Scanner::InitOnce(); | 122 Scanner::InitOnce(); |
123 Object::CreateInternalMetaData(); | 123 Object::CreateInternalMetaData(); |
124 CPUFeatures::InitOnce(); | 124 CPUFeatures::InitOnce(); |
125 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 125 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
126 // Dart VM requires at least SSE2. | 126 // Dart VM requires at least SSE2. |
127 if (!CPUFeatures::sse2_supported()) { | 127 if (!CPUFeatures::sse2_supported()) { |
128 return "SSE2 is required."; | 128 return "SSE2 is required."; |
129 } | 129 } |
130 #endif | 130 #endif |
131 PremarkingVisitor premarker(vm_isolate_); | 131 PremarkingVisitor premarker(vm_isolate_); |
| 132 vm_isolate_->heap()->WriteProtect(false); |
132 vm_isolate_->heap()->IterateOldObjects(&premarker); | 133 vm_isolate_->heap()->IterateOldObjects(&premarker); |
133 vm_isolate_->heap()->WriteProtect(true); | 134 vm_isolate_->heap()->WriteProtect(true); |
134 } | 135 } |
135 // There is a planned and known asymmetry here: We enter one scope for the VM | 136 // There is a planned and known asymmetry here: We enter one scope for the VM |
136 // isolate so that we can allocate the "persistent" scoped handles for the | 137 // isolate so that we can allocate the "persistent" scoped handles for the |
137 // predefined API values (such as Dart_True, Dart_False and Dart_Null). | 138 // predefined API values (such as Dart_True, Dart_False and Dart_Null). |
138 Dart_EnterScope(); | 139 Dart_EnterScope(); |
139 Api::InitHandles(); | 140 Api::InitHandles(); |
140 | 141 |
141 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. | 142 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 return predefined_handles_->handles_.AllocateScopedHandle(); | 271 return predefined_handles_->handles_.AllocateScopedHandle(); |
271 } | 272 } |
272 | 273 |
273 | 274 |
274 bool Dart::IsReadOnlyHandle(uword address) { | 275 bool Dart::IsReadOnlyHandle(uword address) { |
275 ASSERT(predefined_handles_ != NULL); | 276 ASSERT(predefined_handles_ != NULL); |
276 return predefined_handles_->handles_.IsValidScopedHandle(address); | 277 return predefined_handles_->handles_.IsValidScopedHandle(address); |
277 } | 278 } |
278 | 279 |
279 } // namespace dart | 280 } // namespace dart |
OLD | NEW |