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