| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 Scanner::InitOnce(); | 127 Scanner::InitOnce(); |
| 128 Object::CreateInternalMetaData(); | 128 Object::CreateInternalMetaData(); |
| 129 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 129 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
| 130 // Dart VM requires at least SSE2. | 130 // Dart VM requires at least SSE2. |
| 131 if (!TargetCPUFeatures::sse2_supported()) { | 131 if (!TargetCPUFeatures::sse2_supported()) { |
| 132 return "SSE2 is required."; | 132 return "SSE2 is required."; |
| 133 } | 133 } |
| 134 #endif | 134 #endif |
| 135 PremarkingVisitor premarker(vm_isolate_); | 135 PremarkingVisitor premarker(vm_isolate_); |
| 136 vm_isolate_->heap()->WriteProtect(false); | 136 vm_isolate_->heap()->WriteProtect(false); |
| 137 ASSERT(vm_isolate_->heap()->UsedInWords(Heap::kNew) == 0); |
| 137 vm_isolate_->heap()->IterateOldObjects(&premarker); | 138 vm_isolate_->heap()->IterateOldObjects(&premarker); |
| 138 vm_isolate_->heap()->WriteProtect(true); | 139 vm_isolate_->heap()->WriteProtect(true); |
| 139 } | 140 } |
| 140 // There is a planned and known asymmetry here: We enter one scope for the VM | 141 // There is a planned and known asymmetry here: We enter one scope for the VM |
| 141 // isolate so that we can allocate the "persistent" scoped handles for the | 142 // isolate so that we can allocate the "persistent" scoped handles for the |
| 142 // predefined API values (such as Dart_True, Dart_False and Dart_Null). | 143 // predefined API values (such as Dart_True, Dart_False and Dart_Null). |
| 143 Dart_EnterScope(); | 144 Dart_EnterScope(); |
| 144 Api::InitHandles(); | 145 Api::InitHandles(); |
| 145 | 146 |
| 146 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. | 147 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 return predefined_handles_->handles_.AllocateScopedHandle(); | 287 return predefined_handles_->handles_.AllocateScopedHandle(); |
| 287 } | 288 } |
| 288 | 289 |
| 289 | 290 |
| 290 bool Dart::IsReadOnlyHandle(uword address) { | 291 bool Dart::IsReadOnlyHandle(uword address) { |
| 291 ASSERT(predefined_handles_ != NULL); | 292 ASSERT(predefined_handles_ != NULL); |
| 292 return predefined_handles_->handles_.IsValidScopedHandle(address); | 293 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 293 } | 294 } |
| 294 | 295 |
| 295 } // namespace dart | 296 } // namespace dart |
| OLD | NEW |