| 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 4934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4945 Snapshot::Kind kind, | 4945 Snapshot::Kind kind, |
| 4946 const uint8_t* buffer, | 4946 const uint8_t* buffer, |
| 4947 intptr_t size, | 4947 intptr_t size, |
| 4948 const uint8_t* instructions_buffer, | 4948 const uint8_t* instructions_buffer, |
| 4949 const uint8_t* data_buffer) | 4949 const uint8_t* data_buffer) |
| 4950 : StackResource(thread), | 4950 : StackResource(thread), |
| 4951 heap_(thread->isolate()->heap()), | 4951 heap_(thread->isolate()->heap()), |
| 4952 zone_(thread->zone()), | 4952 zone_(thread->zone()), |
| 4953 kind_(kind), | 4953 kind_(kind), |
| 4954 stream_(buffer, size), | 4954 stream_(buffer, size), |
| 4955 instructions_reader_(NULL), | 4955 image_reader_(NULL), |
| 4956 refs_(NULL), | 4956 refs_(NULL), |
| 4957 next_ref_index_(1), | 4957 next_ref_index_(1), |
| 4958 clusters_(NULL) { | 4958 clusters_(NULL) { |
| 4959 if (Snapshot::IncludesCode(kind)) { | 4959 if (Snapshot::IncludesCode(kind)) { |
| 4960 ASSERT(instructions_buffer != NULL); | 4960 ASSERT(instructions_buffer != NULL); |
| 4961 } | 4961 } |
| 4962 if (instructions_buffer != NULL) { | 4962 if (instructions_buffer != NULL) { |
| 4963 instructions_reader_ = | 4963 image_reader_ = new (zone_) ImageReader(instructions_buffer, data_buffer); |
| 4964 new (zone_) InstructionsReader(instructions_buffer, data_buffer); | |
| 4965 } | 4964 } |
| 4966 } | 4965 } |
| 4967 | 4966 |
| 4968 | 4967 |
| 4969 Deserializer::~Deserializer() { | 4968 Deserializer::~Deserializer() { |
| 4970 delete[] clusters_; | 4969 delete[] clusters_; |
| 4971 } | 4970 } |
| 4972 | 4971 |
| 4973 | 4972 |
| 4974 DeserializationCluster* Deserializer::ReadCluster() { | 4973 DeserializationCluster* Deserializer::ReadCluster() { |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5636 thread_->isolate()->SetupImagePage(data_buffer_, | 5635 thread_->isolate()->SetupImagePage(data_buffer_, |
| 5637 /* is_executable */ false); | 5636 /* is_executable */ false); |
| 5638 } | 5637 } |
| 5639 | 5638 |
| 5640 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); | 5639 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); |
| 5641 | 5640 |
| 5642 return ApiError::null(); | 5641 return ApiError::null(); |
| 5643 } | 5642 } |
| 5644 | 5643 |
| 5645 } // namespace dart | 5644 } // namespace dart |
| OLD | NEW |