| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 ObjectStore::Init(vm_isolate_); | 154 ObjectStore::Init(vm_isolate_); |
| 155 TargetCPUFeatures::InitOnce(); | 155 TargetCPUFeatures::InitOnce(); |
| 156 Object::InitOnce(vm_isolate_); | 156 Object::InitOnce(vm_isolate_); |
| 157 ArgumentsDescriptor::InitOnce(); | 157 ArgumentsDescriptor::InitOnce(); |
| 158 ICData::InitOnce(); | 158 ICData::InitOnce(); |
| 159 // When precompiled the stub code is initialized from the snapshot. | 159 // When precompiled the stub code is initialized from the snapshot. |
| 160 if (!precompiled) { | 160 if (!precompiled) { |
| 161 StubCode::InitOnce(); | 161 StubCode::InitOnce(); |
| 162 } | 162 } |
| 163 if (vm_isolate_snapshot != NULL) { | 163 if (vm_isolate_snapshot != NULL) { |
| 164 NOT_IN_PRODUCT(TimelineDurationScope tds(Timeline::GetVMStream(), |
| 165 "VMIsolateSnapshot")); |
| 164 if (data_snapshot != NULL) { | 166 if (data_snapshot != NULL) { |
| 165 vm_isolate_->SetupDataSnapshotPage(data_snapshot); | 167 vm_isolate_->SetupDataSnapshotPage(data_snapshot); |
| 166 } | 168 } |
| 167 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); | 169 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); |
| 168 if (snapshot == NULL) { | 170 if (snapshot == NULL) { |
| 169 return "Invalid vm isolate snapshot seen."; | 171 return "Invalid vm isolate snapshot seen."; |
| 170 } | 172 } |
| 171 ASSERT(snapshot->kind() == Snapshot::kFull); | 173 ASSERT(snapshot->kind() == Snapshot::kFull); |
| 172 VmIsolateSnapshotReader reader(snapshot->content(), | 174 VmIsolateSnapshotReader reader(snapshot->content(), |
| 173 snapshot->length(), | 175 snapshot->length(), |
| (...skipping 21 matching lines...) Expand all Loading... |
| 195 // We need to initialize the constants here for the vm isolate thread due to | 197 // We need to initialize the constants here for the vm isolate thread due to |
| 196 // bootstrapping issues. | 198 // bootstrapping issues. |
| 197 T->InitVMConstants(); | 199 T->InitVMConstants(); |
| 198 Scanner::InitOnce(); | 200 Scanner::InitOnce(); |
| 199 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 201 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
| 200 // Dart VM requires at least SSE2. | 202 // Dart VM requires at least SSE2. |
| 201 if (!TargetCPUFeatures::sse2_supported()) { | 203 if (!TargetCPUFeatures::sse2_supported()) { |
| 202 return "SSE2 is required."; | 204 return "SSE2 is required."; |
| 203 } | 205 } |
| 204 #endif | 206 #endif |
| 205 Object::FinalizeVMIsolate(vm_isolate_); | 207 { |
| 208 NOT_IN_PRODUCT(TimelineDurationScope tds(Timeline::GetVMStream(), |
| 209 "FinalizeVMIsolate")); |
| 210 Object::FinalizeVMIsolate(vm_isolate_); |
| 211 } |
| 206 #if defined(DEBUG) | 212 #if defined(DEBUG) |
| 207 vm_isolate_->heap()->Verify(kRequireMarked); | 213 vm_isolate_->heap()->Verify(kRequireMarked); |
| 208 #endif | 214 #endif |
| 209 } | 215 } |
| 210 // Allocate the "persistent" scoped handles for the predefined API | 216 // Allocate the "persistent" scoped handles for the predefined API |
| 211 // values (such as Dart_True, Dart_False and Dart_Null). | 217 // values (such as Dart_True, Dart_False and Dart_Null). |
| 212 Api::InitHandles(); | 218 Api::InitHandles(); |
| 213 | 219 |
| 214 Thread::ExitIsolate(); // Unregister the VM isolate from this thread. | 220 Thread::ExitIsolate(); // Unregister the VM isolate from this thread. |
| 215 Isolate::SetCreateCallback(create); | 221 Isolate::SetCreateCallback(create); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 return predefined_handles_->handles_.IsValidScopedHandle(address); | 571 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 566 } | 572 } |
| 567 | 573 |
| 568 | 574 |
| 569 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 575 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 570 ASSERT(predefined_handles_ != NULL); | 576 ASSERT(predefined_handles_ != NULL); |
| 571 return predefined_handles_->api_handles_.IsValidHandle(handle); | 577 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 572 } | 578 } |
| 573 | 579 |
| 574 } // namespace dart | 580 } // namespace dart |
| OLD | NEW |