OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/clustered_snapshot.h" | 5 #include "vm/clustered_snapshot.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 5289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5300 intptr_t num_base_objects; | 5300 intptr_t num_base_objects; |
5301 if (vm_isolate_snapshot_buffer() != NULL) { | 5301 if (vm_isolate_snapshot_buffer() != NULL) { |
5302 num_base_objects = WriteVmIsolateSnapshot(); | 5302 num_base_objects = WriteVmIsolateSnapshot(); |
5303 ASSERT(num_base_objects != 0); | 5303 ASSERT(num_base_objects != 0); |
5304 } else { | 5304 } else { |
5305 num_base_objects = 0; | 5305 num_base_objects = 0; |
5306 } | 5306 } |
5307 | 5307 |
5308 WriteIsolateFullSnapshot(num_base_objects); | 5308 WriteIsolateFullSnapshot(num_base_objects); |
5309 | 5309 |
| 5310 if (FLAG_print_snapshot_sizes) { |
| 5311 OS::Print("VMIsolate(CodeSize): %" Pd "\n", VmIsolateSnapshotSize()); |
| 5312 OS::Print("Isolate(CodeSize): %" Pd "\n", IsolateSnapshotSize()); |
| 5313 } |
| 5314 intptr_t total_size = VmIsolateSnapshotSize() + IsolateSnapshotSize(); |
| 5315 |
5310 if (Snapshot::IncludesCode(kind_)) { | 5316 if (Snapshot::IncludesCode(kind_)) { |
5311 instructions_writer_->Write( | 5317 instructions_writer_->Write( |
5312 *vm_isolate_snapshot_buffer_, vm_isolate_snapshot_size_, | 5318 *vm_isolate_snapshot_buffer_, vm_isolate_snapshot_size_, |
5313 *isolate_snapshot_buffer_, isolate_snapshot_size_); | 5319 *isolate_snapshot_buffer_, isolate_snapshot_size_); |
5314 | 5320 |
5315 OS::Print("VMIsolate(CodeSize): %" Pd "\n", VmIsolateSnapshotSize()); | 5321 if (FLAG_print_snapshot_sizes) { |
5316 OS::Print("Isolate(CodeSize): %" Pd "\n", IsolateSnapshotSize()); | 5322 OS::Print("ReadOnlyData(CodeSize): %" Pd "\n", |
5317 OS::Print("ReadOnlyData(CodeSize): %" Pd "\n", | 5323 instructions_writer_->data_size()); |
5318 instructions_writer_->data_size()); | 5324 OS::Print("Instructions(CodeSize): %" Pd "\n", |
5319 OS::Print("Instructions(CodeSize): %" Pd "\n", | 5325 instructions_writer_->text_size()); |
5320 instructions_writer_->text_size()); | 5326 } |
5321 intptr_t total = VmIsolateSnapshotSize() + IsolateSnapshotSize() + | 5327 total_size += |
5322 instructions_writer_->data_size() + | 5328 instructions_writer_->data_size() + instructions_writer_->text_size(); |
5323 instructions_writer_->text_size(); | 5329 } |
5324 OS::Print("Total(CodeSize): %" Pd "\n", total); | 5330 |
| 5331 if (FLAG_print_snapshot_sizes) { |
| 5332 OS::Print("Total(CodeSize): %" Pd "\n", total_size); |
5325 } | 5333 } |
5326 } | 5334 } |
5327 | 5335 |
5328 | 5336 |
5329 RawApiError* IsolateSnapshotReader::ReadFullSnapshot() { | 5337 RawApiError* IsolateSnapshotReader::ReadFullSnapshot() { |
5330 Deserializer deserializer(thread_, kind_, buffer_, size_, | 5338 Deserializer deserializer(thread_, kind_, buffer_, size_, |
5331 instructions_buffer_, data_buffer_); | 5339 instructions_buffer_, data_buffer_); |
5332 | 5340 |
5333 RawApiError* error = deserializer.VerifyVersionAndFeatures(); | 5341 RawApiError* error = deserializer.VerifyVersionAndFeatures(); |
5334 if (error != ApiError::null()) { | 5342 if (error != ApiError::null()) { |
(...skipping 17 matching lines...) Expand all Loading... |
5352 | 5360 |
5353 deserializer.ReadVMSnapshot(); | 5361 deserializer.ReadVMSnapshot(); |
5354 | 5362 |
5355 Dart::set_instructions_snapshot_buffer(instructions_buffer_); | 5363 Dart::set_instructions_snapshot_buffer(instructions_buffer_); |
5356 Dart::set_data_snapshot_buffer(data_buffer_); | 5364 Dart::set_data_snapshot_buffer(data_buffer_); |
5357 | 5365 |
5358 return ApiError::null(); | 5366 return ApiError::null(); |
5359 } | 5367 } |
5360 | 5368 |
5361 } // namespace dart | 5369 } // namespace dart |
OLD | NEW |