| Index: runtime/vm/raw_object_snapshot.cc
|
| ===================================================================
|
| --- runtime/vm/raw_object_snapshot.cc (revision 37230)
|
| +++ runtime/vm/raw_object_snapshot.cc (working copy)
|
| @@ -60,14 +60,14 @@
|
| // Set all non object fields.
|
| if (!RawObject::IsInternalVMdefinedClassId(class_id)) {
|
| // Instance size of a VM defined class is already set up.
|
| - cls.set_instance_size_in_words(reader->ReadIntptrValue());
|
| - cls.set_next_field_offset_in_words(reader->ReadIntptrValue());
|
| + cls.set_instance_size_in_words(reader->Read<int32_t>());
|
| + cls.set_next_field_offset_in_words(reader->Read<int32_t>());
|
| }
|
| - cls.set_type_arguments_field_offset_in_words(reader->ReadIntptrValue());
|
| + cls.set_type_arguments_field_offset_in_words(reader->Read<int32_t>());
|
| cls.set_num_type_arguments(reader->Read<int16_t>());
|
| cls.set_num_own_type_arguments(reader->Read<int16_t>());
|
| cls.set_num_native_fields(reader->Read<uint16_t>());
|
| - cls.set_token_pos(reader->ReadIntptrValue());
|
| + cls.set_token_pos(reader->Read<int32_t>());
|
| cls.set_state_bits(reader->Read<uint16_t>());
|
|
|
| // Set all the object fields.
|
| @@ -101,20 +101,20 @@
|
|
|
| // Write out all the non object pointer fields.
|
| // NOTE: cpp_vtable_ is not written.
|
| - intptr_t class_id = ptr()->id_;
|
| - writer->WriteIntptrValue(class_id);
|
| + int32_t class_id = ptr()->id_;
|
| + writer->Write<int32_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
|
| // the class table.
|
| - writer->WriteIntptrValue(ptr()->instance_size_in_words_);
|
| - writer->WriteIntptrValue(ptr()->next_field_offset_in_words_);
|
| + writer->Write<int32_t>(ptr()->instance_size_in_words_);
|
| + writer->Write<int32_t>(ptr()->next_field_offset_in_words_);
|
| }
|
| - writer->WriteIntptrValue(ptr()->type_arguments_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_native_fields_);
|
| - writer->WriteIntptrValue(ptr()->token_pos_);
|
| + writer->Write<int32_t>(ptr()->token_pos_);
|
| writer->Write<uint16_t>(ptr()->state_bits_);
|
|
|
| // Write out all the object pointer fields.
|
| @@ -141,7 +141,7 @@
|
| unresolved_class.set_tags(tags);
|
|
|
| // Set all non object fields.
|
| - unresolved_class.set_token_pos(reader->ReadIntptrValue());
|
| + unresolved_class.set_token_pos(reader->Read<int32_t>());
|
|
|
| // Set all the object fields.
|
| // TODO(5411462): Need to assert No GC can happen here, even though
|
| @@ -170,7 +170,7 @@
|
| writer->WriteIntptrValue(writer->GetObjectTags(this));
|
|
|
| // Write out all the non object pointer fields.
|
| - writer->WriteIntptrValue(ptr()->token_pos_);
|
| + writer->Write<int32_t>(ptr()->token_pos_);
|
|
|
| // Write out all the object pointer fields.
|
| SnapshotWriterVisitor visitor(writer);
|
| @@ -205,7 +205,7 @@
|
| reader->AddBackRef(object_id, &type, kIsDeserialized);
|
|
|
| // Set all non object fields.
|
| - type.set_token_pos(reader->ReadIntptrValue());
|
| + type.set_token_pos(reader->Read<int32_t>());
|
| type.set_type_state(reader->Read<int8_t>());
|
|
|
| // Set all the object fields.
|
| @@ -256,7 +256,7 @@
|
| writer->WriteIntptrValue(writer->GetObjectTags(this));
|
|
|
| // Write out all the non object pointer fields.
|
| - writer->WriteIntptrValue(ptr()->token_pos_);
|
| + writer->Write<int32_t>(ptr()->token_pos_);
|
| writer->Write<int8_t>(ptr()->type_state_);
|
|
|
| // Write out all the object pointer fields. Since we will be canonicalizing
|
| @@ -328,8 +328,8 @@
|
| type_parameter.set_tags(tags);
|
|
|
| // Set all non object fields.
|
| - type_parameter.set_index(reader->ReadIntptrValue());
|
| - type_parameter.set_token_pos(reader->ReadIntptrValue());
|
| + type_parameter.set_index(reader->Read<int32_t>());
|
| + type_parameter.set_token_pos(reader->Read<int32_t>());
|
| type_parameter.set_type_state(reader->Read<int8_t>());
|
|
|
| // Set all the object fields.
|
| @@ -363,8 +363,8 @@
|
| writer->WriteIntptrValue(writer->GetObjectTags(this));
|
|
|
| // Write out all the non object pointer fields.
|
| - writer->WriteIntptrValue(ptr()->index_);
|
| - writer->WriteIntptrValue(ptr()->token_pos_);
|
| + writer->Write<int32_t>(ptr()->index_);
|
| + writer->Write<int32_t>(ptr()->token_pos_);
|
| writer->Write<int8_t>(ptr()->type_state_);
|
|
|
| // Write out all the object pointer fields.
|
| @@ -692,12 +692,12 @@
|
| func.set_tags(tags);
|
|
|
| // Set all the non object fields.
|
| - func.set_token_pos(reader->ReadIntptrValue());
|
| - func.set_end_token_pos(reader->ReadIntptrValue());
|
| - func.set_usage_counter(reader->ReadIntptrValue());
|
| - func.set_num_fixed_parameters(reader->ReadIntptrValue());
|
| - func.set_num_optional_parameters(reader->ReadIntptrValue());
|
| - func.set_deoptimization_counter(reader->ReadIntptrValue());
|
| + func.set_token_pos(reader->Read<int32_t>());
|
| + func.set_end_token_pos(reader->Read<int32_t>());
|
| + func.set_usage_counter(reader->Read<int32_t>());
|
| + func.set_num_fixed_parameters(reader->Read<int16_t>());
|
| + func.set_num_optional_parameters(reader->Read<int16_t>());
|
| + func.set_deoptimization_counter(reader->Read<int16_t>());
|
| func.set_kind_tag(reader->Read<uint16_t>());
|
| func.set_optimized_instruction_count(reader->Read<uint16_t>());
|
| func.set_optimized_call_site_count(reader->Read<uint16_t>());
|
| @@ -733,12 +733,12 @@
|
| writer->WriteIntptrValue(writer->GetObjectTags(this));
|
|
|
| // Write out all the non object fields.
|
| - writer->WriteIntptrValue(ptr()->token_pos_);
|
| - writer->WriteIntptrValue(ptr()->end_token_pos_);
|
| - writer->WriteIntptrValue(ptr()->usage_counter_);
|
| - writer->WriteIntptrValue(ptr()->num_fixed_parameters_);
|
| - writer->WriteIntptrValue(ptr()->num_optional_parameters_);
|
| - writer->WriteIntptrValue(ptr()->deoptimization_counter_);
|
| + writer->Write<int32_t>(ptr()->token_pos_);
|
| + writer->Write<int32_t>(ptr()->end_token_pos_);
|
| + writer->Write<int32_t>(ptr()->usage_counter_);
|
| + writer->Write<int16_t>(ptr()->num_fixed_parameters_);
|
| + writer->Write<int16_t>(ptr()->num_optional_parameters_);
|
| + writer->Write<int16_t>(ptr()->deoptimization_counter_);
|
| writer->Write<uint16_t>(ptr()->kind_tag_);
|
| writer->Write<uint16_t>(ptr()->optimized_instruction_count_);
|
| writer->Write<uint16_t>(ptr()->optimized_call_site_count_);
|
| @@ -770,9 +770,9 @@
|
| field.set_tags(tags);
|
|
|
| // Set all non object fields.
|
| - field.set_token_pos(reader->ReadIntptrValue());
|
| - field.set_guarded_cid(reader->ReadIntptrValue());
|
| - field.set_is_nullable(reader->ReadIntptrValue());
|
| + field.set_token_pos(reader->Read<int32_t>());
|
| + field.set_guarded_cid(reader->Read<int32_t>());
|
| + field.set_is_nullable(reader->Read<int32_t>());
|
| field.set_kind_bits(reader->Read<uint8_t>());
|
|
|
| // Set all the object fields.
|
| @@ -805,9 +805,9 @@
|
| writer->WriteIntptrValue(writer->GetObjectTags(this));
|
|
|
| // Write out all the non object fields.
|
| - writer->WriteIntptrValue(ptr()->token_pos_);
|
| - writer->WriteIntptrValue(ptr()->guarded_cid_);
|
| - writer->WriteIntptrValue(ptr()->is_nullable_);
|
| + writer->Write<int32_t>(ptr()->token_pos_);
|
| + writer->Write<int32_t>(ptr()->guarded_cid_);
|
| + writer->Write<int32_t>(ptr()->is_nullable_);
|
| writer->Write<uint8_t>(ptr()->kind_bits_);
|
|
|
| // Write out all the object pointer fields.
|
| @@ -1016,9 +1016,9 @@
|
| library.set_tags(tags);
|
|
|
| // Set all non object fields.
|
| - library.raw_ptr()->index_ = reader->ReadIntptrValue();
|
| - library.raw_ptr()->num_imports_ = reader->ReadIntptrValue();
|
| - library.raw_ptr()->num_anonymous_ = reader->ReadIntptrValue();
|
| + library.raw_ptr()->index_ = reader->Read<int32_t>();
|
| + library.raw_ptr()->num_imports_ = reader->Read<int32_t>();
|
| + library.raw_ptr()->num_anonymous_ = reader->Read<int32_t>();
|
| library.raw_ptr()->corelib_imported_ = reader->Read<bool>();
|
| library.raw_ptr()->is_dart_scheme_ = reader->Read<bool>();
|
| library.raw_ptr()->debuggable_ = reader->Read<bool>();
|
| @@ -1071,9 +1071,9 @@
|
| writer->WriteObjectImpl(ptr()->url_);
|
| } else {
|
| // Write out all non object fields.
|
| - writer->WriteIntptrValue(ptr()->index_);
|
| - writer->WriteIntptrValue(ptr()->num_imports_);
|
| - writer->WriteIntptrValue(ptr()->num_anonymous_);
|
| + writer->Write<int32_t>(ptr()->index_);
|
| + writer->Write<int32_t>(ptr()->num_imports_);
|
| + writer->Write<int32_t>(ptr()->num_anonymous_);
|
| writer->Write<bool>(ptr()->corelib_imported_);
|
| writer->Write<bool>(ptr()->is_dart_scheme_);
|
| writer->Write<bool>(ptr()->debuggable_);
|
| @@ -1113,7 +1113,7 @@
|
| prefix.set_tags(tags);
|
|
|
| // Set all non object fields.
|
| - prefix.raw_ptr()->num_imports_ = reader->ReadIntptrValue();
|
| + prefix.raw_ptr()->num_imports_ = reader->Read<int32_t>();
|
| prefix.raw_ptr()->is_deferred_load_ = reader->Read<bool>();
|
| prefix.raw_ptr()->is_loaded_ = reader->Read<bool>();
|
|
|
| @@ -1145,7 +1145,7 @@
|
| writer->WriteIntptrValue(writer->GetObjectTags(this));
|
|
|
| // Write out all non object fields.
|
| - writer->WriteIntptrValue(ptr()->num_imports_);
|
| + writer->Write<int32_t>(ptr()->num_imports_);
|
| writer->Write<bool>(ptr()->is_deferred_load_);
|
| writer->Write<bool>(ptr()->is_loaded_);
|
|
|
| @@ -1519,7 +1519,7 @@
|
| language_error.set_tags(tags);
|
|
|
| // Set all non object fields.
|
| - language_error.set_token_pos(reader->ReadIntptrValue());
|
| + language_error.set_token_pos(reader->Read<int32_t>());
|
| language_error.set_kind(reader->Read<uint8_t>());
|
|
|
| // Set all the object fields.
|
| @@ -1550,7 +1550,7 @@
|
| writer->WriteIntptrValue(writer->GetObjectTags(this));
|
|
|
| // Write out all the non object fields.
|
| - writer->WriteIntptrValue(ptr()->token_pos_);
|
| + writer->Write<int32_t>(ptr()->token_pos_);
|
| writer->Write<uint8_t>(ptr()->kind_);
|
|
|
| // Write out all the object pointer fields.
|
|
|