| Index: runtime/vm/raw_object_snapshot.cc
|
| diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
|
| index 152c4b0d8b3f583cf840c0329c33e12c72b09059..b48f74eefe1fc8e15af017f6e27cc1c09f7d11c2 100644
|
| --- a/runtime/vm/raw_object_snapshot.cc
|
| +++ b/runtime/vm/raw_object_snapshot.cc
|
| @@ -32,7 +32,7 @@ RawClass* Class::ReadFrom(SnapshotReader* reader,
|
| if ((kind == Snapshot::kFull) ||
|
| (kind == Snapshot::kScript && !RawObject::IsCreatedFromSnapshot(tags))) {
|
| // Read in the base information.
|
| - int32_t class_id = reader->Read<int32_t>();
|
| + cid_t class_id = reader->Read<cid_t>();
|
|
|
| // Allocate class object of specified kind.
|
| if (kind == Snapshot::kFull) {
|
| @@ -96,8 +96,8 @@ void RawClass::WriteTo(SnapshotWriter* writer,
|
|
|
| // Write out all the non object pointer fields.
|
| // NOTE: cpp_vtable_ is not written.
|
| - int32_t class_id = ptr()->id_;
|
| - writer->Write<int32_t>(class_id);
|
| + cid_t class_id = ptr()->id_;
|
| + writer->Write<cid_t>(class_id);
|
| if (!RawObject::IsInternalVMdefinedClassId(class_id)) {
|
| // We don't write the instance size of VM defined classes as they
|
| // are already setup during initialization as part of pre populating
|
| @@ -106,8 +106,8 @@ void RawClass::WriteTo(SnapshotWriter* writer,
|
| writer->Write<int32_t>(ptr()->next_field_offset_in_words_);
|
| }
|
| writer->Write<int32_t>(ptr()->type_arguments_field_offset_in_words_);
|
| - writer->Write<int16_t>(ptr()->num_type_arguments_);
|
| - writer->Write<int16_t>(ptr()->num_own_type_arguments_);
|
| + writer->Write<uint16_t>(ptr()->num_type_arguments_);
|
| + writer->Write<uint16_t>(ptr()->num_own_type_arguments_);
|
| writer->Write<uint16_t>(ptr()->num_native_fields_);
|
| writer->Write<int32_t>(ptr()->token_pos_);
|
| writer->Write<uint16_t>(ptr()->state_bits_);
|
| @@ -332,8 +332,8 @@ RawTypeParameter* TypeParameter::ReadFrom(SnapshotReader* reader,
|
| type_parameter.set_tags(tags);
|
|
|
| // Set all non object fields.
|
| - type_parameter.set_index(reader->Read<int32_t>());
|
| type_parameter.set_token_pos(reader->Read<int32_t>());
|
| + type_parameter.set_index(reader->Read<int16_t>());
|
| type_parameter.set_type_state(reader->Read<int8_t>());
|
|
|
| // Set all the object fields.
|
| @@ -367,8 +367,8 @@ void RawTypeParameter::WriteTo(SnapshotWriter* writer,
|
| writer->WriteTags(writer->GetObjectTags(this));
|
|
|
| // Write out all the non object pointer fields.
|
| - writer->Write<int32_t>(ptr()->index_);
|
| writer->Write<int32_t>(ptr()->token_pos_);
|
| + writer->Write<int16_t>(ptr()->index_);
|
| writer->Write<int8_t>(ptr()->type_state_);
|
|
|
| // Write out all the object pointer fields.
|
| @@ -1039,19 +1039,19 @@ RawLibrary* Library::ReadFrom(SnapshotReader* reader,
|
|
|
| // Set all non object fields.
|
| library.StoreNonPointer(&library.raw_ptr()->index_,
|
| - reader->Read<int32_t>());
|
| + reader->Read<cid_t>());
|
| library.StoreNonPointer(&library.raw_ptr()->num_imports_,
|
| - reader->Read<int32_t>());
|
| + reader->Read<uint16_t>());
|
| library.StoreNonPointer(&library.raw_ptr()->num_anonymous_,
|
| - reader->Read<int32_t>());
|
| + reader->Read<uint16_t>());
|
| + library.StoreNonPointer(&library.raw_ptr()->load_state_,
|
| + reader->Read<int8_t>());
|
| library.StoreNonPointer(&library.raw_ptr()->corelib_imported_,
|
| reader->Read<bool>());
|
| library.StoreNonPointer(&library.raw_ptr()->is_dart_scheme_,
|
| reader->Read<bool>());
|
| library.StoreNonPointer(&library.raw_ptr()->debuggable_,
|
| reader->Read<bool>());
|
| - library.StoreNonPointer(&library.raw_ptr()->load_state_,
|
| - reader->Read<int8_t>());
|
| // The native resolver is not serialized.
|
| Dart_NativeEntryResolver resolver =
|
| reader->Read<Dart_NativeEntryResolver>();
|
| @@ -1102,13 +1102,13 @@ void RawLibrary::WriteTo(SnapshotWriter* writer,
|
| writer->WriteObjectImpl(ptr()->url_);
|
| } else {
|
| // Write out all non object fields.
|
| - writer->Write<int32_t>(ptr()->index_);
|
| - writer->Write<int32_t>(ptr()->num_imports_);
|
| - writer->Write<int32_t>(ptr()->num_anonymous_);
|
| + writer->Write<cid_t>(ptr()->index_);
|
| + writer->Write<uint16_t>(ptr()->num_imports_);
|
| + writer->Write<uint16_t>(ptr()->num_anonymous_);
|
| + writer->Write<int8_t>(ptr()->load_state_);
|
| writer->Write<bool>(ptr()->corelib_imported_);
|
| writer->Write<bool>(ptr()->is_dart_scheme_);
|
| writer->Write<bool>(ptr()->debuggable_);
|
| - writer->Write<int8_t>(ptr()->load_state_);
|
| // We do not serialize the native resolver over, this needs to be explicitly
|
| // set after deserialization.
|
| writer->Write<Dart_NativeEntryResolver>(NULL);
|
| @@ -1145,7 +1145,7 @@ RawLibraryPrefix* LibraryPrefix::ReadFrom(SnapshotReader* reader,
|
|
|
| // Set all non object fields.
|
| prefix.StoreNonPointer(&prefix.raw_ptr()->num_imports_,
|
| - reader->Read<int32_t>());
|
| + reader->Read<int16_t>());
|
| prefix.StoreNonPointer(&prefix.raw_ptr()->is_deferred_load_,
|
| reader->Read<bool>());
|
| prefix.StoreNonPointer(&prefix.raw_ptr()->is_loaded_, reader->Read<bool>());
|
| @@ -1180,7 +1180,7 @@ void RawLibraryPrefix::WriteTo(SnapshotWriter* writer,
|
| writer->WriteTags(writer->GetObjectTags(this));
|
|
|
| // Write out all non object fields.
|
| - writer->Write<int32_t>(ptr()->num_imports_);
|
| + writer->Write<int16_t>(ptr()->num_imports_);
|
| writer->Write<bool>(ptr()->is_deferred_load_);
|
| writer->Write<bool>(ptr()->is_loaded_);
|
|
|
|
|