Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ClassDeserializationCluster Class Reference
Inheritance diagram for dart::ClassDeserializationCluster:
dart::DeserializationCluster dart::ZoneAllocated

Public Member Functions

 ClassDeserializationCluster ()
 
 ~ClassDeserializationCluster ()
 
void ReadAlloc (Deserializer *d) override
 
void ReadFill (Deserializer *d_) override
 
- Public Member Functions inherited from dart::DeserializationCluster
 DeserializationCluster (const char *name, bool is_canonical=false, bool is_immutable=false)
 
virtual ~DeserializationCluster ()
 
virtual void ReadAlloc (Deserializer *deserializer)=0
 
virtual void ReadFill (Deserializer *deserializer)=0
 
virtual void PostLoad (Deserializer *deserializer, const Array &refs)
 
const char * name () const
 
bool is_canonical () const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Additional Inherited Members

- Protected Member Functions inherited from dart::DeserializationCluster
void ReadAllocFixedSize (Deserializer *deserializer, intptr_t instance_size)
 
- Protected Attributes inherited from dart::DeserializationCluster
const char *const name_
 
const bool is_canonical_
 
const bool is_immutable_
 
intptr_t start_index_
 
intptr_t stop_index_
 

Detailed Description

Definition at line 1080 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ ClassDeserializationCluster()

dart::ClassDeserializationCluster::ClassDeserializationCluster ( )
inline

Definition at line 1082 of file app_snapshot.cc.

1082: DeserializationCluster("Class") {}
DeserializationCluster(const char *name, bool is_canonical=false, bool is_immutable=false)

◆ ~ClassDeserializationCluster()

dart::ClassDeserializationCluster::~ClassDeserializationCluster ( )
inline

Definition at line 1083 of file app_snapshot.cc.

1083{}

Member Function Documentation

◆ ReadAlloc()

void dart::ClassDeserializationCluster::ReadAlloc ( Deserializer d)
inlineoverridevirtual

Implements dart::DeserializationCluster.

Definition at line 1085 of file app_snapshot.cc.

1085 {
1086 predefined_start_index_ = d->next_index();
1087 intptr_t count = d->ReadUnsigned();
1088 ClassTable* table = d->isolate_group()->class_table();
1089 for (intptr_t i = 0; i < count; i++) {
1090 intptr_t class_id = d->ReadCid();
1091 ASSERT(table->HasValidClassAt(class_id));
1092 ClassPtr cls = table->At(class_id);
1093 ASSERT(cls != nullptr);
1094 d->AssignRef(cls);
1095 }
1096 predefined_stop_index_ = d->next_index();
1097
1098 start_index_ = d->next_index();
1099 count = d->ReadUnsigned();
1100 for (intptr_t i = 0; i < count; i++) {
1101 d->AssignRef(d->Allocate(Class::InstanceSize()));
1102 }
1103 stop_index_ = d->next_index();
1104 }
int count
Definition: FontMgrTest.cpp:50
SI F table(const skcms_Curve *curve, F v)
static intptr_t InstanceSize()
Definition: object.h:1685
#define ASSERT(E)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19

◆ ReadFill()

void dart::ClassDeserializationCluster::ReadFill ( Deserializer d_)
inlineoverridevirtual

Implements dart::DeserializationCluster.

Definition at line 1106 of file app_snapshot.cc.

1106 {
1107 Deserializer::Local d(d_);
1108
1109 for (intptr_t id = predefined_start_index_; id < predefined_stop_index_;
1110 id++) {
1111 ClassPtr cls = static_cast<ClassPtr>(d.Ref(id));
1112 d.ReadFromTo(cls);
1113 intptr_t class_id = d.ReadCid();
1114 cls->untag()->id_ = class_id;
1115#if !defined(DART_PRECOMPILED_RUNTIME)
1116 ASSERT(d_->kind() != Snapshot::kFullAOT);
1117 cls->untag()->kernel_offset_ = d.Read<uint32_t>();
1118#endif
1119 if (!IsInternalVMdefinedClassId(class_id)) {
1120 cls->untag()->host_instance_size_in_words_ = d.Read<int32_t>();
1121 cls->untag()->host_next_field_offset_in_words_ = d.Read<int32_t>();
1122#if defined(DART_PRECOMPILER)
1123 // Only one pair is serialized. The target field only exists when
1124 // DART_PRECOMPILER is defined
1125 cls->untag()->target_instance_size_in_words_ =
1126 cls->untag()->host_instance_size_in_words_;
1127 cls->untag()->target_next_field_offset_in_words_ =
1128 cls->untag()->host_next_field_offset_in_words_;
1129#endif // defined(DART_PRECOMPILER)
1130 } else {
1131 d.Read<int32_t>(); // Skip.
1132 d.Read<int32_t>(); // Skip.
1133 }
1134 cls->untag()->host_type_arguments_field_offset_in_words_ =
1135 d.Read<int32_t>();
1136#if defined(DART_PRECOMPILER)
1137 cls->untag()->target_type_arguments_field_offset_in_words_ =
1138 cls->untag()->host_type_arguments_field_offset_in_words_;
1139#endif // defined(DART_PRECOMPILER)
1140 cls->untag()->num_type_arguments_ = d.Read<int16_t>();
1141 cls->untag()->num_native_fields_ = d.Read<uint16_t>();
1142#if !defined(DART_PRECOMPILED_RUNTIME)
1143 ASSERT(d_->kind() != Snapshot::kFullAOT);
1144 cls->untag()->token_pos_ = d.ReadTokenPosition();
1145 cls->untag()->end_token_pos_ = d.ReadTokenPosition();
1146 cls->untag()->implementor_cid_ = d.ReadCid();
1147#endif // !defined(DART_PRECOMPILED_RUNTIME)
1148 cls->untag()->state_bits_ = d.Read<uint32_t>();
1149 d.ReadUnsigned64(); // Skip unboxed fields bitmap.
1150 }
1151
1152 ClassTable* table = d_->isolate_group()->class_table();
1153 for (intptr_t id = start_index_, n = stop_index_; id < n; id++) {
1154 ClassPtr cls = static_cast<ClassPtr>(d.Ref(id));
1156 d.ReadFromTo(cls);
1157
1158 intptr_t class_id = d.ReadCid();
1159 ASSERT(class_id >= kNumPredefinedCids);
1160 cls->untag()->id_ = class_id;
1161
1162#if !defined(DART_PRECOMPILED_RUNTIME)
1163 ASSERT(d_->kind() != Snapshot::kFullAOT);
1164 cls->untag()->kernel_offset_ = d.Read<uint32_t>();
1165#endif
1166 cls->untag()->host_instance_size_in_words_ = d.Read<int32_t>();
1167 cls->untag()->host_next_field_offset_in_words_ = d.Read<int32_t>();
1168 cls->untag()->host_type_arguments_field_offset_in_words_ =
1169 d.Read<int32_t>();
1170#if defined(DART_PRECOMPILER)
1171 cls->untag()->target_instance_size_in_words_ =
1172 cls->untag()->host_instance_size_in_words_;
1173 cls->untag()->target_next_field_offset_in_words_ =
1174 cls->untag()->host_next_field_offset_in_words_;
1175 cls->untag()->target_type_arguments_field_offset_in_words_ =
1176 cls->untag()->host_type_arguments_field_offset_in_words_;
1177#endif // defined(DART_PRECOMPILER)
1178 cls->untag()->num_type_arguments_ = d.Read<int16_t>();
1179 cls->untag()->num_native_fields_ = d.Read<uint16_t>();
1180#if !defined(DART_PRECOMPILED_RUNTIME)
1181 ASSERT(d_->kind() != Snapshot::kFullAOT);
1182 cls->untag()->token_pos_ = d.ReadTokenPosition();
1183 cls->untag()->end_token_pos_ = d.ReadTokenPosition();
1184 cls->untag()->implementor_cid_ = d.ReadCid();
1185#endif // !defined(DART_PRECOMPILED_RUNTIME)
1186 cls->untag()->state_bits_ = d.Read<uint32_t>();
1187
1188 table->AllocateIndex(class_id);
1189 table->SetAt(class_id, cls);
1190
1191 if (!ClassTable::IsTopLevelCid(class_id)) {
1192 const UnboxedFieldBitmap unboxed_fields_map(d.ReadUnsigned64());
1193 table->SetUnboxedFieldsMapAt(class_id, unboxed_fields_map);
1194 }
1195 }
1196 }
static bool IsTopLevelCid(intptr_t cid)
Definition: class_table.h:496
static void InitializeHeader(ObjectPtr raw, intptr_t cid, intptr_t size, bool is_canonical=false)
@ kNumPredefinedCids
Definition: class_id.h:257
bool IsInternalVMdefinedClassId(intptr_t index)
Definition: class_id.h:549

The documentation for this class was generated from the following file: