| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 219 } |
| 220 ASSERT(Snapshot::IsFull(snapshot->kind())); | 220 ASSERT(Snapshot::IsFull(snapshot->kind())); |
| 221 VmIsolateSnapshotReader reader(snapshot->kind(), | 221 VmIsolateSnapshotReader reader(snapshot->kind(), |
| 222 snapshot->content(), | 222 snapshot->content(), |
| 223 snapshot->length(), | 223 snapshot->length(), |
| 224 instructions_snapshot, | 224 instructions_snapshot, |
| 225 data_snapshot, | 225 data_snapshot, |
| 226 T); | 226 T); |
| 227 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); | 227 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); |
| 228 if (!error.IsNull()) { | 228 if (!error.IsNull()) { |
| 229 return error.ToCString(); | 229 return error.ToErrorCString(); |
| 230 } | 230 } |
| 231 NOT_IN_PRODUCT(if (tds.enabled()) { | 231 NOT_IN_PRODUCT(if (tds.enabled()) { |
| 232 tds.SetNumArguments(2); | 232 tds.SetNumArguments(2); |
| 233 tds.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length()); | 233 tds.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length()); |
| 234 tds.FormatArgument(1, "heapSize", "%" Pd64, | 234 tds.FormatArgument(1, "heapSize", "%" Pd64, |
| 235 vm_isolate_->heap()->UsedInWords(Heap::kOld) * | 235 vm_isolate_->heap()->UsedInWords(Heap::kOld) * |
| 236 kWordSize); | 236 kWordSize); |
| 237 }); | 237 }); |
| 238 if (FLAG_trace_isolates) { | 238 if (FLAG_trace_isolates) { |
| 239 OS::Print("Size of vm isolate snapshot = %" Pd "\n", | 239 OS::Print("Size of vm isolate snapshot = %" Pd "\n", |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 NOT_IN_PRODUCT(if (tds.enabled()) { | 503 NOT_IN_PRODUCT(if (tds.enabled()) { |
| 504 tds.SetNumArguments(2); | 504 tds.SetNumArguments(2); |
| 505 tds.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length()); | 505 tds.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length()); |
| 506 tds.FormatArgument(1, "heapSize", "%" Pd64, | 506 tds.FormatArgument(1, "heapSize", "%" Pd64, |
| 507 I->heap()->UsedInWords(Heap::kOld) * kWordSize); | 507 I->heap()->UsedInWords(Heap::kOld) * kWordSize); |
| 508 }); | 508 }); |
| 509 if (FLAG_trace_isolates) { | 509 if (FLAG_trace_isolates) { |
| 510 I->heap()->PrintSizes(); | 510 I->heap()->PrintSizes(); |
| 511 MegamorphicCacheTable::PrintSizes(I); | 511 MegamorphicCacheTable::PrintSizes(I); |
| 512 } | 512 } |
| 513 } else { | |
| 514 // Populate the isolate's symbol table with all symbols from the | |
| 515 // VM isolate. We do this so that when we generate a full snapshot | |
| 516 // for the isolate we have a unified symbol table that we can then | |
| 517 // read into the VM isolate. | |
| 518 Symbols::AddPredefinedSymbolsToIsolate(); | |
| 519 } | 513 } |
| 520 | 514 |
| 521 Object::VerifyBuiltinVtables(); | 515 Object::VerifyBuiltinVtables(); |
| 522 DEBUG_ONLY(I->heap()->Verify(kForbidMarked)); | 516 DEBUG_ONLY(I->heap()->Verify(kForbidMarked)); |
| 523 | 517 |
| 524 { | 518 { |
| 525 NOT_IN_PRODUCT(TimelineDurationScope tds(T, | 519 NOT_IN_PRODUCT(TimelineDurationScope tds(T, |
| 526 Timeline::GetIsolateStream(), "StubCode::Init")); | 520 Timeline::GetIsolateStream(), "StubCode::Init")); |
| 527 StubCode::Init(I); | 521 StubCode::Init(I); |
| 528 } | 522 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 return predefined_handles_->handles_.IsValidScopedHandle(address); | 627 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 634 } | 628 } |
| 635 | 629 |
| 636 | 630 |
| 637 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 631 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 638 ASSERT(predefined_handles_ != NULL); | 632 ASSERT(predefined_handles_ != NULL); |
| 639 return predefined_handles_->api_handles_.IsValidHandle(handle); | 633 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 640 } | 634 } |
| 641 | 635 |
| 642 } // namespace dart | 636 } // namespace dart |
| OLD | NEW |