63 DISALLOW_COPY_AND_ASSIGN(PredefinedCObjects);
75class MessageSerializer;
76class MessageDeserializer;
77class ApiMessageSerializer;
78class ApiMessageDeserializer;
154 template <
typename T>
168 for (intptr_t
i = 0;
i <
len;
i++) {
212 if (object->IsImmediateOrOldObject()) {
217 return table->MarkValueExclusive(
object,
id);
223 if (object->IsImmediateOrOldObject()) {
228 table->SetValueExclusive(
object,
id);
233 if (object->IsImmediateOrOldObject()) {
238 return table->GetValueExclusive(
object);
340 const char* exception_message_;
350 template <
typename T>
402 return refs_.
At(index);
407 refs_.
SetAt(index, new_object);
481 type.InitializeTypeTestingStubNonAtomic(
code);
484 d->UpdateRef(
id,
type);
513 const intptr_t
count = objects_.length();
517 for (intptr_t
i = 0;
i <
count;
i++) {
520 intptr_t
cid = cls->
id();
523 s->WriteUnsigned(
cid);
547 auto* class_table =
d->isolate_group()->class_table();
552 intptr_t
count =
d->ReadUnsigned();
553 for (intptr_t
i = 0;
i <
count;
i++) {
554 intptr_t
cid =
d->ReadUnsigned();
556 cls = class_table->At(
cid);
564 if (
name.Equals(Symbols::TopLevel())) {
574 d->AssignRef(cls.
ptr());
579 intptr_t
count =
d->ReadUnsigned();
580 for (intptr_t
i = 0;
i <
count;
i++) {
581 intptr_t
cid =
d->ReadUnsigned();
586 d->AssignRef(
nullptr);
603 objects_.Add(type_args);
605 s->Push(type_args->untag()->instantiations());
608 s->Push(type_args->untag()->element(
i));
613 const intptr_t
count = objects_.length();
615 for (intptr_t
i = 0;
i <
count;
i++) {
617 s->AssignRef(type_args);
624 const intptr_t
count = objects_.length();
625 for (intptr_t
i = 0;
i <
count;
i++) {
628 s->Write<int32_t>(
hash);
629 const intptr_t nullability =
631 s->WriteUnsigned(nullability);
635 for (intptr_t j = 0; j <
length; j++) {
636 s->WriteRef(type_args->untag()->element(j));
653 const intptr_t
count =
d->ReadUnsigned();
654 for (intptr_t
i = 0;
i <
count;
i++) {
655 intptr_t
length =
d->ReadUnsigned();
662 TypeArgumentsPtr type_args =
static_cast<TypeArgumentsPtr
>(
d->Ref(
id));
664 type_args->untag()->hash_ =
Smi::New(
d->Read<int32_t>());
665 type_args->untag()->nullability_ =
Smi::New(
d->ReadUnsigned());
667 intptr_t
length =
d->ReadUnsigned();
668 for (intptr_t j = 0; j <
length; j++) {
669 type_args->untag()->types()[j] =
670 static_cast<AbstractTypePtr
>(
d->ReadRef());
679 type_args ^=
d->Ref(
id);
681 d->UpdateRef(
id, type_args);
688 intptr_t
count =
d->ReadUnsigned();
689 for (intptr_t
i = 0;
i <
count;
i++) {
691 d->AssignRef(
nullptr);
699 intptr_t
length =
d->ReadUnsigned();
700 for (intptr_t j = 0; j <
length; j++) {
719 if (!
type->IsTypeClassAllowedBySpawnUri()) {
720 s->IllegalObject(*
object,
"is a Type");
725 s->Push(
type->type_class());
726 s->Push(
type->arguments());
730 const intptr_t
count = objects_.length();
732 for (intptr_t
i = 0;
i <
count;
i++) {
739 const intptr_t
count = objects_.length();
740 for (intptr_t
i = 0;
i <
count;
i++) {
742 s->WriteRef(
type->type_class());
743 s->WriteRef(
type->arguments());
744 s->Write<uint8_t>(
static_cast<uint8_t
>(
type->nullability()));
759 const intptr_t
count =
d->ReadUnsigned();
760 for (intptr_t
i = 0;
i <
count;
i++) {
772 type.set_type_class(cls);
773 type_args ^=
d->ReadRef();
774 type.set_arguments(type_args);
777 type.SetIsFinalized();
784 intptr_t
count =
d->ReadUnsigned();
785 for (intptr_t
i = 0;
i <
count;
i++) {
786 d->AssignRef(
nullptr);
810 Smi* smi =
static_cast<Smi*
>(object);
815 const intptr_t
count = objects_.length();
817 for (intptr_t
i = 0;
i <
count;
i++) {
818 Smi* smi =
static_cast<Smi*
>(objects_[
i]);
820 s->Write<intptr_t>(smi->
Value());
825 objects_.Add(
reinterpret_cast<Smi*
>(
object));
829 intptr_t
count = objects_.length();
831 for (intptr_t
i = 0;
i <
count;
i++) {
836 s->Write<intptr_t>(
value);
851 const intptr_t
count =
d->ReadUnsigned();
852 for (intptr_t
i = 0;
i <
count;
i++) {
858 intptr_t
count =
d->ReadUnsigned();
859 for (intptr_t
i = 0;
i <
count;
i++) {
860 intptr_t
value =
d->Read<intptr_t>();
864 smi->value.as_int32 =
value;
867 smi->value.as_int64 =
value;
885 Mint* mint =
static_cast<Mint*
>(object);
890 const intptr_t
count = objects_.length();
892 for (intptr_t
i = 0;
i <
count;
i++) {
893 Mint* mint =
static_cast<Mint*
>(objects_[
i]);
895 s->Write<int64_t>(mint->
value());
900 objects_.Add(
reinterpret_cast<Mint*
>(
object));
904 intptr_t
count = objects_.length();
906 for (intptr_t
i = 0;
i <
count;
i++) {
926 const intptr_t
count =
d->ReadUnsigned();
927 for (intptr_t
i = 0;
i <
count;
i++) {
928 int64_t
value =
d->Read<int64_t>();
935 intptr_t
count =
d->ReadUnsigned();
936 for (intptr_t
i = 0;
i <
count;
i++) {
937 int64_t
value =
d->Read<int64_t>();
941 mint->value.as_int32 =
value;
944 mint->value.as_int64 =
value;
968 const intptr_t
count = objects_.length();
970 for (intptr_t
i = 0;
i <
count;
i++) {
973 s->Write<
double>(dbl->untag()->value_);
978 objects_.Add(
reinterpret_cast<Double*
>(
object));
982 intptr_t
count = objects_.length();
984 for (intptr_t
i = 0;
i <
count;
i++) {
1003 const intptr_t
count =
d->ReadUnsigned();
1004 for (intptr_t
i = 0;
i <
count;
i++) {
1005 double value =
d->Read<
double>();
1012 intptr_t
count =
d->ReadUnsigned();
1013 for (intptr_t
i = 0;
i <
count;
i++) {
1027 kGrowableObjectArrayCid) {}
1032 objects_.Add(array);
1037 if (!
args.IsNull() && (
args.Length() != 1)) {
1039 array->untag()->set_type_arguments(
args.ptr());
1042 s->Push(array->untag()->type_arguments());
1043 for (intptr_t
i = 0, n = array->
Length();
i < n;
i++) {
1044 s->Push(array->
At(
i));
1049 const intptr_t
count = objects_.length();
1051 for (intptr_t
i = 0;
i <
count;
i++) {
1053 s->WriteUnsigned(array->
Length());
1054 s->AssignRef(array);
1059 const intptr_t
count = objects_.length();
1060 for (intptr_t
i = 0;
i <
count;
i++) {
1062 s->WriteRef(array->untag()->type_arguments());
1063 for (intptr_t
i = 0, n = array->
Length();
i < n;
i++) {
1064 s->WriteRef(array->
At(
i));
1081 const intptr_t
count =
d->ReadUnsigned();
1083 for (intptr_t
i = 0;
i <
count;
i++) {
1084 intptr_t
length =
d->ReadUnsigned();
1087 d->AssignRef(array.
ptr());
1094 array ^=
d->Ref(
id);
1095 array.untag()->set_type_arguments(
1096 static_cast<TypeArgumentsPtr
>(
d->ReadRef()));
1097 for (intptr_t
i = 0, n = array.
Length();
i < n;
i++) {
1098 array.untag()->
data()->untag()->set_element(
i,
d->ReadRef());
1109 intptr_t
count =
d->ReadUnsigned();
1110 for (intptr_t
i = 0;
i <
count;
i++) {
1112 intptr_t
length =
d->ReadUnsigned();
1120 d->AssignRef(array);
1143 objects_(zone, 0) {}
1153 intptr_t
count = objects_.length();
1155 for (intptr_t
i = 0;
i <
count;
i++) {
1161 uint8_t* cdata =
reinterpret_cast<uint8_t*
>(
data->untag()->data());
1167 objects_.Add(
reinterpret_cast<TypedData*
>(
object));
1172 intptr_t
count = objects_.length();
1174 for (intptr_t
i = 0;
i <
count;
i++) {
1177 intptr_t
length =
data->value.as_external_typed_data.length;
1179 const uint8_t* cdata =
data->value.as_typed_data.values;
1197 intptr_t
count =
d->ReadUnsigned();
1199 for (intptr_t
i = 0;
i <
count;
i++) {
1200 intptr_t
length =
d->ReadUnsigned();
1202 d->AssignRef(
data.ptr());
1205 d->ReadBytes(
data.untag()->data(), length_in_bytes);
1212 case kTypedDataInt8ArrayCid:
1215 case kTypedDataUint8ArrayCid:
1218 case kTypedDataUint8ClampedArrayCid:
1221 case kTypedDataInt16ArrayCid:
1224 case kTypedDataUint16ArrayCid:
1227 case kTypedDataInt32ArrayCid:
1230 case kTypedDataUint32ArrayCid:
1233 case kTypedDataInt64ArrayCid:
1236 case kTypedDataUint64ArrayCid:
1239 case kTypedDataFloat32ArrayCid:
1242 case kTypedDataFloat64ArrayCid:
1245 case kTypedDataInt32x4ArrayCid:
1248 case kTypedDataFloat32x4ArrayCid:
1251 case kTypedDataFloat64x2ArrayCid:
1259 intptr_t
count =
d->ReadUnsigned();
1260 for (intptr_t
i = 0;
i <
count;
i++) {
1262 intptr_t
length =
d->ReadUnsigned();
1263 data->value.as_typed_data.type =
type;
1266 data->value.as_typed_data.values =
nullptr;
1268 data->value.as_typed_data.values =
d->CurrentBufferAddress();
1276 const intptr_t cid_;
1293 objects_(zone, 0) {}
1304 intptr_t
count = objects_.length();
1306 for (intptr_t
i = 0;
i <
count;
i++) {
1313 void* passed_data =
malloc(length_in_bytes);
1314 memmove(passed_data,
data->untag()->data_, length_in_bytes);
1315 s->finalizable_data()->Put(length_in_bytes,
1329 intptr_t
count = objects_.length();
1331 for (intptr_t
i = 0;
i <
count;
i++) {
1335 intptr_t
length =
data->value.as_external_typed_data.length;
1339 data->value.as_external_typed_data.data,
1340 data->value.as_external_typed_data.peer,
1341 data->value.as_external_typed_data.callback);
1358 intptr_t
count =
d->ReadUnsigned();
1360 for (intptr_t
i = 0;
i <
count;
i++) {
1361 intptr_t
length =
d->ReadUnsigned();
1364 cid_,
reinterpret_cast<uint8_t*
>(finalizable_data.
data),
length);
1368 d->AssignRef(
data.ptr());
1375 case kExternalTypedDataInt8ArrayCid:
1378 case kExternalTypedDataUint8ArrayCid:
1381 case kExternalTypedDataUint8ClampedArrayCid:
1384 case kExternalTypedDataInt16ArrayCid:
1387 case kExternalTypedDataUint16ArrayCid:
1390 case kExternalTypedDataInt32ArrayCid:
1393 case kExternalTypedDataUint32ArrayCid:
1396 case kExternalTypedDataInt64ArrayCid:
1399 case kExternalTypedDataUint64ArrayCid:
1402 case kExternalTypedDataFloat32ArrayCid:
1405 case kExternalTypedDataFloat64ArrayCid:
1408 case kExternalTypedDataInt32x4ArrayCid:
1411 case kExternalTypedDataFloat32x4ArrayCid:
1414 case kExternalTypedDataFloat64x2ArrayCid:
1421 intptr_t
count =
d->ReadUnsigned();
1422 for (intptr_t
i = 0;
i <
count;
i++) {
1424 intptr_t
length =
d->ReadUnsigned();
1426 data->value.as_typed_data.type =
type;
1428 data->value.as_typed_data.values =
1429 reinterpret_cast<uint8_t*
>(finalizable_data.
data);
1435 const intptr_t cid_;
1445 objects_(zone, 0) {}
1453 objects_.Add(
object);
1457 intptr_t
count = objects_.length();
1459 for (intptr_t
i = 0;
i <
count;
i++) {
1463 s->finalizable_data()->Put(
1464 data->value.as_native_pointer.size,
1465 reinterpret_cast<void*
>(
data->value.as_native_pointer.ptr),
1466 reinterpret_cast<void*
>(
data->value.as_native_pointer.ptr),
1467 data->value.as_native_pointer.callback);
1483 const intptr_t
count =
d->ReadUnsigned();
1484 for (intptr_t
i = 0;
i <
count;
i++) {
1486 intptr_t ptr =
reinterpret_cast<intptr_t
>(finalizable_data.
data);
1494 const intptr_t cid_;
1509 objects_(zone, 0) {}
1516 s->Push(view->untag()->
length());
1522 const intptr_t
count = objects_.length();
1525 for (intptr_t
i = 0;
i <
count;
i++) {
1532 const intptr_t
count = objects_.length();
1533 for (intptr_t
i = 0;
i <
count;
i++) {
1535 s->WriteRef(view->untag()->
length());
1549 intptr_t
count = objects_.length();
1552 for (intptr_t
i = 0;
i <
count;
i++) {
1556 intptr_t
length =
data->value.as_external_typed_data.length;
1560 data->value.as_external_typed_data.data,
1561 data->value.as_external_typed_data.peer,
1562 data->value.as_external_typed_data.callback);
1578 const intptr_t
count =
d->ReadUnsigned();
1581 intptr_t view_cid = cid_;
1590 for (intptr_t
i = 0;
i <
count;
i++) {
1591 intptr_t
length =
d->ReadUnsigned();
1594 backing_cid,
reinterpret_cast<uint8_t*
>(finalizable_data.
data),
1596 data.SetImmutable();
1601 d->AssignRef(
data.ptr());
1604 for (intptr_t
i = 0;
i <
count;
i++) {
1613 TypedDataViewPtr view =
static_cast<TypedDataViewPtr
>(
d->Ref(
id));
1614 view->untag()->set_length(
static_cast<SmiPtr
>(
d->ReadRef()));
1615 view->untag()->set_typed_data(
1616 static_cast<TypedDataBasePtr
>(
d->ReadRef()));
1617 view->untag()->set_offset_in_bytes(
static_cast<SmiPtr
>(
d->ReadRef()));
1624 TypedDataViewPtr view =
static_cast<TypedDataViewPtr
>(
d->Ref(
id));
1625 view->
untag()->RecomputeDataField();
1637 intptr_t
count =
d->ReadUnsigned();
1642 case kUnmodifiableTypedDataInt8ArrayViewCid:
1645 case kUnmodifiableTypedDataUint8ArrayViewCid:
1648 case kUnmodifiableTypedDataUint8ClampedArrayViewCid:
1651 case kUnmodifiableTypedDataInt16ArrayViewCid:
1654 case kUnmodifiableTypedDataUint16ArrayViewCid:
1657 case kUnmodifiableTypedDataInt32ArrayViewCid:
1660 case kUnmodifiableTypedDataUint32ArrayViewCid:
1663 case kUnmodifiableTypedDataInt64ArrayViewCid:
1666 case kUnmodifiableTypedDataUint64ArrayViewCid:
1669 case kUnmodifiableTypedDataFloat32ArrayViewCid:
1672 case kUnmodifiableTypedDataFloat64ArrayViewCid:
1675 case kUnmodifiableTypedDataInt32x4ArrayViewCid:
1678 case kUnmodifiableTypedDataFloat32x4ArrayViewCid:
1681 case kUnmodifiableTypedDataFloat64x2ArrayViewCid:
1690 intptr_t
length =
d->ReadUnsigned();
1692 data->value.as_typed_data.type =
type;
1694 data->value.as_typed_data.values =
1695 reinterpret_cast<uint8_t*
>(finalizable_data.
data);
1698 for (intptr_t
i = 0;
i <
count;
i++) {
1719 case kTypedDataInt8ArrayViewCid:
1720 case kUnmodifiableTypedDataInt8ArrayViewCid:
1723 case kTypedDataUint8ArrayViewCid:
1724 case kUnmodifiableTypedDataUint8ArrayViewCid:
1727 case kTypedDataUint8ClampedArrayViewCid:
1728 case kUnmodifiableTypedDataUint8ClampedArrayViewCid:
1731 case kTypedDataInt16ArrayViewCid:
1732 case kUnmodifiableTypedDataInt16ArrayViewCid:
1735 case kTypedDataUint16ArrayViewCid:
1736 case kUnmodifiableTypedDataUint16ArrayViewCid:
1739 case kTypedDataInt32ArrayViewCid:
1740 case kUnmodifiableTypedDataInt32ArrayViewCid:
1743 case kTypedDataUint32ArrayViewCid:
1744 case kUnmodifiableTypedDataUint32ArrayViewCid:
1747 case kTypedDataInt64ArrayViewCid:
1748 case kUnmodifiableTypedDataInt64ArrayViewCid:
1751 case kTypedDataUint64ArrayViewCid:
1752 case kUnmodifiableTypedDataUint64ArrayViewCid:
1755 case kTypedDataFloat32ArrayViewCid:
1756 case kUnmodifiableTypedDataFloat32ArrayViewCid:
1759 case kTypedDataFloat64ArrayViewCid:
1760 case kUnmodifiableTypedDataFloat64ArrayViewCid:
1763 case kTypedDataInt32x4ArrayViewCid:
1764 case kUnmodifiableTypedDataInt32x4ArrayViewCid:
1767 case kTypedDataFloat32x4ArrayViewCid:
1768 case kUnmodifiableTypedDataFloat32x4ArrayViewCid:
1771 case kTypedDataFloat64x2ArrayViewCid:
1772 case kUnmodifiableTypedDataFloat64x2ArrayViewCid:
1795 const intptr_t cid_;
1805 kTransferableTypedDataCid) {}
1811 objects_.Add(transferable);
1813 void* peer =
s->thread()->heap()->GetPeer(transferable->
ptr());
1818 if (tpeer->
data() ==
nullptr) {
1819 s->IllegalObject(*
object,
1820 "TransferableTypedData has been transferred already");
1825 const intptr_t
count = objects_.length();
1827 for (intptr_t
i = 0;
i <
count;
i++) {
1829 s->AssignRef(transferable);
1831 void* peer =
s->thread()->heap()->GetPeer(transferable->
ptr());
1840 s->finalizable_data()->Put(
1844 [](
void*
data,
void* peer) {},
1846 [](
void*
data,
void* peer) {
1867 const intptr_t
count =
d->ReadUnsigned();
1868 for (intptr_t
i = 0;
i <
count;
i++) {
1869 intptr_t
length =
d->ReadUnsigned();
1872 reinterpret_cast<uint8_t*
>(finalizable_data.
data),
length));
1877 intptr_t
count =
d->ReadUnsigned();
1878 for (intptr_t
i = 0;
i <
count;
i++) {
1880 data->value.as_typed_data.length =
d->ReadUnsigned();
1883 data->value.as_typed_data.values =
1884 reinterpret_cast<const uint8_t*
>(finalizable_data.
data);
1901 const intptr_t
count = objects_.length();
1903 for (intptr_t
i = 0;
i <
count;
i++) {
1905 s->AssignRef(vector);
1908 s->WriteBytes(&(
static_cast<Int32x4Ptr
>(vector->
ptr())->untag()->value_),
1922 ASSERT(cid_ == kInt32x4Cid || cid_ == kFloat32x4Cid ||
1923 cid_ == kFloat64x2Cid);
1927 if (cid_ == kFloat32x4Cid) {
1928 AssertSameStructure<Int32x4, Float32x4>();
1929 }
else if (cid_ == kFloat64x2Cid) {
1930 AssertSameStructure<Int32x4, Float64x2>();
1937 template <
typename Expected,
typename Got>
1938 static void AssertSameStructure() {
1939 ASSERT_EQUAL(Got::InstanceSize(), Expected::InstanceSize());
1941 Expected::ContainsCompressedPointers());
1942 ASSERT_EQUAL(Object::from_offset<Got>(), Object::from_offset<Expected>());
1943 ASSERT_EQUAL(Object::to_offset<Got>(), Object::to_offset<Expected>());
1944 ASSERT_EQUAL(Got::value_offset(), Expected::value_offset());
1949 const intptr_t
count =
d->ReadUnsigned();
1950 for (intptr_t
i = 0;
i <
count;
i++) {
1954 Object::to_offset<Int32x4>());
1955 d->AssignRef(vector);
1956 d->ReadBytes(&(
static_cast<Int32x4Ptr
>(vector)->
untag()->value_),
1962 const intptr_t cid_;
1971 objects_(zone, 0) {}
1980 const intptr_t
count = objects_.length();
1982 for (intptr_t
i = 0;
i <
count;
i++) {
1991 objects_.Add(
reinterpret_cast<SendPort*
>(
object));
1995 intptr_t
count = objects_.length();
1997 for (intptr_t
i = 0;
i <
count;
i++) {
2017 const intptr_t
count =
d->ReadUnsigned();
2018 for (intptr_t
i = 0;
i <
count;
i++) {
2026 intptr_t
count =
d->ReadUnsigned();
2027 for (intptr_t
i = 0;
i <
count;
i++) {
2043 objects_(zone, 0) {}
2052 const intptr_t
count = objects_.length();
2054 for (intptr_t
i = 0;
i <
count;
i++) {
2057 s->Write<uint64_t>(cap->untag()->id_);
2062 objects_.Add(
reinterpret_cast<Capability*
>(
object));
2066 intptr_t
count = objects_.length();
2068 for (intptr_t
i = 0;
i <
count;
i++) {
2087 const intptr_t
count =
d->ReadUnsigned();
2088 for (intptr_t
i = 0;
i <
count;
i++) {
2089 uint64_t
id =
d->Read<uint64_t>();
2095 intptr_t
count =
d->ReadUnsigned();
2096 for (intptr_t
i = 0;
i <
count;
i++) {
2113 objects_(zone, 0) {}
2123 if (!
args.IsNull() && (
args.Length() != 2)) {
2125 map->untag()->set_type_arguments(
args.ptr());
2128 s->Push(
map->untag()->type_arguments());
2129 s->Push(
map->untag()->data());
2130 s->Push(
map->untag()->used_data());
2134 const intptr_t
count = objects_.length();
2136 for (intptr_t
i = 0;
i <
count;
i++) {
2143 const intptr_t
count = objects_.length();
2144 for (intptr_t
i = 0;
i <
count;
i++) {
2146 s->WriteRef(
map->untag()->type_arguments());
2147 s->WriteRef(
map->untag()->data());
2148 s->WriteRef(
map->untag()->used_data());
2163 const intptr_t
count =
d->ReadUnsigned();
2164 for (intptr_t
i = 0;
i <
count;
i++) {
2165 d->AssignRef(Map::NewUninitialized(cid_));
2171 MapPtr
map =
static_cast<MapPtr
>(
d->Ref(
id));
2173 map->untag()->set_type_arguments(
2174 static_cast<TypeArgumentsPtr
>(
d->ReadRef()));
2175 map->untag()->set_data(
static_cast<ArrayPtr
>(
d->ReadRef()));
2176 map->untag()->set_used_data(
static_cast<SmiPtr
>(
d->ReadRef()));
2187 ASSERT(cid_ == kConstMapCid);
2189 d->isolate_group()->constant_canonicalization_mutex());
2200 const intptr_t cid_;
2212 objects_(zone, 0) {}
2222 if (!
args.IsNull() && (
args.Length() != 1)) {
2224 set->untag()->set_type_arguments(
args.ptr());
2227 s->Push(
set->untag()->type_arguments());
2228 s->Push(
set->untag()->data());
2229 s->Push(
set->untag()->used_data());
2233 const intptr_t
count = objects_.length();
2235 for (intptr_t
i = 0;
i <
count;
i++) {
2242 const intptr_t
count = objects_.length();
2243 for (intptr_t
i = 0;
i <
count;
i++) {
2245 s->WriteRef(
set->untag()->type_arguments());
2246 s->WriteRef(
set->untag()->data());
2247 s->WriteRef(
set->untag()->used_data());
2262 const intptr_t
count =
d->ReadUnsigned();
2263 for (intptr_t
i = 0;
i <
count;
i++) {
2264 d->AssignRef(Set::NewUninitialized(cid_));
2270 SetPtr
map =
static_cast<SetPtr
>(
d->Ref(
id));
2272 map->untag()->set_type_arguments(
2273 static_cast<TypeArgumentsPtr
>(
d->ReadRef()));
2274 map->untag()->set_data(
static_cast<ArrayPtr
>(
d->ReadRef()));
2275 map->untag()->set_used_data(
static_cast<SmiPtr
>(
d->ReadRef()));
2286 ASSERT(cid_ == kConstSetCid);
2288 d->isolate_group()->constant_canonicalization_mutex());
2299 const intptr_t cid_;
2311 objects_(zone, 0) {}
2316 objects_.Add(array);
2321 if (!
args.IsNull() && (
args.Length() != 1)) {
2323 array->untag()->set_type_arguments(
args.ptr());
2326 s->Push(array->untag()->type_arguments());
2329 s->Push(array->untag()->element(
i));
2334 const intptr_t
count = objects_.length();
2336 for (intptr_t
i = 0;
i <
count;
i++) {
2337 Array* array = objects_[
i];
2338 s->AssignRef(array);
2345 const intptr_t
count = objects_.length();
2346 for (intptr_t
i = 0;
i <
count;
i++) {
2347 Array* array = objects_[
i];
2349 s->WriteRef(array->untag()->type_arguments());
2350 for (intptr_t j = 0; j <
length; j++) {
2351 s->WriteRef(array->untag()->element(j));
2357 objects_.Add(
reinterpret_cast<Array*
>(
object));
2365 intptr_t
count = objects_.length();
2367 for (intptr_t
i = 0;
i <
count;
i++) {
2369 s->AssignRef(array);
2375 intptr_t
count = objects_.length();
2376 for (intptr_t
i = 0;
i <
count;
i++) {
2380 for (intptr_t j = 0; j <
length; j++) {
2398 const intptr_t
count =
d->ReadUnsigned();
2399 for (intptr_t
i = 0;
i <
count;
i++) {
2400 intptr_t
length =
d->ReadUnsigned();
2407 ArrayPtr array =
static_cast<ArrayPtr
>(
d->Ref(
id));
2409 array->untag()->set_type_arguments(
2410 static_cast<TypeArgumentsPtr
>(
d->ReadRef()));
2411 for (intptr_t j = 0; j <
length; j++) {
2412 array->untag()->set_element(j,
d->ReadRef());
2420 d->isolate_group()->constant_canonicalization_mutex());
2432 intptr_t
count =
d->ReadUnsigned();
2433 for (intptr_t
i = 0;
i <
count;
i++) {
2435 intptr_t
length =
d->ReadUnsigned();
2442 d->AssignRef(array);
2458 const intptr_t cid_;
2470 objects_(zone, 0) {}
2479 const intptr_t
count = objects_.length();
2481 for (intptr_t
i = 0;
i <
count;
i++) {
2487 s->WriteBytes(OneByteString::DataStart(*str),
length *
sizeof(uint8_t));
2492 objects_.Add(
reinterpret_cast<String*
>(
object));
2496 intptr_t
count = objects_.length();
2498 for (intptr_t
i = 0;
i <
count;
i++) {
2502 const uint8_t* utf8_str =
2508 uint8_t* latin1_str =
reinterpret_cast<uint8_t*
>(
2513 s->WriteUnsigned(latin1_len);
2514 s->WriteBytes(latin1_str, latin1_len);
2531 const intptr_t
count =
d->ReadUnsigned();
2532 for (intptr_t
i = 0;
i <
count;
i++) {
2533 intptr_t
length =
d->ReadUnsigned();
2534 const uint8_t*
data =
d->CurrentBufferAddress();
2535 d->Advance(
length *
sizeof(uint8_t));
2543 intptr_t
count =
d->ReadUnsigned();
2544 for (intptr_t
i = 0;
i <
count;
i++) {
2546 intptr_t latin1_length =
d->ReadUnsigned();
2547 const uint8_t*
data =
d->CurrentBufferAddress();
2549 d->Advance(latin1_length *
sizeof(uint8_t));
2551 intptr_t utf8_len = 0;
2552 for (intptr_t
i = 0;
i < latin1_length;
i++) {
2555 char* utf8_data =
d->zone()->Alloc<
char>(utf8_len + 1);
2557 for (intptr_t
i = 0;
i < latin1_length;
i++) {
2576 objects_(zone, 0) {}
2585 const intptr_t
count = objects_.length();
2587 for (intptr_t
i = 0;
i <
count;
i++) {
2593 uint16_t* utf16 = TwoByteString::DataStart(*str);
2594 s->WriteBytes(
reinterpret_cast<const uint8_t*
>(utf16),
2595 length *
sizeof(uint16_t));
2600 objects_.Add(
reinterpret_cast<String*
>(
object));
2604 intptr_t
count = objects_.length();
2606 for (intptr_t
i = 0;
i <
count;
i++) {
2610 const uint8_t* utf8_str =
2616 uint16_t* utf16_str =
reinterpret_cast<uint16_t*
>(
2621 s->WriteUnsigned(utf16_len);
2622 s->WriteBytes(
reinterpret_cast<const uint8_t*
>(utf16_str),
2623 utf16_len *
sizeof(uint16_t));
2640 const intptr_t
count =
d->ReadUnsigned();
2641 for (intptr_t
i = 0;
i <
count;
i++) {
2642 intptr_t
length =
d->ReadUnsigned();
2643 const uint16_t*
data =
2644 reinterpret_cast<const uint16_t*
>(
d->CurrentBufferAddress());
2645 d->Advance(
length *
sizeof(uint16_t));
2653 intptr_t
count =
d->ReadUnsigned();
2654 for (intptr_t j = 0; j <
count; j++) {
2656 intptr_t utf16_length =
d->ReadUnsigned();
2657 const uint16_t* utf16 =
2658 reinterpret_cast<const uint16_t*
>(
d->CurrentBufferAddress());
2659 d->Advance(utf16_length *
sizeof(uint16_t));
2663 intptr_t utf8_len = 0;
2666 while (
i < utf16_length && valid) {
2675 char*
utf8 =
d->zone()->Alloc<
char>(utf8_len + 1);
2678 while (
i < utf16_length) {
2697 num_base_objects_(0),
2698 num_written_objects_(0),
2707 forward_table_new_(),
2708 forward_table_old_(),
2709 stack_(thread->zone(), 0) {
2720 :
BaseSerializer(nullptr, zone), forward_table_(), stack_(zone, 0) {}
2741 if (!object->
ptr()->IsHeapObject()) {
2743 is_canonical =
true;
2745 cid =
object->GetClassId();
2746 is_canonical =
object->ptr()->untag()->IsCanonical();
2751 if ((c->cid() ==
cid) && (c->is_canonical() == is_canonical)) {
2756 if (cluster ==
nullptr) {
2761 zone_,
"is a regular instance reachable via %s",
2767 const char* illegal_cid_string =
nullptr;
2770#define ILLEGAL(type) \
2771 case k##type##Cid: \
2772 illegal_cid_string = #type; \
2802 if (illegal_cid_string !=
nullptr) {
2806 zone_,
"is a %s reachable via %s", illegal_cid_string,
2816 cluster->
Trace(
this,
object);
2820 const bool is_canonical =
false;
2822 switch (object->
type) {
2840 const uint8_t* utf8_str =
2841 reinterpret_cast<const uint8_t*
>(
object->value.as_string);
2844 return Fail(
"invalid utf8");
2849 return Fail(
"invalid string length");
2857 return Fail(
"invalid array length");
2863 cid = kTypedDataInt8ArrayCid;
2866 cid = kTypedDataUint8ArrayCid;
2869 cid = kTypedDataUint8ClampedArrayCid;
2872 cid = kTypedDataInt16ArrayCid;
2875 cid = kTypedDataUint16ArrayCid;
2878 cid = kTypedDataInt32ArrayCid;
2881 cid = kTypedDataUint32ArrayCid;
2884 cid = kTypedDataInt64ArrayCid;
2887 cid = kTypedDataUint64ArrayCid;
2890 cid = kTypedDataFloat32ArrayCid;
2893 cid = kTypedDataFloat64ArrayCid;
2896 cid = kTypedDataInt32x4ArrayCid;
2899 cid = kTypedDataFloat32x4ArrayCid;
2902 cid = kTypedDataFloat64x2ArrayCid;
2905 return Fail(
"invalid TypedData type");
2908 intptr_t
len =
object->value.as_typed_data.length;
2910 return Fail(
"invalid typeddata length");
2917 cid = kExternalTypedDataInt8ArrayCid;
2920 cid = kExternalTypedDataUint8ArrayCid;
2923 cid = kExternalTypedDataUint8ClampedArrayCid;
2926 cid = kExternalTypedDataInt16ArrayCid;
2929 cid = kExternalTypedDataUint16ArrayCid;
2932 cid = kExternalTypedDataInt32ArrayCid;
2935 cid = kExternalTypedDataUint32ArrayCid;
2938 cid = kExternalTypedDataInt64ArrayCid;
2941 cid = kExternalTypedDataUint64ArrayCid;
2944 cid = kExternalTypedDataFloat32ArrayCid;
2947 cid = kExternalTypedDataFloat64ArrayCid;
2950 cid = kExternalTypedDataInt32x4ArrayCid;
2953 cid = kExternalTypedDataFloat32x4ArrayCid;
2956 cid = kExternalTypedDataFloat64x2ArrayCid;
2959 return Fail(
"invalid TypedData type");
2962 intptr_t
len =
object->value.as_typed_data.length;
2964 return Fail(
"invalid typeddata length");
2971 cid = kUnmodifiableTypedDataInt8ArrayViewCid;
2974 cid = kUnmodifiableTypedDataUint8ArrayViewCid;
2977 cid = kUnmodifiableTypedDataUint8ClampedArrayViewCid;
2980 cid = kUnmodifiableTypedDataInt16ArrayViewCid;
2983 cid = kUnmodifiableTypedDataUint16ArrayViewCid;
2986 cid = kUnmodifiableTypedDataInt32ArrayViewCid;
2989 cid = kUnmodifiableTypedDataUint32ArrayViewCid;
2992 cid = kUnmodifiableTypedDataInt64ArrayViewCid;
2995 cid = kUnmodifiableTypedDataUint64ArrayViewCid;
2998 cid = kUnmodifiableTypedDataFloat32ArrayViewCid;
3001 cid = kUnmodifiableTypedDataFloat64ArrayViewCid;
3004 cid = kUnmodifiableTypedDataInt32x4ArrayViewCid;
3007 cid = kUnmodifiableTypedDataFloat32x4ArrayViewCid;
3010 cid = kUnmodifiableTypedDataFloat64x2ArrayViewCid;
3013 return Fail(
"invalid TypedData type");
3016 intptr_t
len =
object->value.as_typed_data.length;
3020 return Fail(
"invalid typeddata length");
3028 cid = kCapabilityCid;
3034 return Fail(
"invalid Dart_CObject type");
3039 if (c->cid() ==
cid) {
3044 if (cluster ==
nullptr) {
3056 args.SetAt(0,
object);
3064 finalizable_data_(
message->finalizable_data()),
3071 bool is_canonical) {
3090 case kTypeArgumentsCid:
3100 case kGrowableObjectArrayCid:
3104 case kCapabilityCid:
3106 case kTransferableTypedDataCid:
3115 case kImmutableArrayCid:
3117 case kOneByteStringCid:
3119 case kTwoByteStringCid:
3129 FATAL(
"No cluster defined for cid %" Pd,
cid);
3134 uint64_t cid_and_canonical = (
static_cast<uint64_t
>(cluster->
cid()) << 1) |
3142 const bool is_canonical = (cid_and_canonical & 0x1) == 0x1;
3167 case kTypeArgumentsCid:
3178 case kGrowableObjectArrayCid:
3184 case kCapabilityCid:
3187 case kTransferableTypedDataCid:
3197 case kImmutableArrayCid:
3199 case kOneByteStringCid:
3201 case kTwoByteStringCid:
3212 FATAL(
"No cluster defined for cid %" Pd,
cid);
3269 while (stack_.length() > 0) {
3279 intptr_t num_clusters = 0;
3281 if (
static_cast<intptr_t
>(cluster->phase()) !=
i)
continue;
3286 if (
static_cast<intptr_t
>(cluster->phase()) !=
i)
continue;
3288 cluster->WriteNodes(
this);
3291 if (
static_cast<intptr_t
>(cluster->phase()) !=
i)
continue;
3292 cluster->WriteEdges(
this);
3308 while (stack_.length() > 0) {
3309 if (!
Trace(stack_.RemoveLast())) {
3320 intptr_t num_clusters = 0;
3322 if (
static_cast<intptr_t
>(cluster->phase()) !=
i)
continue;
3327 if (
static_cast<intptr_t
>(cluster->phase()) !=
i)
continue;
3329 cluster->WriteNodesApi(
this);
3332 if (
static_cast<intptr_t
>(cluster->phase()) !=
i)
continue;
3333 cluster->WriteEdgesApi(
this);
3361 for (intptr_t
i = 0;
i < num_clusters;
i++) {
3365 for (intptr_t
i = 0;
i < num_clusters;
i++) {
3368 for (intptr_t
i = 0;
i < num_clusters;
i++) {
3370 if (
error.IsError()) {
3398 for (intptr_t
i = 0;
i < num_clusters;
i++) {
3402 for (intptr_t
i = 0;
i < num_clusters;
i++) {
3405 for (intptr_t
i = 0;
i < num_clusters;
i++) {
3422 }
else if (same_group) {
3427 return std::make_unique<Message>(dest_port, handle, priority);
3433 return serializer.
Finish(dest_port, priority);
3444 return serializer.
Finish(dest_port, priority);
3456 ASSERT(msg_array.Length() == 3);
3457 msg_obj = msg_array.At(0);
3459 const auto& objects_to_rehash =
Object::Handle(zone, msg_array.At(1));
3468 const auto& objects_to_rehash =
Object::Handle(zone, msg_array.At(2));
3476 return msg_obj.
ptr();
3482 }
else if (
message->IsFinalizerInvocationRequest()) {
3485 ASSERT(msg_obj.IsFinalizer() || msg_obj.IsNativeFinalizer());
3486 return msg_obj.
ptr();
3487 }
else if (
message->IsPersistentHandle()) {
3492 if (setjmp(*jump.
Set()) == 0) {
static uint32_t hash(const SkShaderBase::GradientInfo &v)
#define ASSERT_EQUAL(expected, actual)
#define RELEASE_ASSERT(cond)
ApiMessageDeserializer(Zone *zone, Message *message)
Dart_CObject * Allocate(Dart_CObject_Type type)
void AssignRef(Dart_CObject *object)
~ApiMessageDeserializer()
Dart_CObject * Deserialize()
void AddBaseObject(Dart_CObject *base_object)
Dart_CObject * Ref(intptr_t index) const
void ForwardRef(Dart_CObject *old, Dart_CObject *nue)
void Push(Dart_CObject *object)
intptr_t GetObjectId(Dart_CObject *object) const
DART_NOINLINE intptr_t AssignRef(Dart_CObject *object)
bool Serialize(Dart_CObject *root)
ApiMessageSerializer(Zone *zone)
void SetObjectId(Dart_CObject *object, intptr_t id)
void WriteRef(Dart_CObject *object)
bool Fail(const char *message)
DART_NOINLINE void AddBaseObject(Dart_CObject *base_object)
bool Trace(Dart_CObject *object)
bool MarkObjectId(Dart_CObject *object, intptr_t id)
static bool Convert(const ObjectPtr raw_obj, Dart_CObject *c_obj)
static bool CanConvert(const ObjectPtr raw_obj)
PersistentHandle * AllocatePersistentHandle()
void ReadEdgesApi(ApiMessageDeserializer *d)
void ReadNodes(MessageDeserializer *d)
~ArrayMessageDeserializationCluster()
ArrayMessageDeserializationCluster(bool is_canonical, intptr_t cid)
void ReadEdges(MessageDeserializer *d)
ObjectPtr PostLoad(MessageDeserializer *d)
void ReadNodesApi(ApiMessageDeserializer *d)
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
void WriteNodes(MessageSerializer *s)
void WriteEdgesApi(ApiMessageSerializer *s)
void WriteEdges(MessageSerializer *s)
void WriteNodesApi(ApiMessageSerializer *s)
ArrayMessageSerializationCluster(Zone *zone, bool is_canonical, intptr_t cid)
~ArrayMessageSerializationCluster()
void Trace(MessageSerializer *s, Object *object)
ArrayPtr Slice(intptr_t start, intptr_t count, bool with_type_argument) const
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
static constexpr bool IsValidLength(intptr_t len)
ObjectPtr At(intptr_t index) const
static ArrayPtr NewUninitialized(intptr_t len, Heap::Space space=Heap::kNew)
void SetAt(intptr_t index, const Object &value) const
void Advance(intptr_t value)
MessageDeserializationCluster * ReadCluster()
const uint8_t * CurrentBufferAddress() const
uword ReadWordWith32BitReads()
MessageFinalizableData * finalizable_data_
intptr_t next_index() const
BaseDeserializer(Zone *zone, Message *message)
void ReadBytes(void *addr, intptr_t len)
MessageFinalizableData * finalizable_data() const
BaseSerializer(Thread *thread, Zone *zone)
GrowableArray< MessageSerializationCluster * > clusters_
void WriteBytes(const void *addr, intptr_t len)
intptr_t next_ref_index() const
MessageSerializationCluster * NewClusterForClass(intptr_t cid, bool is_canonical)
MessageFinalizableData * finalizable_data_
intptr_t num_base_objects_
void WriteCluster(MessageSerializationCluster *cluster)
std::unique_ptr< Message > Finish(Dart_Port dest_port, Message::Priority priority)
void WriteUnsigned(intptr_t value)
MallocWriteStream stream_
void WriteAscii(const String &str)
intptr_t num_written_objects_
MessageFinalizableData * finalizable_data() const
void WriteWordWith32BitWrites(uword value)
void WriteBytes(const void *addr, intptr_t len)
void WriteWordWith32BitWrites(uword value)
void WriteUnsigned(T value)
static const Bool & False()
static const Bool & True()
CapabilityMessageDeserializationCluster()
void ReadNodes(MessageDeserializer *d)
~CapabilityMessageDeserializationCluster()
void ReadNodesApi(ApiMessageDeserializer *d)
void WriteNodesApi(ApiMessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
~CapabilityMessageSerializationCluster()
CapabilityMessageSerializationCluster(Zone *zone)
void WriteNodes(MessageSerializer *s)
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
static CapabilityPtr New(uint64_t id, Heap::Space space=Heap::kNew)
static AbstractTypePtr FinalizeType(const AbstractType &type, FinalizationKind finalization=kCanonicalize)
~ClassMessageDeserializationCluster()
void ReadNodesApi(ApiMessageDeserializer *d)
ClassMessageDeserializationCluster()
void ReadNodes(MessageDeserializer *d)
void WriteNodes(MessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
~ClassMessageSerializationCluster()
ClassMessageSerializationCluster()
LibraryPtr library() const
ErrorPtr EnsureIsFinalized(Thread *thread) const
static ObjectPtr RehashObjectsInDartCollection(Thread *thread, const Object &array_or_growable_array)
static ObjectPtr RehashObjectsInDartCore(Thread *thread, const Object &array_or_growable_array)
DoubleMessageDeserializationCluster(bool is_canonical)
~DoubleMessageDeserializationCluster()
void ReadNodesApi(ApiMessageDeserializer *d)
void ReadNodes(MessageDeserializer *d)
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
void WriteNodesApi(ApiMessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
void WriteNodes(MessageSerializer *s)
DoubleMessageSerializationCluster(Zone *zone, bool is_canonical)
~DoubleMessageSerializationCluster()
static DoublePtr New(double d, Heap::Space space=Heap::kNew)
static DoublePtr NewCanonical(double d)
static DART_NORETURN void ThrowByType(ExceptionType type, const Array &arguments)
void ReadNodes(MessageDeserializer *d)
void ReadNodesApi(ApiMessageDeserializer *d)
ExternalTypedDataMessageDeserializationCluster(intptr_t cid)
~ExternalTypedDataMessageDeserializationCluster()
ExternalTypedDataMessageSerializationCluster(Zone *zone, intptr_t cid)
void WriteNodes(MessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
void WriteNodesApi(ApiMessageSerializer *s)
~ExternalTypedDataMessageSerializationCluster()
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
static ExternalTypedDataPtr New(intptr_t class_id, uint8_t *data, intptr_t len, Heap::Space space=Heap::kNew, bool perform_eager_msan_initialization_check=true)
static intptr_t MaxElements(intptr_t class_id)
void EnsureFreedExternal(IsolateGroup *isolate_group)
static intptr_t value_offset()
static intptr_t value_offset()
void ReadNodesApi(ApiMessageDeserializer *d)
void ReadNodes(MessageDeserializer *d)
void ReadEdgesApi(ApiMessageDeserializer *d)
~GrowableObjectArrayMessageDeserializationCluster()
GrowableObjectArrayMessageDeserializationCluster()
ObjectPtr PostLoad(MessageDeserializer *d)
void ReadEdges(MessageDeserializer *d)
GrowableObjectArrayMessageSerializationCluster()
void WriteEdges(MessageSerializer *s)
~GrowableObjectArrayMessageSerializationCluster()
void WriteNodes(MessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
void SetLength(intptr_t value) const
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
ObjectPtr At(intptr_t index) const
static intptr_t InstanceSize()
static intptr_t value_offset()
static IntegerPtr New(const String &str, Heap::Space space=Heap::kNew)
static IsolateGroup * Current()
ApiState * api_state() const
void set_forward_table_old(WeakTable *table)
void set_forward_table_new(WeakTable *table)
WeakTable * forward_table_old()
WeakTable * forward_table_new()
ClassPtr toplevel_class() const
ClassPtr LookupClass(const String &name) const
static LibraryPtr LookupLibrary(Thread *thread, const String &url)
uint8_t * Steal(intptr_t *length)
ObjectPtr PostLoad(MessageDeserializer *d)
~MapMessageDeserializationCluster()
void ReadEdges(MessageDeserializer *d)
MapMessageDeserializationCluster(bool is_canonical, intptr_t cid)
void ReadNodes(MessageDeserializer *d)
void WriteEdges(MessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
void WriteNodes(MessageSerializer *s)
MapMessageSerializationCluster(Zone *zone, bool is_canonical, intptr_t cid)
~MapMessageSerializationCluster()
virtual void ReadNodesApi(ApiMessageDeserializer *d)
MessageDeserializationCluster(const char *name, bool is_canonical=false)
virtual ~MessageDeserializationCluster()
const char * name() const
void ReadNodesWrappedApi(ApiMessageDeserializer *d)
virtual void ReadEdgesApi(ApiMessageDeserializer *d)
void ReadNodesWrapped(MessageDeserializer *d)
ObjectPtr PostLoadAbstractType(MessageDeserializer *d)
virtual void PostLoadApi(ApiMessageDeserializer *d)
bool is_canonical() const
DISALLOW_COPY_AND_ASSIGN(MessageDeserializationCluster)
ObjectPtr PostLoadLinkedHash(MessageDeserializer *d)
virtual ObjectPtr PostLoad(MessageDeserializer *d)
virtual void ReadEdges(MessageDeserializer *d)
virtual void ReadNodes(MessageDeserializer *d)=0
IsolateGroup * isolate_group() const
MessageDeserializer(Thread *thread, Message *message)
void AssignRef(ObjectPtr object)
DART_NOINLINE void AddBaseObject(ObjectPtr base_object)
ObjectPtr Ref(intptr_t index) const
void UpdateRef(intptr_t index, const Object &new_object)
void SerializationSucceeded()
virtual void WriteEdgesApi(ApiMessageSerializer *s)
virtual void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
virtual ~MessageSerializationCluster()
MessagePhase phase() const
DISALLOW_COPY_AND_ASSIGN(MessageSerializationCluster)
bool is_canonical() const
MessageSerializationCluster(const char *name, MessagePhase phase, intptr_t cid, bool is_canonical=false)
virtual void WriteEdges(MessageSerializer *s)
virtual void Trace(MessageSerializer *s, Object *object)=0
virtual void WriteNodes(MessageSerializer *s)=0
const char * name() const
const MessagePhase phase_
virtual void WriteNodesApi(ApiMessageSerializer *s)
bool HasRef(ObjectPtr object) const
Isolate * isolate() const
intptr_t GetObjectId(ObjectPtr object) const
DART_NOINLINE void AddBaseObject(ObjectPtr base_object)
IsolateGroup * isolate_group() const
DART_NOINLINE void WriteRef(ObjectPtr object)
bool MarkObjectId(ObjectPtr object, intptr_t id)
MessageSerializer(Thread *thread)
DART_NOINLINE void AssignRef(ObjectPtr object)
void Push(ObjectPtr object)
void Serialize(const Object &root)
void AssignRef(Object *object)
void Trace(const Object &root, Object *object)
void SetObjectId(ObjectPtr object, intptr_t id)
void IllegalObject(const Object &object, const char *message)
static std::unique_ptr< Message > New(Args &&... args)
~MintMessageDeserializationCluster()
void ReadNodes(MessageDeserializer *d)
void ReadNodesApi(ApiMessageDeserializer *d)
MintMessageDeserializationCluster(bool is_canonical)
void WriteNodes(MessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
~MintMessageSerializationCluster()
MintMessageSerializationCluster(Zone *zone, bool is_canonical)
void WriteNodesApi(ApiMessageSerializer *s)
static MintPtr NewCanonical(int64_t value)
static MintPtr New(int64_t value, Heap::Space space=Heap::kNew)
void ReadNodes(MessageDeserializer *d)
NativePointerMessageDeserializationCluster()
~NativePointerMessageDeserializationCluster()
void ReadNodesApi(ApiMessageDeserializer *d)
void WriteNodesApi(ApiMessageSerializer *s)
NativePointerMessageSerializationCluster(Zone *zone)
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
void WriteNodes(MessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
~NativePointerMessageSerializationCluster()
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
UntaggedObject * untag() const
static ObjectPtr Allocate(intptr_t cls_id, intptr_t size, Heap::Space space, bool compressed, uword ptr_field_start_offset, uword ptr_field_end_offset)
static constexpr bool ContainsCompressedPointers()
static ObjectPtr RawCast(ObjectPtr obj)
static Object & ZoneHandle()
void ReadNodesApi(ApiMessageDeserializer *d)
~OneByteStringMessageDeserializationCluster()
void ReadNodes(MessageDeserializer *d)
OneByteStringMessageDeserializationCluster(bool is_canonical)
OneByteStringMessageSerializationCluster(Zone *zone, bool is_canonical)
~OneByteStringMessageSerializationCluster()
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
void Trace(MessageSerializer *s, Object *object)
void WriteNodesApi(ApiMessageSerializer *s)
void WriteNodes(MessageSerializer *s)
void set_ptr(ObjectPtr ref)
static Dart_CObject * cobj_empty_array()
static Dart_CObject * cobj_null()
static PredefinedCObjects & getInstance()
uword ReadWordWith32BitReads()
const uint8_t * AddressOfCurrentPosition() const
void Advance(intptr_t value)
void ReadBytes(void *addr, intptr_t len)
void ReadNodesApi(ApiMessageDeserializer *d)
~SendPortMessageDeserializationCluster()
void ReadNodes(MessageDeserializer *d)
SendPortMessageDeserializationCluster()
void WriteNodesApi(ApiMessageSerializer *s)
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
~SendPortMessageSerializationCluster()
void Trace(MessageSerializer *s, Object *object)
void WriteNodes(MessageSerializer *s)
SendPortMessageSerializationCluster(Zone *zone)
static SendPortPtr New(Dart_Port id, Heap::Space space=Heap::kNew)
ObjectPtr PostLoad(MessageDeserializer *d)
void ReadEdges(MessageDeserializer *d)
SetMessageDeserializationCluster(bool is_canonical, intptr_t cid)
~SetMessageDeserializationCluster()
void ReadNodes(MessageDeserializer *d)
void Trace(MessageSerializer *s, Object *object)
void WriteNodes(MessageSerializer *s)
SetMessageSerializationCluster(Zone *zone, bool is_canonical, intptr_t cid)
void WriteEdges(MessageSerializer *s)
~SetMessageSerializationCluster()
void ReadNodes(MessageDeserializer *d)
Simd128MessageDeserializationCluster(intptr_t cid)
~Simd128MessageDeserializationCluster()
Simd128MessageSerializationCluster(intptr_t cid)
~Simd128MessageSerializationCluster()
void Trace(MessageSerializer *s, Object *object)
void WriteNodes(MessageSerializer *s)
void ReadNodes(MessageDeserializer *d)
~SmiMessageDeserializationCluster()
SmiMessageDeserializationCluster()
void ReadNodesApi(ApiMessageDeserializer *d)
void Trace(MessageSerializer *s, Object *object)
SmiMessageSerializationCluster(Zone *zone)
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
void WriteNodesApi(ApiMessageSerializer *s)
void WriteNodes(MessageSerializer *s)
~SmiMessageSerializationCluster()
static SmiPtr New(intptr_t value)
static bool IsValid(int64_t value)
ThreadState * thread() const
static StringPtr FromLatin1(const uint8_t *latin1_array, intptr_t array_len, Heap::Space space=Heap::kNew)
static constexpr intptr_t kMaxElements
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
uint16_t CharAt(intptr_t index) const
static const char * ToCString(Thread *thread, StringPtr ptr)
static StringPtr FromUTF16(const uint16_t *utf16_array, intptr_t array_len, Heap::Space space=Heap::kNew)
static StringPtr FromUTF16(Thread *thread, const uint16_t *utf16_array, intptr_t len)
static StringPtr FromLatin1(Thread *thread, const uint8_t *latin1_array, intptr_t len)
static Thread * Current()
DART_WARN_UNUSED_RESULT ErrorPtr StealStickyError()
Isolate * isolate() const
IsolateGroup * isolate_group() const
void ReadNodesApi(ApiMessageDeserializer *d)
~TransferableTypedDataMessageDeserializationCluster()
void ReadNodes(MessageDeserializer *d)
TransferableTypedDataMessageDeserializationCluster()
TransferableTypedDataMessageSerializationCluster()
void Trace(MessageSerializer *s, Object *object)
void WriteNodes(MessageSerializer *s)
~TransferableTypedDataMessageSerializationCluster()
FinalizablePersistentHandle * handle() const
static TransferableTypedDataPtr New(uint8_t *data, intptr_t len)
void ReadNodes(MessageDeserializer *d)
~TwoByteStringMessageDeserializationCluster()
TwoByteStringMessageDeserializationCluster(bool is_canonical)
void ReadNodesApi(ApiMessageDeserializer *d)
~TwoByteStringMessageSerializationCluster()
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
void WriteNodes(MessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
TwoByteStringMessageSerializationCluster(Zone *zone, bool is_canonical)
void WriteNodesApi(ApiMessageSerializer *s)
void ReadEdgesApi(ApiMessageDeserializer *d)
void ReadEdges(MessageDeserializer *d)
void ReadNodes(MessageDeserializer *d)
TypeArgumentsMessageDeserializationCluster(bool is_canonical)
void ReadNodesApi(ApiMessageDeserializer *d)
~TypeArgumentsMessageDeserializationCluster()
ObjectPtr PostLoad(MessageDeserializer *d)
void WriteNodes(MessageSerializer *s)
void WriteEdges(MessageSerializer *s)
~TypeArgumentsMessageSerializationCluster()
TypeArgumentsMessageSerializationCluster(bool is_canonical)
void Trace(MessageSerializer *s, Object *object)
intptr_t nullability() const
TypeArgumentsPtr Canonicalize(Thread *thread) const
static TypeArgumentsPtr New(intptr_t len, Heap::Space space=Heap::kOld)
TypeMessageDeserializationCluster(bool is_canonical)
void ReadEdgesApi(ApiMessageDeserializer *d)
void ReadEdges(MessageDeserializer *d)
void ReadNodesApi(ApiMessageDeserializer *d)
ObjectPtr PostLoad(MessageDeserializer *d)
~TypeMessageDeserializationCluster()
void ReadNodes(MessageDeserializer *d)
TypeMessageSerializationCluster(bool is_canonical)
~TypeMessageSerializationCluster()
void Trace(MessageSerializer *s, Object *object)
void WriteNodes(MessageSerializer *s)
void WriteEdges(MessageSerializer *s)
static CodePtr DefaultCodeForType(const AbstractType &type, bool lazy_specialize=true)
static TypePtr New(const Class &clazz, const TypeArguments &arguments, Nullability nullability=Nullability::kNonNullable, Heap::Space space=Heap::kOld)
intptr_t ElementSizeInBytes() const
void ReadNodesApi(ApiMessageDeserializer *d)
void ReadNodes(MessageDeserializer *d)
~TypedDataMessageDeserializationCluster()
TypedDataMessageDeserializationCluster(intptr_t cid)
void WriteNodes(MessageSerializer *s)
TypedDataMessageSerializationCluster(Zone *zone, intptr_t cid)
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
void Trace(MessageSerializer *s, Object *object)
void WriteNodesApi(ApiMessageSerializer *s)
~TypedDataMessageSerializationCluster()
void ReadNodesApi(ApiMessageDeserializer *d)
void ReadEdgesApi(ApiMessageDeserializer *d)
void ReadEdges(MessageDeserializer *d)
~TypedDataViewMessageDeserializationCluster()
void PostLoadApi(ApiMessageDeserializer *d)
TypedDataViewMessageDeserializationCluster(intptr_t cid)
void ReadNodes(MessageDeserializer *d)
ObjectPtr PostLoad(MessageDeserializer *d)
void WriteEdges(MessageSerializer *s)
TypedDataViewMessageSerializationCluster(Zone *zone, intptr_t cid)
void WriteNodesApi(ApiMessageSerializer *s)
void Trace(MessageSerializer *s, Object *object)
~TypedDataViewMessageSerializationCluster()
void WriteNodes(MessageSerializer *s)
void TraceApi(ApiMessageSerializer *s, Dart_CObject *object)
static TypedDataViewPtr New(intptr_t class_id, Heap::Space space=Heap::kNew)
TypedDataBasePtr typed_data() const
SmiPtr offset_in_bytes() const
static intptr_t MaxElements(intptr_t class_id)
static TypedDataPtr New(intptr_t class_id, intptr_t len, Heap::Space space=Heap::kNew)
static bool IsSurrogate(uint32_t ch)
static int32_t Next(const uint16_t *characters, intptr_t *i, intptr_t len)
static intptr_t Length(int32_t ch)
static intptr_t CodeUnitCount(const uint8_t *utf8_array, intptr_t array_len, Type *type)
static bool IsValid(const uint8_t *utf8_array, intptr_t array_len)
static bool DecodeToUTF16(const uint8_t *utf8_array, intptr_t array_len, uint16_t *dst, intptr_t len)
static bool DecodeToLatin1(const uint8_t *utf8_array, intptr_t array_len, uint8_t *dst, intptr_t len)
static intptr_t Encode(int32_t ch, char *dst)
static constexpr intptr_t kNoValue
bool MarkValueExclusive(ObjectPtr key, intptr_t val)
void SetValueExclusive(ObjectPtr key, intptr_t val)
intptr_t GetValueExclusive(ObjectPtr key) const
ElementType * Alloc(intptr_t length)
@ Dart_TypedData_kFloat32x4
@ Dart_TypedData_kInt32x4
@ Dart_TypedData_kFloat64x2
@ Dart_TypedData_kFloat32
@ Dart_TypedData_kFloat64
@ Dart_TypedData_kUint8Clamped
@ Dart_CObject_kNativePointer
@ Dart_CObject_kUnmodifiableExternalTypedData
@ Dart_CObject_kTypedData
@ Dart_CObject_kUnsupported
@ Dart_CObject_kExternalTypedData
@ Dart_CObject_kCapability
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
bool IsTypedDataViewClassId(intptr_t index)
bool IsTypedDataClassId(intptr_t index)
@ kExternalBetweenIsolateGroups
ObjectPtr ReadMessage(Thread *thread, Message *message)
static Dart_CObject cobj_transition_sentinel
const int kTypedDataCidRemainderUnmodifiable
ObjectPtr ReadObjectGraphCopyMessage(Thread *thread, PersistentHandle *handle)
const char * FindRetainingPath(Zone *zone_, Isolate *isolate, const Object &from, const Object &to, TraversalRules traversal_rules)
constexpr int32_t kMinInt32
static Dart_CObject cobj_empty_type_arguments
void * malloc(size_t size)
static Dart_CObject cobj_true
const int kTypedDataCidRemainderInternal
ObjectPtr CopyMutableObjectGraph(const Object &object)
bool IsUnmodifiableTypedDataViewClassId(intptr_t index)
@ kUnmodifiableByteDataViewCid
constexpr uint32_t kMaxUint32
static constexpr intptr_t kUnallocatedReference
static Dart_CObject cobj_false
const int kTypedDataCidRemainderExternal
static Dart_CObject cobj_dynamic_type
Dart_CObject * ReadApiMessage(Zone *zone, Message *message)
static void IsolateMessageTypedDataFinalizer(void *isolate_callback_data, void *buffer)
raw_obj untag() -> num_entries()) VARIABLE_COMPRESSED_VISITOR(Array, Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(TypedData, TypedData::ElementSizeInBytes(raw_obj->GetClassId()) *Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(Record, RecordShape(raw_obj->untag() ->shape()).num_fields()) VARIABLE_NULL_VISITOR(CompressedStackMaps, CompressedStackMaps::PayloadSizeOf(raw_obj)) VARIABLE_NULL_VISITOR(OneByteString, Smi::Value(raw_obj->untag() ->length())) VARIABLE_NULL_VISITOR(TwoByteString, Smi::Value(raw_obj->untag() ->length())) intptr_t UntaggedField::VisitFieldPointers(FieldPtr raw_obj, ObjectPointerVisitor *visitor)
static constexpr intptr_t kFirstReference
std::unique_ptr< Message > WriteMessage(bool same_group, const Object &obj, Dart_Port dest_port, Message::Priority priority)
constexpr int32_t kMaxInt32
std::unique_ptr< Message > WriteApiMessage(Zone *zone, Dart_CObject *obj, Dart_Port dest_port, Message::Priority priority)
static Dart_CObject cobj_void_type
static Dart_CObject cobj_sentinel
static int8_t data[kExtLength]
bool IsExternalTypedDataClassId(intptr_t index)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service port
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
union _Dart_CObject::@86 value
struct _Dart_CObject::@86::@88 as_capability
struct _Dart_CObject::@86::@90 as_typed_data
struct _Dart_CObject::@86::@91 as_external_typed_data
struct _Dart_CObject::@86::@89 as_array
struct _Dart_CObject ** values
Dart_HandleFinalizer callback
Dart_CObject * typed_data
Dart_CObject * offset_in_bytes