| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 Object::InitNull(vm_isolate_); | 134 Object::InitNull(vm_isolate_); |
| 135 ObjectStore::Init(vm_isolate_); | 135 ObjectStore::Init(vm_isolate_); |
| 136 TargetCPUFeatures::InitOnce(); | 136 TargetCPUFeatures::InitOnce(); |
| 137 Object::InitOnce(vm_isolate_); | 137 Object::InitOnce(vm_isolate_); |
| 138 ArgumentsDescriptor::InitOnce(); | 138 ArgumentsDescriptor::InitOnce(); |
| 139 StubCode::InitOnce(); | 139 StubCode::InitOnce(); |
| 140 Thread::InitOnceAfterObjectAndStubCode(); | 140 Thread::InitOnceAfterObjectAndStubCode(); |
| 141 // Now that the needed stub has been generated, set the stack limit. | 141 // Now that the needed stub has been generated, set the stack limit. |
| 142 vm_isolate_->InitializeStackLimit(); | 142 vm_isolate_->InitializeStackLimit(); |
| 143 if (vm_isolate_snapshot != NULL) { | 143 if (vm_isolate_snapshot != NULL) { |
| 144 if (instructions_snapshot != NULL) { |
| 145 vm_isolate_->SetupInstructionsSnapshotPage(instructions_snapshot); |
| 146 } |
| 144 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); | 147 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); |
| 145 if (snapshot == NULL) { | 148 if (snapshot == NULL) { |
| 146 return "Invalid vm isolate snapshot seen."; | 149 return "Invalid vm isolate snapshot seen."; |
| 147 } | 150 } |
| 148 ASSERT(snapshot->kind() == Snapshot::kFull); | 151 ASSERT(snapshot->kind() == Snapshot::kFull); |
| 149 VmIsolateSnapshotReader reader(snapshot->content(), | 152 VmIsolateSnapshotReader reader(snapshot->content(), |
| 150 snapshot->length(), | 153 snapshot->length(), |
| 151 instructions_snapshot, | 154 instructions_snapshot, |
| 152 T); | 155 T); |
| 153 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); | 156 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 301 } |
| 299 } else { | 302 } else { |
| 300 // Populate the isolate's symbol table with all symbols from the | 303 // Populate the isolate's symbol table with all symbols from the |
| 301 // VM isolate. We do this so that when we generate a full snapshot | 304 // VM isolate. We do this so that when we generate a full snapshot |
| 302 // for the isolate we have a unified symbol table that we can then | 305 // for the isolate we have a unified symbol table that we can then |
| 303 // read into the VM isolate. | 306 // read into the VM isolate. |
| 304 Symbols::AddPredefinedSymbolsToIsolate(); | 307 Symbols::AddPredefinedSymbolsToIsolate(); |
| 305 } | 308 } |
| 306 | 309 |
| 307 Object::VerifyBuiltinVtables(); | 310 Object::VerifyBuiltinVtables(); |
| 311 #if defined(DEBUG) |
| 312 I->heap()->Verify(kForbidMarked); |
| 313 #endif |
| 308 | 314 |
| 309 { | 315 { |
| 310 TimelineDurationScope tds(I, I->GetIsolateStream(), "StubCode::Init"); | 316 TimelineDurationScope tds(I, I->GetIsolateStream(), "StubCode::Init"); |
| 311 StubCode::Init(I); | 317 StubCode::Init(I); |
| 312 } | 318 } |
| 313 | 319 |
| 314 MegamorphicCacheTable::InitMissHandler(I); | 320 if (Object::IsRunningPrecompiledCode()) { |
| 321 MegamorphicCacheTable::InitMissHandler(I); |
| 322 } |
| 315 if (snapshot_buffer == NULL) { | 323 if (snapshot_buffer == NULL) { |
| 316 if (!I->object_store()->PreallocateObjects()) { | 324 if (!I->object_store()->PreallocateObjects()) { |
| 317 return I->object_store()->sticky_error(); | 325 return I->object_store()->sticky_error(); |
| 318 } | 326 } |
| 319 } | 327 } |
| 320 | 328 |
| 321 I->heap()->EnableGrowthControl(); | 329 I->heap()->EnableGrowthControl(); |
| 322 I->set_init_callback_data(data); | 330 I->set_init_callback_data(data); |
| 323 Api::SetupAcquiredError(I); | 331 Api::SetupAcquiredError(I); |
| 324 if (FLAG_print_class_table) { | 332 if (FLAG_print_class_table) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 return predefined_handles_->handles_.IsValidScopedHandle(address); | 389 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 382 } | 390 } |
| 383 | 391 |
| 384 | 392 |
| 385 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 393 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 386 ASSERT(predefined_handles_ != NULL); | 394 ASSERT(predefined_handles_ != NULL); |
| 387 return predefined_handles_->api_handles_.IsValidHandle(handle); | 395 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 388 } | 396 } |
| 389 | 397 |
| 390 } // namespace dart | 398 } // namespace dart |
| OLD | NEW |