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 3171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3182 for (intptr_t i = 0; i < count; i++) { | 3182 for (intptr_t i = 0; i < count; i++) { |
3183 RawTypeParameter* type = objects_[i]; | 3183 RawTypeParameter* type = objects_[i]; |
3184 RawObject** from = type->from(); | 3184 RawObject** from = type->from(); |
3185 RawObject** to = type->to(); | 3185 RawObject** to = type->to(); |
3186 for (RawObject** p = from; p <= to; p++) { | 3186 for (RawObject** p = from; p <= to; p++) { |
3187 s->WriteRef(*p); | 3187 s->WriteRef(*p); |
3188 } | 3188 } |
3189 s->Write<int32_t>(type->ptr()->parameterized_class_id_); | 3189 s->Write<int32_t>(type->ptr()->parameterized_class_id_); |
3190 s->WriteTokenPosition(type->ptr()->token_pos_); | 3190 s->WriteTokenPosition(type->ptr()->token_pos_); |
3191 s->Write<int16_t>(type->ptr()->index_); | 3191 s->Write<int16_t>(type->ptr()->index_); |
3192 s->Write<uint8_t>(type->ptr()->parent_level_); | |
3193 s->Write<int8_t>(type->ptr()->type_state_); | 3192 s->Write<int8_t>(type->ptr()->type_state_); |
3194 } | 3193 } |
3195 } | 3194 } |
3196 | 3195 |
3197 private: | 3196 private: |
3198 GrowableArray<RawTypeParameter*> objects_; | 3197 GrowableArray<RawTypeParameter*> objects_; |
3199 }; | 3198 }; |
3200 #endif // !DART_PRECOMPILED_RUNTIME | 3199 #endif // !DART_PRECOMPILED_RUNTIME |
3201 | 3200 |
3202 | 3201 |
(...skipping 21 matching lines...) Expand all Loading... |
3224 Deserializer::InitializeHeader( | 3223 Deserializer::InitializeHeader( |
3225 type, kTypeParameterCid, TypeParameter::InstanceSize(), is_vm_object); | 3224 type, kTypeParameterCid, TypeParameter::InstanceSize(), is_vm_object); |
3226 RawObject** from = type->from(); | 3225 RawObject** from = type->from(); |
3227 RawObject** to = type->to(); | 3226 RawObject** to = type->to(); |
3228 for (RawObject** p = from; p <= to; p++) { | 3227 for (RawObject** p = from; p <= to; p++) { |
3229 *p = d->ReadRef(); | 3228 *p = d->ReadRef(); |
3230 } | 3229 } |
3231 type->ptr()->parameterized_class_id_ = d->Read<int32_t>(); | 3230 type->ptr()->parameterized_class_id_ = d->Read<int32_t>(); |
3232 type->ptr()->token_pos_ = d->ReadTokenPosition(); | 3231 type->ptr()->token_pos_ = d->ReadTokenPosition(); |
3233 type->ptr()->index_ = d->Read<int16_t>(); | 3232 type->ptr()->index_ = d->Read<int16_t>(); |
3234 type->ptr()->parent_level_ = d->Read<uint8_t>(); | |
3235 type->ptr()->type_state_ = d->Read<int8_t>(); | 3233 type->ptr()->type_state_ = d->Read<int8_t>(); |
3236 } | 3234 } |
3237 } | 3235 } |
3238 }; | 3236 }; |
3239 | 3237 |
3240 | 3238 |
3241 #if !defined(DART_PRECOMPILED_RUNTIME) | 3239 #if !defined(DART_PRECOMPILED_RUNTIME) |
3242 class BoundedTypeSerializationCluster : public SerializationCluster { | 3240 class BoundedTypeSerializationCluster : public SerializationCluster { |
3243 public: | 3241 public: |
3244 BoundedTypeSerializationCluster() {} | 3242 BoundedTypeSerializationCluster() {} |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4748 } | 4746 } |
4749 | 4747 |
4750 | 4748 |
4751 void Serializer::AddVMIsolateBaseObjects() { | 4749 void Serializer::AddVMIsolateBaseObjects() { |
4752 // These objects are always allocated by Object::InitOnce, so they are not | 4750 // These objects are always allocated by Object::InitOnce, so they are not |
4753 // written into the snapshot. | 4751 // written into the snapshot. |
4754 | 4752 |
4755 AddBaseObject(Object::null()); | 4753 AddBaseObject(Object::null()); |
4756 AddBaseObject(Object::sentinel().raw()); | 4754 AddBaseObject(Object::sentinel().raw()); |
4757 AddBaseObject(Object::transition_sentinel().raw()); | 4755 AddBaseObject(Object::transition_sentinel().raw()); |
| 4756 AddBaseObject(Object::empty_type_arguments().raw()); |
4758 AddBaseObject(Object::empty_array().raw()); | 4757 AddBaseObject(Object::empty_array().raw()); |
4759 AddBaseObject(Object::zero_array().raw()); | 4758 AddBaseObject(Object::zero_array().raw()); |
4760 AddBaseObject(Object::dynamic_type().raw()); | 4759 AddBaseObject(Object::dynamic_type().raw()); |
4761 AddBaseObject(Object::void_type().raw()); | 4760 AddBaseObject(Object::void_type().raw()); |
4762 AddBaseObject(Bool::True().raw()); | 4761 AddBaseObject(Bool::True().raw()); |
4763 AddBaseObject(Bool::False().raw()); | 4762 AddBaseObject(Bool::False().raw()); |
4764 AddBaseObject(Object::extractor_parameter_types().raw()); | 4763 AddBaseObject(Object::extractor_parameter_types().raw()); |
4765 AddBaseObject(Object::extractor_parameter_names().raw()); | 4764 AddBaseObject(Object::extractor_parameter_names().raw()); |
4766 AddBaseObject(Object::empty_context().raw()); | 4765 AddBaseObject(Object::empty_context().raw()); |
4767 AddBaseObject(Object::empty_context_scope().raw()); | 4766 AddBaseObject(Object::empty_context_scope().raw()); |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5152 }; | 5151 }; |
5153 | 5152 |
5154 | 5153 |
5155 void Deserializer::AddVMIsolateBaseObjects() { | 5154 void Deserializer::AddVMIsolateBaseObjects() { |
5156 // These objects are always allocated by Object::InitOnce, so they are not | 5155 // These objects are always allocated by Object::InitOnce, so they are not |
5157 // written into the snapshot. | 5156 // written into the snapshot. |
5158 | 5157 |
5159 AddBaseObject(Object::null()); | 5158 AddBaseObject(Object::null()); |
5160 AddBaseObject(Object::sentinel().raw()); | 5159 AddBaseObject(Object::sentinel().raw()); |
5161 AddBaseObject(Object::transition_sentinel().raw()); | 5160 AddBaseObject(Object::transition_sentinel().raw()); |
| 5161 AddBaseObject(Object::empty_type_arguments().raw()); |
5162 AddBaseObject(Object::empty_array().raw()); | 5162 AddBaseObject(Object::empty_array().raw()); |
5163 AddBaseObject(Object::zero_array().raw()); | 5163 AddBaseObject(Object::zero_array().raw()); |
5164 AddBaseObject(Object::dynamic_type().raw()); | 5164 AddBaseObject(Object::dynamic_type().raw()); |
5165 AddBaseObject(Object::void_type().raw()); | 5165 AddBaseObject(Object::void_type().raw()); |
5166 AddBaseObject(Bool::True().raw()); | 5166 AddBaseObject(Bool::True().raw()); |
5167 AddBaseObject(Bool::False().raw()); | 5167 AddBaseObject(Bool::False().raw()); |
5168 AddBaseObject(Object::extractor_parameter_types().raw()); | 5168 AddBaseObject(Object::extractor_parameter_types().raw()); |
5169 AddBaseObject(Object::extractor_parameter_names().raw()); | 5169 AddBaseObject(Object::extractor_parameter_names().raw()); |
5170 AddBaseObject(Object::empty_context().raw()); | 5170 AddBaseObject(Object::empty_context().raw()); |
5171 AddBaseObject(Object::empty_context_scope().raw()); | 5171 AddBaseObject(Object::empty_context_scope().raw()); |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5566 thread_->isolate()->SetupImagePage(data_buffer_, | 5566 thread_->isolate()->SetupImagePage(data_buffer_, |
5567 /* is_executable */ false); | 5567 /* is_executable */ false); |
5568 } | 5568 } |
5569 | 5569 |
5570 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); | 5570 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); |
5571 | 5571 |
5572 return ApiError::null(); | 5572 return ApiError::null(); |
5573 } | 5573 } |
5574 | 5574 |
5575 } // namespace dart | 5575 } // namespace dart |
OLD | NEW |