| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 ASSERT(snapshot->kind() == Snapshot::kFull); | 173 ASSERT(snapshot->kind() == Snapshot::kFull); |
| 174 VmIsolateSnapshotReader reader(snapshot->content(), | 174 VmIsolateSnapshotReader reader(snapshot->content(), |
| 175 snapshot->length(), | 175 snapshot->length(), |
| 176 instructions_snapshot, | 176 instructions_snapshot, |
| 177 data_snapshot, | 177 data_snapshot, |
| 178 T); | 178 T); |
| 179 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); | 179 const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot()); |
| 180 if (!error.IsNull()) { | 180 if (!error.IsNull()) { |
| 181 return error.ToCString(); | 181 return error.ToCString(); |
| 182 } | 182 } |
| 183 NOT_IN_PRODUCT(if (tds.enabled()) { |
| 184 tds.SetNumArguments(2); |
| 185 tds.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length()); |
| 186 tds.FormatArgument(1, "heapSize", "%" Pd64, |
| 187 vm_isolate_->heap()->UsedInWords(Heap::kOld) * |
| 188 kWordSize); |
| 189 }); |
| 183 if (FLAG_trace_isolates) { | 190 if (FLAG_trace_isolates) { |
| 184 OS::Print("Size of vm isolate snapshot = %" Pd "\n", | 191 OS::Print("Size of vm isolate snapshot = %" Pd "\n", |
| 185 snapshot->length()); | 192 snapshot->length()); |
| 186 vm_isolate_->heap()->PrintSizes(); | 193 vm_isolate_->heap()->PrintSizes(); |
| 187 MegamorphicCacheTable::PrintSizes(vm_isolate_); | 194 MegamorphicCacheTable::PrintSizes(vm_isolate_); |
| 188 intptr_t size; | 195 intptr_t size; |
| 189 intptr_t capacity; | 196 intptr_t capacity; |
| 190 Symbols::GetStats(vm_isolate_, &size, &capacity); | 197 Symbols::GetStats(vm_isolate_, &size, &capacity); |
| 191 OS::Print("VM Isolate: Number of symbols : %" Pd "\n", size); | 198 OS::Print("VM Isolate: Number of symbols : %" Pd "\n", size); |
| 192 OS::Print("VM Isolate: Symbol table capacity : %" Pd "\n", capacity); | 199 OS::Print("VM Isolate: Symbol table capacity : %" Pd "\n", capacity); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 } | 444 } |
| 438 IsolateSnapshotReader reader(snapshot->content(), | 445 IsolateSnapshotReader reader(snapshot->content(), |
| 439 snapshot->length(), | 446 snapshot->length(), |
| 440 Dart::instructions_snapshot_buffer(), | 447 Dart::instructions_snapshot_buffer(), |
| 441 Dart::data_snapshot_buffer(), | 448 Dart::data_snapshot_buffer(), |
| 442 T); | 449 T); |
| 443 const Error& error = Error::Handle(reader.ReadFullSnapshot()); | 450 const Error& error = Error::Handle(reader.ReadFullSnapshot()); |
| 444 if (!error.IsNull()) { | 451 if (!error.IsNull()) { |
| 445 return error.raw(); | 452 return error.raw(); |
| 446 } | 453 } |
| 454 NOT_IN_PRODUCT(if (tds.enabled()) { |
| 455 tds.SetNumArguments(2); |
| 456 tds.FormatArgument(0, "snapshotSize", "%" Pd, snapshot->length()); |
| 457 tds.FormatArgument(1, "heapSize", "%" Pd64, |
| 458 I->heap()->UsedInWords(Heap::kOld) * kWordSize); |
| 459 }); |
| 447 if (FLAG_trace_isolates) { | 460 if (FLAG_trace_isolates) { |
| 448 I->heap()->PrintSizes(); | 461 I->heap()->PrintSizes(); |
| 449 MegamorphicCacheTable::PrintSizes(I); | 462 MegamorphicCacheTable::PrintSizes(I); |
| 450 } | 463 } |
| 451 } else { | 464 } else { |
| 452 // Populate the isolate's symbol table with all symbols from the | 465 // Populate the isolate's symbol table with all symbols from the |
| 453 // VM isolate. We do this so that when we generate a full snapshot | 466 // VM isolate. We do this so that when we generate a full snapshot |
| 454 // for the isolate we have a unified symbol table that we can then | 467 // for the isolate we have a unified symbol table that we can then |
| 455 // read into the VM isolate. | 468 // read into the VM isolate. |
| 456 Symbols::AddPredefinedSymbolsToIsolate(); | 469 Symbols::AddPredefinedSymbolsToIsolate(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 return predefined_handles_->handles_.IsValidScopedHandle(address); | 584 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 572 } | 585 } |
| 573 | 586 |
| 574 | 587 |
| 575 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 588 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 576 ASSERT(predefined_handles_ != NULL); | 589 ASSERT(predefined_handles_ != NULL); |
| 577 return predefined_handles_->api_handles_.IsValidHandle(handle); | 590 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 578 } | 591 } |
| 579 | 592 |
| 580 } // namespace dart | 593 } // namespace dart |
| OLD | NEW |