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 2765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2776 intptr_t count = objects_.length(); | 2776 intptr_t count = objects_.length(); |
2777 for (intptr_t i = 0; i < count; i++) { | 2777 for (intptr_t i = 0; i < count; i++) { |
2778 RawLibraryPrefix* prefix = objects_[i]; | 2778 RawLibraryPrefix* prefix = objects_[i]; |
2779 RawObject** from = prefix->from(); | 2779 RawObject** from = prefix->from(); |
2780 RawObject** to = prefix->to(); | 2780 RawObject** to = prefix->to(); |
2781 for (RawObject** p = from; p <= to; p++) { | 2781 for (RawObject** p = from; p <= to; p++) { |
2782 s->WriteRef(*p); | 2782 s->WriteRef(*p); |
2783 } | 2783 } |
2784 s->Write<uint16_t>(prefix->ptr()->num_imports_); | 2784 s->Write<uint16_t>(prefix->ptr()->num_imports_); |
2785 s->Write<bool>(prefix->ptr()->is_deferred_load_); | 2785 s->Write<bool>(prefix->ptr()->is_deferred_load_); |
2786 s->Write<bool>(prefix->ptr()->is_loaded_); | |
2787 } | 2786 } |
2788 } | 2787 } |
2789 | 2788 |
2790 private: | 2789 private: |
2791 GrowableArray<RawLibraryPrefix*> objects_; | 2790 GrowableArray<RawLibraryPrefix*> objects_; |
2792 }; | 2791 }; |
2793 #endif // !DART_PRECOMPILED_RUNTIME | 2792 #endif // !DART_PRECOMPILED_RUNTIME |
2794 | 2793 |
2795 | 2794 |
2796 class LibraryPrefixDeserializationCluster : public DeserializationCluster { | 2795 class LibraryPrefixDeserializationCluster : public DeserializationCluster { |
(...skipping 21 matching lines...) Expand all Loading... |
2818 Deserializer::InitializeHeader(prefix, kLibraryPrefixCid, | 2817 Deserializer::InitializeHeader(prefix, kLibraryPrefixCid, |
2819 LibraryPrefix::InstanceSize(), | 2818 LibraryPrefix::InstanceSize(), |
2820 is_vm_object); | 2819 is_vm_object); |
2821 RawObject** from = prefix->from(); | 2820 RawObject** from = prefix->from(); |
2822 RawObject** to = prefix->to(); | 2821 RawObject** to = prefix->to(); |
2823 for (RawObject** p = from; p <= to; p++) { | 2822 for (RawObject** p = from; p <= to; p++) { |
2824 *p = d->ReadRef(); | 2823 *p = d->ReadRef(); |
2825 } | 2824 } |
2826 prefix->ptr()->num_imports_ = d->Read<uint16_t>(); | 2825 prefix->ptr()->num_imports_ = d->Read<uint16_t>(); |
2827 prefix->ptr()->is_deferred_load_ = d->Read<bool>(); | 2826 prefix->ptr()->is_deferred_load_ = d->Read<bool>(); |
2828 prefix->ptr()->is_loaded_ = d->Read<bool>(); | 2827 prefix->ptr()->is_loaded_ = false; |
2829 } | 2828 } |
2830 } | 2829 } |
2831 }; | 2830 }; |
2832 | 2831 |
2833 | 2832 |
2834 #if !defined(DART_PRECOMPILED_RUNTIME) | 2833 #if !defined(DART_PRECOMPILED_RUNTIME) |
2835 class TypeSerializationCluster : public SerializationCluster { | 2834 class TypeSerializationCluster : public SerializationCluster { |
2836 public: | 2835 public: |
2837 TypeSerializationCluster() { } | 2836 TypeSerializationCluster() { } |
2838 virtual ~TypeSerializationCluster() { } | 2837 virtual ~TypeSerializationCluster() { } |
(...skipping 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5339 | 5338 |
5340 deserializer.ReadVMSnapshot(); | 5339 deserializer.ReadVMSnapshot(); |
5341 | 5340 |
5342 Dart::set_instructions_snapshot_buffer(instructions_buffer_); | 5341 Dart::set_instructions_snapshot_buffer(instructions_buffer_); |
5343 Dart::set_data_snapshot_buffer(data_buffer_); | 5342 Dart::set_data_snapshot_buffer(data_buffer_); |
5344 | 5343 |
5345 return ApiError::null(); | 5344 return ApiError::null(); |
5346 } | 5345 } |
5347 | 5346 |
5348 } // namespace dart | 5347 } // namespace dart |
OLD | NEW |