19#define H (translation_helper_)
20#define T (type_translator_)
21#define I Isolate::Current()
22#define IG IsolateGroup::Current()
29 zone_(thread->zone()),
30 isolate_group_(thread->isolate_group()),
37 constants_(
Array::Handle(
Z)),
40 name_index_handle_(
Smi::Handle(
Z)) {}
44 zone_(thread->zone()),
45 isolate_group_(thread->isolate_group()),
46 allocation_space_(space),
52 constants_(
Array::Handle(
Z)),
55 name_index_handle_(
Smi::Handle(
Z)) {}
129 return string_offsets_.GetUint32(index << 2);
139 return string_data_.GetUint8(
StringOffset(string_index) + index);
151 return reinterpret_cast<uint8_t*
>(string_data_.
DataAddr(0)) +
157 intptr_t
length = strlen(other);
168 return NameIndex(
static_cast<intptr_t
>(canonical_names_.GetUint32(8 *
name)) -
360 if (
IG->obfuscate()) {
376 if (
IG->obfuscate()) {
386 ManglePrivateName(lib, &
name);
444 ManglePrivateName(parent, &
name);
457 ManglePrivateName(parent, &
name);
469 return ManglePrivateName(parent, &
name);
480 return ManglePrivateName(parent, &
name);
519 name_index_handle_ =
Smi::New(kernel_library);
520 LibraryPtr raw_lib = info_.
LookupLibrary(thread_, name_index_handle_);
527 const String& library_name =
538 name_index_handle_ =
Smi::New(kernel_library);
539 return info_.
InsertLibrary(thread_, name_index_handle_, library);
546 name_index_handle_ =
Smi::New(kernel_class);
547 ClassPtr raw_class = info_.
LookupClass(thread_, name_index_handle_);
572 name_index_handle_ =
Smi::New(kernel_class);
573 return info_.
InsertClass(thread_, name_index_handle_, klass);
580 const auto& library =
582 if (library.IsNull()) {
585 return library.toplevel_class();
608 if (field.
IsNull() && required) {
631 if (field.
IsNull() && required) {
658 if (
function.IsNull() && required) {
676 if (
function.IsNull() && required) {
691 if (
function.IsNull() && required) {
719 const String& method_name,
728 if (
function.IsNull() && required) {
758 if (member.
IsNull() && required) {
768 while (!iterate_klass.
IsNull()) {
797 if (num_type_params > 0) {
800 for (intptr_t
i = 0;
i < num_type_params;
i++) {
814 bool is_setter =
function.IsImplicitSetterFunction();
815 bool is_method = !
function.IsStaticFunction();
816 intptr_t parameter_count = (is_method ? 1 : 0) + (is_setter ? 1 : 0);
821 if (parameter_count > 0) {
835 function.SetParameterNameAt(
pos, Symbols::Value());
892 if (name_to_modify->
Length() >= 1 && name_to_modify->
CharAt(0) ==
'_') {
895 *name_to_modify = library.
PrivateName(*name_to_modify);
896 if (obfuscate &&
IG->obfuscate()) {
899 *name_to_modify = obfuscator.Rename(*name_to_modify);
901 }
else if (symbolize) {
902 *name_to_modify =
Symbols::New(thread_, *name_to_modify);
903 if (obfuscate &&
IG->obfuscate()) {
905 Obfuscator obfuscator(thread_, library_key);
906 *name_to_modify = obfuscator.Rename(*name_to_modify);
909 return *name_to_modify;
912String& TranslationHelper::ManglePrivateName(
const Library& library,
913 String* name_to_modify,
916 if (name_to_modify->Length() >= 1 && name_to_modify->CharAt(0) ==
'_' &&
918 *name_to_modify = library.PrivateName(*name_to_modify);
919 if (obfuscate &&
IG->obfuscate()) {
920 const String& library_key =
String::Handle(library.private_key());
921 Obfuscator obfuscator(thread_, library_key);
922 *name_to_modify = obfuscator.Rename(*name_to_modify);
924 }
else if (symbolize) {
925 *name_to_modify =
Symbols::New(thread_, *name_to_modify);
926 if (obfuscate &&
IG->obfuscate()) {
928 Obfuscator obfuscator(thread_, library_key);
929 *name_to_modify = obfuscator.Rename(*name_to_modify);
932 return *name_to_modify;
936 if (field <= next_read_)
return;
939 switch (next_read_) {
942 ASSERT(tag == kFunctionNode);
943 if (++next_read_ == field)
return;
948 if (++next_read_ == field)
return;
952 if (++next_read_ == field)
return;
956 if (++next_read_ == field)
return;
961 if (++next_read_ == field)
return;
965 if (++next_read_ == field)
return;
970 if (++next_read_ == field)
return;
975 if (++next_read_ == field)
return;
979 if (++next_read_ == field)
return;
983 if (++next_read_ == field)
return;
987 if (++next_read_ == field)
return;
991 if (++next_read_ == field)
return;
995 if (tag == kSomething) {
998 if (tag == kSomething) {
1004 if (tag == kSomething) {
1012 if (++next_read_ == field)
return;
1016 if (helper_->
ReadTag() == kSomething)
1018 if (++next_read_ == field)
return;
1026 for (; next_read_ < field; ++next_read_) {
1027 switch (next_read_) {
1053 if (field <= next_read_)
return;
1056 switch (next_read_) {
1059 if (++next_read_ == field)
return;
1063 if (++next_read_ == field)
return;
1070 if (++next_read_ == field)
return;
1074 if (++next_read_ == field)
return;
1078 if (++next_read_ == field)
return;
1082 if (++next_read_ == field)
return;
1085 if (helper_->
ReadTag() == kSomething)
1087 if (++next_read_ == field)
return;
1095 : helper_(helper), next_read_(kStart) {
1100 if (field <= next_read_)
return;
1103 switch (next_read_) {
1107 if (++next_read_ == field)
return;
1113 if (++next_read_ == field)
return;
1118 if (++next_read_ == field)
return;
1123 if (++next_read_ == field)
return;
1128 if (++next_read_ == field)
return;
1132 if (++next_read_ == field)
return;
1136 if (++next_read_ == field)
return;
1140 if (++next_read_ == field)
return;
1144 if (++next_read_ == field)
return;
1151 if (++next_read_ == field)
return;
1156 if (++next_read_ == field)
return;
1159 if (helper_->
ReadTag() == kSomething) {
1162 if (++next_read_ == field)
return;
1170 if (field <= next_read_)
return;
1173 switch (next_read_) {
1176 ASSERT(tag == kProcedure);
1177 if (++next_read_ == field)
return;
1183 if (++next_read_ == field)
return;
1188 if (++next_read_ == field)
return;
1192 if (++next_read_ == field)
return;
1196 if (++next_read_ == field)
return;
1200 if (++next_read_ == field)
return;
1204 if (++next_read_ == field)
return;
1208 if (++next_read_ == field)
return;
1212 if (++next_read_ == field)
return;
1216 if (++next_read_ == field)
return;
1223 if (++next_read_ == field)
return;
1233 if (++next_read_ == field)
return;
1237 if (++next_read_ == field)
return;
1241 if (++next_read_ == field)
return;
1249 if (field <= next_read_)
return;
1252 switch (next_read_) {
1255 ASSERT(tag == kConstructor);
1256 if (++next_read_ == field)
return;
1262 if (++next_read_ == field)
return;
1267 if (++next_read_ == field)
return;
1271 if (++next_read_ == field)
return;
1275 if (++next_read_ == field)
return;
1279 if (++next_read_ == field)
return;
1283 if (++next_read_ == field)
return;
1287 if (++next_read_ == field)
return;
1294 if (++next_read_ == field)
return;
1299 if (++next_read_ == field)
return;
1302 intptr_t list_length =
1304 for (intptr_t
i = 0;
i < list_length;
i++) {
1307 if (++next_read_ == field)
return;
1316 if (field <= next_read_)
return;
1319 switch (next_read_) {
1323 if (++next_read_ == field)
return;
1329 if (++next_read_ == field)
return;
1334 if (++next_read_ == field)
return;
1338 if (++next_read_ == field)
return;
1342 if (++next_read_ == field)
return;
1346 if (++next_read_ == field)
return;
1350 if (++next_read_ == field)
return;
1354 if (++next_read_ == field)
return;
1361 if (++next_read_ == field)
return;
1366 if (++next_read_ == field)
return;
1370 if (type_tag == kSomething) {
1373 if (++next_read_ == field)
return;
1378 if (type_tag == kSomething) {
1381 if (++next_read_ == field)
return;
1386 if (++next_read_ == field)
return;
1389 intptr_t list_length =
1391 for (intptr_t
i = 0;
i < list_length;
i++) {
1395 if (++next_read_ == field)
return;
1399 intptr_t list_length =
1401 for (intptr_t
i = 0;
i < list_length;
i++) {
1406 if (++next_read_ == field)
return;
1416 if (++next_read_ == field)
return;
1426 if (++next_read_ == field)
return;
1434 if (field <= next_read_)
return;
1437 switch (next_read_) {
1442 if (++next_read_ == field)
return;
1448 if (++next_read_ == field)
return;
1454 if (++next_read_ == field)
return;
1458 if (++next_read_ == field)
return;
1463 if (++next_read_ == field)
return;
1470 if (++next_read_ == field)
return;
1475 if (++next_read_ == field)
return;
1478 intptr_t dependency_count = helper_->
ReadUInt();
1479 for (intptr_t
i = 0;
i < dependency_count; ++
i) {
1482 if (++next_read_ == field)
return;
1489 if (field <= next_read_)
return;
1492 switch (next_read_) {
1495 if (++next_read_ == field)
return;
1500 if (++next_read_ == field)
return;
1508 if (++next_read_ == field)
return;
1513 if (++next_read_ == field)
return;
1518 if (++next_read_ == field)
return;
1523 for (intptr_t
i = 0;
i <
count; ++
i) {
1529 if (++next_read_ == field)
return;
1539void MetadataHelper::VerifyMetadataMappings(
1542 Reader reader(metadata_mappings);
1543 if (reader.size() == 0) {
1551 const intptr_t metadata_num = reader.ReadUInt32At(
offset);
1553 if (metadata_num == 0) {
1559 for (intptr_t
i = 0;
i < metadata_num; ++
i) {
1562 const intptr_t mappings_num = reader.ReadUInt32At(
offset);
1568 intptr_t prev_node_offset = -1;
1569 reader.set_offset(
offset);
1570 for (intptr_t j = 0; j < mappings_num; ++j) {
1571 const intptr_t node_offset = reader.ReadUInt32();
1572 const intptr_t md_offset = reader.ReadUInt32();
1574 ASSERT(node_offset >= 0 && md_offset >= 0);
1575 ASSERT(node_offset > prev_node_offset);
1576 prev_node_offset = node_offset;
1588 bool precompiler_only)
1590 translation_helper_(helper->translation_helper_),
1592 mappings_scanned_(
false),
1593 precompiler_only_(precompiler_only),
1594 mappings_offset_(0),
1596 last_node_offset_(0),
1597 last_mapping_index_(0) {}
1599void MetadataHelper::SetMetadataMappings(intptr_t mappings_offset,
1600 intptr_t mappings_num) {
1601 ASSERT((mappings_offset_ == 0) && (mappings_num_ == 0));
1602 ASSERT((mappings_offset != 0) && (mappings_num != 0));
1603 mappings_offset_ = mappings_offset;
1604 mappings_num_ = mappings_num;
1606 last_mapping_index_ = 0;
1609void MetadataHelper::ScanMetadataMappings() {
1611 Reader reader(
H.metadata_mappings());
1612 if (reader.size() == 0) {
1620 uint32_t metadata_num = reader.ReadUInt32At(
offset);
1622 if (metadata_num == 0) {
1628 for (uint32_t
i = 0;
i < metadata_num; ++
i) {
1631 uint32_t mappings_num = reader.ReadUInt32At(
offset);
1635 StringIndex tag = StringIndex(reader.ReadUInt32At(
offset));
1637 if (mappings_num == 0) {
1641 if (
H.StringEquals(tag, tag_)) {
1642 if ((!FLAG_precompiled_mode) && precompiler_only_) {
1643 FATAL(
"%s metadata is allowed in precompiled mode only", tag_);
1653 ASSERT(mappings_num_ > 0);
1655 Reader reader(
H.metadata_mappings());
1658 intptr_t right = mappings_num_ - 1;
1659 while (left < right) {
1660 intptr_t mid = ((right - left) / 2) + left;
1661 intptr_t mid_node_offset =
1664 if (node_offset < mid_node_offset) {
1666 }
else if (node_offset > mid_node_offset) {
1672 ASSERT((0 <= left) && (left <= mappings_num_));
1676 if (left < mappings_num_) {
1677 intptr_t found_node_offset =
1680 if (found_node_offset < node_offset) {
1684 ASSERT((left == mappings_num_) ||
1686 mappings_offset_ + left * 2 *
kUInt32Size)) >= node_offset);
1692 if (!mappings_scanned_) {
1693 ScanMetadataMappings();
1694 mappings_scanned_ =
true;
1697 if (mappings_num_ == 0) {
1705 if (node_offset < last_node_offset_) {
1709 intptr_t index = last_mapping_index_;
1710 intptr_t mapping_node_offset = 0;
1711 intptr_t mapping_md_offset = -1;
1713 Reader reader(
H.metadata_mappings());
1717 for (; index < mappings_num_; ++index) {
1721 if (mapping_node_offset >= node_offset) {
1726 last_mapping_index_ = index;
1727 last_node_offset_ = node_offset;
1729 if ((index < mappings_num_) && (mapping_node_offset == node_offset)) {
1730 ASSERT(mapping_md_offset >= 0);
1731 return mapping_md_offset;
1738 const intptr_t kComponentNodeOffset = 0;
1746bool DirectCallMetadataHelper::ReadMetadata(intptr_t node_offset,
1748 bool* check_receiver_for_null,
1749 intptr_t* closure_id) {
1751 if (md_offset < 0) {
1756 &
H.metadata_payloads(), md_offset);
1760 *check_receiver_for_null =
1764 if (closure_id !=
nullptr) {
1772 intptr_t node_offset) {
1774 bool check_receiver_for_null =
false;
1775 if (!ReadMetadata(node_offset, &kernel_name, &check_receiver_for_null)) {
1779 if (
H.IsProcedure(kernel_name) && !
H.IsGetter(kernel_name)) {
1781 const String& method_name =
H.DartMethodName(kernel_name);
1783 helper_->
zone_,
H.LookupMethodByMember(kernel_name, method_name));
1784 const String& getter_name =
H.DartGetterName(kernel_name);
1788 check_receiver_for_null);
1790 const String& getter_name =
H.DartGetterName(kernel_name);
1792 helper_->
zone_,
H.LookupMethodByMember(kernel_name, getter_name));
1799 intptr_t node_offset) {
1801 bool check_receiver_for_null =
false;
1802 if (!ReadMetadata(node_offset, &kernel_name, &check_receiver_for_null)) {
1806 const String& method_name =
H.DartSetterName(kernel_name);
1808 helper_->
zone_,
H.LookupMethodByMember(kernel_name, method_name));
1815 intptr_t node_offset) {
1817 bool check_receiver_for_null =
false;
1818 if (!ReadMetadata(node_offset, &kernel_name, &check_receiver_for_null)) {
1822 const String& method_name =
H.DartProcedureName(kernel_name);
1824 helper_->
zone_,
H.LookupMethodByMember(kernel_name, method_name));
1831 intptr_t node_offset) {
1833 bool check_receiver_for_null =
false;
1834 intptr_t closure_id = -1;
1835 if (!ReadMetadata(node_offset, &kernel_name, &check_receiver_for_null,
1840 const auto& member =
1843 if (member.IsField()) {
1844 const auto& field = Field::Cast(member);
1848 ASSERT(field.is_static() || field.is_late());
1849 ASSERT(field.has_nontrivial_initializer());
1850 function = field.EnsureInitializerFunction();
1852 function = Function::Cast(member).ptr();
1856 if (closure_id == 0) {
1858 ASSERT(!member.IsField());
1873 constant_reader_(constant_reader) {}
1876 intptr_t node_offset,
1877 bool read_constant) {
1879 if (md_offset < 0) {
1885 &
H.metadata_payloads(), md_offset);
1890 const Object* constant_value = &Object::null_object();
1893 if (read_constant) {
1899 if (
H.IsRoot(kernel_name)) {
1904 const Class& klass =
1908 intptr_t
cid = klass.
id();
1909 if (
cid == kClosureCid) {
1919 const int kMethodOrSetterCalledDynamicallyBit = 1 << 0;
1920 const int kNonThisUsesBit = 1 << 1;
1921 const int kTearOffUsesBit = 1 << 2;
1922 const int kThisUsesBit = 1 << 3;
1923 const int kGetterCalledDynamicallyBit = 1 << 4;
1926 (
flags & kMethodOrSetterCalledDynamicallyBit) != 0;
1937bool ProcedureAttributesMetadataHelper::ReadMetadata(
1938 intptr_t node_offset,
1941 if (md_offset < 0) {
1946 &
H.metadata_payloads(), md_offset);
1955ProcedureAttributesMetadata
1957 intptr_t node_offset) {
1959 ReadMetadata(node_offset, &metadata);
1967void ObfuscationProhibitionsMetadataHelper::ReadMetadata(intptr_t node_offset) {
1969 if (md_offset < 0) {
1974 &
H.metadata_payloads(), md_offset);
1978 for (
int i = 0;
i <
len; ++
i) {
1989void LoadingUnitsMetadataHelper::ReadMetadata(intptr_t node_offset) {
1991 if (md_offset < 0) {
1996 &
H.metadata_payloads(), md_offset);
2008 for (
int i = 0;
i < unit_count;
i++) {
2013 parent ^= loading_units.
At(parent_id);
2020 for (intptr_t j = 0; j < library_count; j++) {
2031 loading_units.
SetAt(
id, unit);
2032 loading_unit_uris.
SetAt(
id, uris);
2035 ObjectStore* object_store =
IG->object_store();
2037 object_store->set_loading_units(loading_units);
2039 object_store->set_loading_unit_uris(loading_unit_uris);
2046 type_translator_(*type_translator) {}
2048bool CallSiteAttributesMetadataHelper::ReadMetadata(
2049 intptr_t node_offset,
2052 if (md_offset < 0) {
2057 &
H.metadata_payloads(), md_offset);
2063CallSiteAttributesMetadata
2066 ReadMetadata(node_offset, &metadata);
2078 if (md_offset < 0) {
2083 &
H.metadata_payloads(), md_offset);
2088 for (intptr_t
i = 0;
i < num_selectors;
i++) {
2089 ReadTableSelectorInfo(&metadata->
selectors[
i]);
2094void TableSelectorMetadataHelper::ReadTableSelectorInfo(
2098 info->called_on_null = (
flags & kCalledOnNullBit) != 0;
2099 info->torn_off = (
flags & kTornOffBit) != 0;
2107 intptr_t node_offset) {
2110 if (md_offset < 0) {
2115 &
H.metadata_payloads(), md_offset);
2119 info->SetArgsCount(num_args);
2121 info->must_use_stack_calling_convention =
2123 info->has_overrides_with_less_direct_parameters =
2128 for (intptr_t
i = 0;
i < num_args;
i++) {
2129 info->unboxed_args_info[
i] = ReadUnboxingType();
2131 info->return_info = ReadUnboxingType();
2137UnboxingInfoMetadataHelper::ReadUnboxingType()
const {
2146 const Array* field_names = &Array::empty_array();
2147 if (num_named > 0) {
2149 for (intptr_t
i = 0;
i < num_named; ++
i) {
2154 names.MakeImmutable();
2155 field_names = &
names;
2157 const intptr_t num_fields = num_positional + num_named;
2160 return {kind, shape};
2228 return origin_name_index;
2235 if ((
H.StringSize(name_index) >= 1) &&
H.CharacterAt(name_index, 0) ==
'_') {
2243 if ((
H.StringSize(name_index) >= 1) &&
H.CharacterAt(name_index, 0) ==
'_') {
2246 return H.DartMethodName(library_reference, name_index);
2248 return H.DartMethodName(
NameIndex(), name_index);
2254 if ((
H.StringSize(name_index) >= 1) &&
H.CharacterAt(name_index, 0) ==
'_') {
2257 return H.DartSetterName(library_reference, name_index);
2259 return H.DartSetterName(
NameIndex(), name_index);
2265 if ((
H.StringSize(name_index) >= 1) &&
H.CharacterAt(name_index, 0) ==
'_') {
2268 return H.DartGetterName(library_reference, name_index);
2270 return H.DartGetterName(
NameIndex(), name_index);
2276 if ((
H.StringSize(name_index) >= 1) &&
H.CharacterAt(name_index, 0) ==
'_') {
2279 return H.DartFieldName(library_reference, name_index);
2281 return H.DartFieldName(
NameIndex(), name_index);
2320 case kConstructor: {
2327 case kFunctionDeclaration:
2332 case kFunctionExpression:
2341 "a procedure, a constructor, a local function or a function node",
2360 case kInterfaceType:
2363 case kSimpleInterfaceType:
2369 case kSimpleFunctionType:
2376 for (intptr_t
i = 0;
i < named_count; ++
i) {
2383 case kExtensionType: {
2395 case kTypeParameterType:
2399 case kIntersectionType:
2415 if (tag == kNothing) {
2418 ASSERT(tag == kSomething);
2443 const intptr_t named_count =
2445 for (intptr_t
i = 0;
i < named_count; ++
i) {
2458 for (intptr_t
i = 0;
i < list_length; ++
i) {
2465 for (intptr_t
i = 0;
i < list_length; ++
i) {
2472 for (intptr_t
i = 0;
i < list_length; ++
i) {
2480 for (intptr_t
i = 0;
i < list_length; ++
i) {
2487 for (intptr_t
i = 0;
i < list_length; ++
i) {
2494 for (intptr_t
i = 0;
i < list_length; ++
i) {
2501 for (intptr_t
i = 0;
i < list_length; ++
i) {
2508 for (intptr_t
i = 0;
i < list_length; ++
i) {
2518 case kInvalidInitializer:
2520 case kFieldInitializer:
2525 case kSuperInitializer:
2530 case kRedirectingInitializer:
2535 case kLocalInitializer:
2538 case kAssertInitializer:
2548 uint8_t payload = 0;
2551 case kInvalidExpression:
2554 if (
ReadTag() == kSomething) {
2564 case kSpecializedVariableGet:
2574 case kSpecializedVariableSet:
2593 case kInstanceTearOff:
2601 case kFunctionTearOff:
2620 case kAbstractSuperPropertyGet:
2625 case kAbstractSuperPropertySet:
2630 case kSuperPropertyGet:
2635 case kSuperPropertySet:
2650 case kInstanceInvocation:
2660 case kDynamicInvocation:
2668 case kLocalFunctionInvocation:
2675 case kFunctionInvocation:
2693 case kAbstractSuperMethodInvocation:
2698 case kSuperMethodInvocation:
2704 case kStaticInvocation:
2709 case kConstructorInvocation:
2722 case kLogicalExpression:
2728 case kConditionalExpression:
2735 case kStringConcatenation:
2754 case kThisExpression:
2780 for (intptr_t
i = 0;
i < list_length; ++
i) {
2786 case kRecordLiteral:
2792 case kRecordIndexGet:
2798 case kRecordNameGet:
2804 case kFunctionExpression:
2813 case kBlockExpression:
2818 case kInstantiation:
2823 case kBigIntLiteral:
2827 case kStringLiteral:
2831 case kSpecializedIntLiteral:
2834 case kNegativeIntLiteral:
2838 case kPositiveIntLiteral:
2842 case kDoubleLiteral:
2855 case kConstantExpression:
2860 case kFileUriConstantExpression:
2867 case kCheckLibraryIsLoaded:
2871 case kAwaitExpression:
2874 if (
ReadTag() == kSomething) {
2878 case kFileUriExpression:
2883 case kConstStaticInvocation:
2884 case kConstConstructorInvocation:
2885 case kConstListLiteral:
2886 case kConstSetLiteral:
2887 case kConstMapLiteral:
2888 case kSymbolLiteral:
2889 case kListConcatenation:
2890 case kSetConcatenation:
2891 case kMapConcatenation:
2892 case kInstanceCreation:
2893 case kStaticTearOff:
2894 case kSwitchExpression:
2895 case kPatternAssignment:
2907 case kExpressionStatement:
2915 case kEmptyStatement:
2920 case kAssertStatement:
2924 if (
ReadTag() == kSomething) {
2928 case kLabeledStatement:
2932 case kBreakStatement:
2936 case kWhileStatement:
2946 case kForStatement: {
2950 if (tag == kSomething) {
2957 case kSwitchStatement: {
2963 for (intptr_t
i = 0;
i < case_count; ++
i) {
2966 for (intptr_t j = 0; j < expression_count; ++j) {
2975 case kContinueSwitchStatement:
2985 case kReturnStatement: {
2988 if (tag == kSomething) {
2998 for (intptr_t
i = 0;
i < catch_count; ++
i) {
3002 if (tag == kSomething) {
3006 if (tag == kSomething) {
3018 case kYieldStatement: {
3024 case kVariableDeclaration:
3027 case kFunctionDeclaration:
3032 case kForInStatement:
3033 case kAsyncForInStatement:
3034 case kIfCaseStatement:
3035 case kPatternSwitchStatement:
3036 case kPatternVariableDeclaration:
3052 if ((
H.StringSize(name_index) >= 1) &&
H.CharacterAt(name_index, 0) ==
'_') {
3073 for (intptr_t j = 0; j < name_count; ++j) {
3085 for (intptr_t
i = 0;
i < combinator_count; ++
i) {
3101 const intptr_t count_from_first_library_offset =
3107 count_from_first_library_offset,
3118 const intptr_t count_from_first_library_offset =
3124 count_from_first_library_offset,
3160 const intptr_t line_start_count =
ReadUInt();
3169 const intptr_t line_start_count =
ReadUInt();
3171 for (intptr_t
i = 0;
i < line_start_count; ++
i) {
3184 const intptr_t line_start_count =
ReadUInt();
3186 for (intptr_t
i = 0;
i < line_start_count; ++
i) {
3195 const intptr_t constant_coverage_constructors =
ReadUInt();
3196 for (intptr_t
i = 0;
i < constant_coverage_constructors; ++
i) {
3223 : active_class_(active_class), saved_(*active_class), zone_(
Z) {
3224 active_class_->
enclosing = innermost_signature;
3226 intptr_t num_params = 0;
3230 f =
f.parent_function()) {
3231 num_params +=
f.NumTypeParameters();
3233 if (num_params == 0)
return;
3238 intptr_t index = num_params;
3240 f =
f.parent_function()) {
3241 for (intptr_t j =
f.NumTypeParameters() - 1; j >= 0; --j) {
3243 params.SetTypeAt(--index, type_param);
3254 : active_class_(active_class), saved_(*active_class), zone_(
Z) {
3255 active_class_->
enclosing = innermost_signature;
3257 const intptr_t num_new_params =
3260 if (num_new_params == 0)
return;
3263 const intptr_t old_param_count =
3264 old_params ==
nullptr ? 0 : old_params->
Length();
3269 for (intptr_t
i = 0;
i < old_param_count; ++
i) {
3273 for (intptr_t
i = 0;
i < num_new_params; ++
i) {
3274 const auto& type_param =
3278 extended_params.
SetTypeAt(index++, type_param);
3285 *active_class_ = saved_;
3292 bool in_constant_context)
3294 constant_reader_(constant_reader),
3295 translation_helper_(helper->translation_helper_),
3296 active_class_(active_class),
3297 type_parameter_scope_(nullptr),
3298 inferred_type_metadata_helper_(helper_, constant_reader_),
3299 unboxing_info_metadata_helper_(helper_),
3300 zone_(translation_helper_.zone()),
3301 result_(
AbstractType::Handle(translation_helper_.zone())),
3302 finalize_(finalize),
3303 in_constant_context_(in_constant_context) {}
3306 BuildTypeInternal();
3314 bool saved_finalize = finalize_;
3316 BuildTypeInternal();
3317 finalize_ = saved_finalize;
3324void TypeTranslator::BuildTypeInternal() {
3329 result_ = Object::dynamic_type().
ptr();
3332 result_ = Object::void_type().
ptr();
3341 result_ =
IG->object_store()->null_type();
3343 case kInterfaceType:
3344 BuildInterfaceType(
false);
3346 case kSimpleInterfaceType:
3347 BuildInterfaceType(
true);
3350 BuildFunctionType(
false);
3352 case kSimpleFunctionType:
3353 BuildFunctionType(
true);
3358 case kTypeParameterType:
3359 BuildTypeParameterType();
3361 case kIntersectionType:
3362 BuildIntersectionType();
3364 case kExtensionType:
3365 BuildExtensionType();
3368 BuildFutureOrType();
3376void TypeTranslator::BuildInterfaceType(
bool simple) {
3382 NameIndex klass_name =
3385 const Class& klass =
Class::Handle(
Z,
H.LookupClassByKernelClass(klass_name));
3388 if (finalize_ || klass.is_type_finalized()) {
3392 result_ = klass.DeclarationType();
3393 result_ = Type::Cast(result_).ToNullability(nullability,
Heap::kOld);
3396 result_ =
Type::New(klass, Object::null_type_arguments(), nullability);
3403 const TypeArguments& type_arguments =
3405 result_ =
Type::New(klass, type_arguments, nullability);
3412void TypeTranslator::BuildFutureOrType() {
3415 const TypeArguments& type_arguments =
3417 BuildTypeInternal();
3418 type_arguments.SetTypeAt(0, result_);
3420 const Class& klass =
Class::Handle(
Z,
IG->object_store()->future_or_class());
3423 result_ =
Type::New(klass, type_arguments, nullability);
3430void TypeTranslator::BuildFunctionType(
bool simple) {
3431 const intptr_t num_enclosing_type_arguments =
3441 bool finalize = finalize_;
3443 intptr_t type_parameter_count = 0;
3448 Object::null_class(), signature,
3449 type_parameter_count);
3452 ActiveTypeParametersScope scope(active_class_, &signature,
Z);
3456 Object::null_class(), signature, type_parameter_count);
3459 intptr_t required_count;
3461 intptr_t positional_count;
3463 required_count = helper_->
ReadUInt();
3470 required_count = positional_count;
3471 all_count = positional_count;
3475 const intptr_t kImplicitClosureParam = 1;
3476 signature.set_num_implicit_parameters(kImplicitClosureParam);
3477 signature.set_num_fixed_parameters(kImplicitClosureParam + required_count);
3478 signature.SetNumOptionalParameters(all_count - required_count,
3479 positional_count > required_count);
3483 signature.CreateNameArrayIncludingFlags();
3486 signature.SetParameterTypeAt(
pos, AbstractType::dynamic_type());
3488 for (intptr_t
i = 0;
i < positional_count; ++
i, ++
pos) {
3489 BuildTypeInternal();
3490 signature.SetParameterTypeAt(
pos, result_);
3494 const intptr_t named_count =
3496 for (intptr_t
i = 0;
i < named_count; ++
i, ++
pos) {
3499 BuildTypeInternal();
3501 signature.SetParameterTypeAt(
pos, result_);
3502 signature.SetParameterNameAt(
pos,
name);
3504 signature.SetIsRequiredAt(
pos);
3508 signature.FinalizeNameArray();
3510 BuildTypeInternal();
3511 signature.set_result_type(result_);
3513 finalize_ = finalize;
3519 result_ = signature.
ptr();
3522void TypeTranslator::BuildRecordType() {
3525 intptr_t named_count = 0;
3527 AlternativeReadingScope alt(&helper_->
reader_);
3528 for (intptr_t
i = 0;
i < positional_count; ++
i) {
3534 const intptr_t num_fields = positional_count + named_count;
3535 const Array& field_types =
3537 const Array& field_names =
3539 ? Object::empty_array()
3544 bool finalize = finalize_;
3548 for (intptr_t
i = 0;
i < positional_count; ++
i) {
3549 BuildTypeInternal();
3550 field_types.SetAt(
pos++, result_);
3554 for (intptr_t
i = 0;
i < named_count; ++
i) {
3556 field_names.SetAt(
i,
name);
3557 BuildTypeInternal();
3558 field_types.SetAt(
pos++, result_);
3561 if (named_count != 0) {
3562 field_names.MakeImmutable();
3564 const RecordShape shape =
3567 finalize_ = finalize;
3576 result_ = rec.
ptr();
3579void TypeTranslator::BuildTypeParameterType() {
3581 intptr_t parameter_index = helper_->
ReadUInt();
3585 if (!in_constant_context_) {
3586 const intptr_t class_type_parameter_count =
3588 if (class_type_parameter_count > parameter_index) {
3593 parameter_index -= class_type_parameter_count;
3614 if (class_type_parameter_count > parameter_index) {
3619 parameter_index -= class_type_parameter_count;
3622 const intptr_t procedure_type_parameter_count =
3627 if (procedure_type_parameter_count > 0) {
3628 if (procedure_type_parameter_count > parameter_index) {
3636 parameter_index -= procedure_type_parameter_count;
3641 if (parameter_index < active_class_->local_type_parameters->Length()) {
3642 const auto& type_param = TypeParameter::CheckedHandle(
3644 result_ = type_param.ToNullability(nullability,
Heap::kOld);
3653 if (type_parameter_scope_ !=
nullptr &&
3654 parameter_index < type_parameter_scope_->outer_parameter_count() +
3655 type_parameter_scope_->parameter_count()) {
3662 script, TokenPosition::kNoSource,
3663 "Unbound type parameter found in %s. Please report this at dartbug.com.",
3667void TypeTranslator::BuildIntersectionType() {
3668 BuildTypeInternal();
3672void TypeTranslator::BuildExtensionType() {
3677 BuildTypeInternal();
3681 bool only_dynamic =
true;
3684 if (helper_->
ReadTag() != kDynamicType) {
3685 only_dynamic =
false;
3691 if (!only_dynamic) {
3694 BuildTypeInternal();
3702 return type_arguments;
3706 const Class& receiver_class,
3715 return type_arguments;
3720 return instantiated_type_arguments;
3726 const Class& parameterized_class,
3728 intptr_t type_parameter_count) {
3730 ASSERT(type_parameter_count >= 0);
3731 if (type_parameter_count == 0) {
3754 if (!parameterized_class.
IsNull()) {
3765 for (intptr_t
i = 0;
i < type_parameter_count;
i++) {
3781 const Class& parameterized_class,
3783 intptr_t type_parameter_count) {
3785 ASSERT(type_parameter_count >= 0);
3786 if (type_parameter_count == 0) {
3791 Z, !parameterized_class.
IsNull()
3796 for (intptr_t
i = 0;
i < type_parameter_count;
i++) {
3829 if (num_type_params > 0) {
3832 for (intptr_t
i = 0;
i < num_type_params;
i++) {
3843 intptr_t param_index,
3845 const intptr_t param_pos =
3846 param_index + (
function.HasThisParameter() ? 1 : 0);
3848 if (param_pos <
function.maximum_unboxed_parameter_count()) {
3851 function.set_unboxed_integer_parameter_at(param_pos);
3854 function.set_unboxed_double_parameter_at(param_pos);
3873 function.set_unboxed_integer_return();
3876 function.set_unboxed_double_return();
3879 function.set_unboxed_record_return();
3890 intptr_t library_kernel_offset) {
3891 const intptr_t kernel_offset =
3892 function.kernel_offset() + library_kernel_offset;
3893 const auto unboxing_info =
3896 if (FLAG_precompiled_mode && unboxing_info !=
nullptr) {
3897 for (intptr_t
i = 0;
i < unboxing_info->unboxed_args_info.length();
i++) {
3904void TypeTranslator::SetupUnboxingInfoMetadataForFieldAccessors(
3905 const Function& field_accessor,
3906 intptr_t library_kernel_offset) {
3907 const intptr_t kernel_offset =
3908 field_accessor.kernel_offset() + library_kernel_offset;
3909 const auto unboxing_info =
3912 if (FLAG_precompiled_mode && unboxing_info !=
nullptr) {
3913 if (field_accessor.IsImplicitSetterFunction()) {
3914 for (intptr_t
i = 0;
i < unboxing_info->unboxed_args_info.length();
i++) {
3918 ASSERT(field_accessor.IsImplicitGetterFunction() ||
3919 field_accessor.IsImplicitStaticGetterFunction());
3931 ASSERT(!(is_method && is_closure));
3932 bool is_factory =
function.IsFactory();
3933 intptr_t extra_parameters = (is_method || is_closure || is_factory) ? 1 : 0;
3937 intptr_t type_parameter_count = 0;
3941 signature, type_parameter_count);
3949 type_parameter_count);
3956 intptr_t required_parameter_count =
3960 intptr_t positional_parameter_count =
3963 intptr_t named_parameter_count =
3964 total_parameter_count - positional_parameter_count;
3967 required_parameter_count);
3968 if (named_parameter_count > 0) {
3972 positional_parameter_count - required_parameter_count,
true);
3974 intptr_t parameter_count = extra_parameters + total_parameter_count;
3977 if (parameter_count > 0) {
3987 }
else if (is_closure) {
3989 function.SetParameterNameAt(
pos, Symbols::ClosureParameter());
3991 }
else if (is_factory) {
3993 function.SetParameterNameAt(
pos, Symbols::TypeArgumentsParameter());
3997 ASSERT(!is_method && !is_closure && !is_factory);
4001 for (intptr_t
i = 0;
i < positional_parameter_count; ++
i, ++
pos) {
4009 if (tag == kSomething) {
4017 intptr_t named_parameter_count_check =
4019 ASSERT(named_parameter_count_check == named_parameter_count);
4020 for (intptr_t
i = 0;
i < named_parameter_count; ++
i, ++
pos) {
4026 if (tag == kSomething) {
4042 if (!
function.IsGenerativeConstructor()) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static int const kUInt32Size
#define RELEASE_ASSERT(cond)
virtual AbstractTypePtr NormalizeFutureOrType(Heap::Space space) const
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
ObjectPtr At(intptr_t index) const
void SetAt(intptr_t index, const Object &value) const
static AbstractTypePtr FinalizeType(const AbstractType &type, FinalizationKind finalization=kCanonicalize)
FunctionPtr LookupFunctionAllowPrivate(const String &name) const
FunctionPtr LookupDynamicFunctionAllowPrivate(const String &name) const
LibraryPtr library() const
FunctionPtr LookupConstructorAllowPrivate(const String &name) const
intptr_t NumTypeArguments() const
bool is_type_finalized() const
TypePtr DeclarationType() const
ErrorPtr EnsureIsFinalized(Thread *thread) const
ClassPtr SuperClass(ClassTable *class_table=nullptr) const
TypeParametersPtr type_parameters() const
TypeParameterPtr TypeParameterAt(intptr_t index, Nullability nullability=Nullability::kNonNullable) const
void set_type_parameters(const TypeParameters &value) const
FieldPtr LookupFieldAllowPrivate(const String &name, bool instance_only=false) const
intptr_t NumTypeParameters(Thread *thread) const
TypeArgumentsPtr GetInstanceTypeArguments(Thread *thread, const TypeArguments &type_arguments, bool canonicalize=true) const
static StringPtr GetterSymbol(const String &field_name)
static StringPtr SetterSymbol(const String &field_name)
TypeParametersPtr type_parameters() const
void SetIsRequiredAt(intptr_t index) const
void set_result_type(const AbstractType &value) const
void SetParameterTypeAt(intptr_t index, const AbstractType &value) const
TypeParameterPtr TypeParameterAt(intptr_t index, Nullability nullability=Nullability::kNonNullable) const
void set_num_fixed_parameters(intptr_t value) const
void SetParameterNameAt(intptr_t index, const String &value) const
void CreateNameArrayIncludingFlags(Heap::Space space=Heap::kOld) const
void set_parameter_types(const Array &value) const
intptr_t NumTypeArguments() const
void FinalizeNameArray() const
void SetNumOptionalParameters(intptr_t num_optional_parameters, bool are_optional_positional) const
static FunctionTypePtr New(intptr_t num_parent_type_arguments=0, Nullability nullability=Nullability::kNonNullable, Heap::Space space=Heap::kOld)
intptr_t NumTypeParameters() const
void SetTypeParameters(const TypeParameters &value) const
intptr_t NumTypeParameters() const
bool IsMethodExtractor() const
FunctionPtr extracted_method_closure() const
FunctionPtr GetMethodExtractor(const String &getter_name) const
TypeParameterPtr TypeParameterAt(intptr_t index, Nullability nullability=Nullability::kNonNullable) const
LibraryPtr LookupLibrary(Thread *thread, const Smi &name_index) const
ClassPtr LookupClass(Thread *thread, const Smi &name_index) const
LibraryPtr InsertLibrary(Thread *thread, const Smi &name_index, const Library &lib) const
ClassPtr InsertClass(Thread *thread, const Smi &name_index, const Class &klass) const
StringPtr PrivateName(const String &name) const
ClassPtr LookupClassAllowPrivate(const String &name) const
void set_loading_unit(const LoadingUnit &value) const
static LibraryPtr LookupLibrary(Thread *thread, const String &url)
StringPtr private_key() const
static LoadingUnitPtr New(intptr_t id, const LoadingUnit &parent)
StringPtr Rename(const String &name, bool atomic=false)
static Object & ZoneHandle()
static RecordShape ForUnnamed(intptr_t num_fields)
static RecordShape Register(Thread *thread, intptr_t num_fields, const Array &field_names)
static RecordTypePtr New(RecordShape shape, const Array &field_types, Nullability nullability=Nullability::kNonNullable, Heap::Space space=Heap::kOld)
static void static void MessageV(Kind kind, const Script &script, TokenPosition token_pos, bool report_after_token, const char *format, va_list args)
static DART_NORETURN void LongJump(const Error &error)
static DART_NORETURN void static DART_NORETURN void LongJumpV(const Error &prev_error, const Script &script, TokenPosition token_pos, const char *format, va_list args)
static constexpr bool AtLocation
static SmiPtr New(intptr_t value)
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
uint16_t CharAt(intptr_t index) const
static StringPtr Concat(const String &str1, const String &str2, Heap::Space space=Heap::kNew)
static const char * ToCString(Thread *thread, StringPtr ptr)
static StringPtr FromUTF8(const uint8_t *utf8_array, intptr_t array_len, Heap::Space space=Heap::kNew)
static StringPtr FromConcatAll(Thread *thread, const GrowableHandlePtrArray< const String > &strs)
static const String & This()
static const String & Empty()
static StringPtr FromUTF8(Thread *thread, const uint8_t *utf8_array, intptr_t len)
static StringPtr New(Thread *thread, const char *cstr)
static const String & Dot()
static Thread * Current()
void SetTypeAt(intptr_t index, const AbstractType &value) const
TypeArgumentsPtr Canonicalize(Thread *thread) const
static TypeArgumentsPtr New(intptr_t len, Heap::Space space=Heap::kOld)
AbstractTypePtr TypeAt(intptr_t index) const
void SetNameAt(intptr_t index, const String &value) const
void SetBoundAt(intptr_t index, const AbstractType &value) const
static TypeParametersPtr New(Heap::Space space=Heap::kOld)
void SetDefaultAt(intptr_t index, const AbstractType &value) const
void SetIsGenericCovariantImplAt(intptr_t index, bool value) const
static TypePtr DynamicType()
static TypePtr New(const Class &clazz, const TypeArguments &arguments, Nullability nullability=Nullability::kNonNullable, Heap::Space space=Heap::kOld)
intptr_t LengthInBytes() const
void * DataAddr(intptr_t byte_offset) const
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
const FunctionType * enclosing
const TypeArguments * local_type_parameters
bool MemberIsFactoryProcedure()
intptr_t MemberTypeParameterCount(Zone *zone)
intptr_t source_uri_index_
intptr_t procedure_count_
NameIndex canonical_name_
TokenPosition end_position_
TokenPosition start_position_
void ReadUntilExcluding(Field field)
intptr_t annotation_count_
InstancePtr ReadConstant(intptr_t constant_index)
intptr_t annotation_count_
TokenPosition end_position_
TokenPosition start_position_
NameIndex canonical_name_
intptr_t source_uri_index_
void ReadUntilExcluding(Field field)
FieldHelper(KernelReaderHelper *helper)
NameIndex canonical_name_getter_
NameIndex canonical_name_field_
void ReadUntilExcluding(Field field)
intptr_t source_uri_index_
TokenPosition end_position_
NameIndex canonical_name_setter_
intptr_t annotation_count_
intptr_t total_parameter_count_
AsyncMarker async_marker_
intptr_t required_parameter_count_
void ReadUntilExcluding(Field field)
AsyncMarker dart_async_marker_
@ kRedirectingFactoryTarget
@ kRequiredParameterCount
void SetJustRead(Field field)
TokenPosition end_position_
void SkipFunctionType(bool simple)
const String & GetSourceFor(intptr_t index)
uint32_t PeekListLength()
void SkipListOfCanonicalNameReferences()
void SkipListOfVariableDeclarations()
intptr_t ReaderSize() const
void SkipTypeParametersList()
void SetOffset(intptr_t offset)
String & SourceTableUriFor(intptr_t index)
const String & ReadNameAsGetterName()
const String & ReadNameAsMethodName()
void ReadUntilFunctionNode()
void SkipOptionalDartType()
void SkipListOfDartTypes()
intptr_t data_program_offset_
void SkipConstantReference()
intptr_t SourceTableSize()
const String & ReadNameAsSetterName()
intptr_t ReadListLength()
TranslationHelper & translation_helper_
void SkipLibraryCombinator()
TokenPosition ReadPosition()
Tag ReadTag(uint8_t *payload=nullptr)
void SkipListOfExpressions()
virtual void set_current_script_id(intptr_t id)
virtual void ReportUnexpectedTag(const char *variant, Tag tag)
Tag PeekTag(uint8_t *payload=nullptr)
NameIndex ReadInterfaceMemberNameReference()
void SkipLibraryDependency()
void SkipListOfNamedExpressions()
intptr_t GetOffsetForSourceInfo(intptr_t index)
intptr_t ReaderOffset() const
virtual void RecordTokenPosition(TokenPosition position)
void SkipInterfaceMemberNameReference()
NameIndex ReadCanonicalNameReference()
const String & ReadNameAsFieldName()
StringIndex ReadNameAsStringIndex()
void SkipCanonicalNameReference()
void SkipVariableDeclaration()
String & SourceTableImportUriFor(intptr_t index)
void SkipStringReference()
void SkipBytes(intptr_t skip)
StringIndex ReadStringReference()
void SkipInterfaceType(bool simple)
TypedDataViewPtr GetConstantCoverageFor(intptr_t index)
Nullability ReadNullability()
TypedDataPtr GetLineStartsFor(intptr_t index)
void ReadUntilExcluding(Field field)
NameIndex target_library_canonical_name_
intptr_t annotation_count_
void ReadUntilExcluding(Field field)
NameIndex canonical_name_
intptr_t source_uri_index_
static constexpr int kInvalidName
NameIndex canonical_name_
NameIndex concrete_forwarding_stub_target_
@ kConcreteForwardingStubKind
void ReadUntilExcluding(Field field)
intptr_t source_uri_index_
TokenPosition end_position_
intptr_t annotation_count_
TokenPosition start_position_
TokenPosition ReadPosition()
uint32_t ReadFromIndexNoReset(intptr_t end_offset, intptr_t fields_before, intptr_t list_size, intptr_t list_index)
void set_offset(intptr_t offset)
uint32_t ReadUInt32At(intptr_t offset) const
TypedDataViewPtr ViewFromTo(intptr_t start, intptr_t end)
TypedDataPtr ReadLineStartsData(intptr_t line_start_count)
static const char * TagName(Tag tag)
NameIndex ReadCanonicalNameReference()
const uint8_t * BufferAt(intptr_t offset)
intptr_t ReadListLength()
const Class & GetExpressionEvaluationRealClass()
const String & DartProcedureName(NameIndex procedure)
bool IsGetter(NameIndex name)
Type & GetDeclarationType(const Class &klass)
void SetConstantsTable(const TypedDataView &constants_table)
InstancePtr Canonicalize(const Instance &instance)
FunctionPtr LookupStaticMethodByKernelProcedure(NameIndex procedure, bool required=true)
const TypedDataView & string_data() const
FunctionPtr LookupDynamicFunction(const Class &klass, const String &name)
const TypedDataView & metadata_mappings() const
const String & DartSetterName(NameIndex setter)
FieldPtr LookupFieldByKernelGetterOrSetter(NameIndex field, bool required=true)
intptr_t StringSize(StringIndex index) const
void SetCanonicalNames(const TypedData &canonical_names)
const TypedDataView & constants_table() const
intptr_t StringOffset(StringIndex index) const
void ReportError(const char *format,...) PRINTF_ATTRIBUTE(2
const String & DartClassName(NameIndex kernel_class)
uint8_t * StringBuffer(StringIndex index) const
const String & DartString(const char *content)
bool IsField(NameIndex name)
FunctionPtr LookupMethodByMember(NameIndex target, const String &method_name, bool required=true)
bool IsFactory(NameIndex name)
bool IsMember(NameIndex name)
bool IsMethod(NameIndex name)
bool IsConstructor(NameIndex name)
const String & DartConstructorName(NameIndex constructor)
bool IsProcedure(NameIndex name)
NameIndex CanonicalNameParent(NameIndex name)
FieldPtr LookupFieldByKernelField(NameIndex field, bool required=true)
void SetMetadataMappings(const TypedDataView &metadata_mappings)
void SetKernelProgramInfo(const KernelProgramInfo &info)
void InitFromKernelProgramInfo(const KernelProgramInfo &info)
ClassPtr LookupClassByKernelClassOrLibrary(NameIndex kernel_name, bool required=true)
bool IsPrivate(NameIndex name)
bool IsAdministrative(NameIndex name)
bool IsLibrary(NameIndex name)
bool IsClass(NameIndex name)
uint8_t CharacterAt(StringIndex string_index, intptr_t index)
String & DartIdentifier(const Library &lib, StringIndex string_index)
const Class & GetExpressionEvaluationClass()
const TypedData & canonical_names() const
const String & DartFactoryName(NameIndex factory)
const TypedData & string_offsets() const
const String & DartMethodName(NameIndex method)
const TypedDataView & metadata_payloads() const
const String & DartSymbolPlain(const char *content) const
DART_NORETURN void LookupFailed(NameIndex name)
bool IsRoot(NameIndex name)
virtual LibraryPtr LookupLibraryByKernelLibrary(NameIndex library, bool required=true)
FunctionPtr LookupConstructorByKernelConstructor(NameIndex constructor, bool required=true)
const String & DartGetterName(NameIndex getter)
void SetupFieldAccessorFunction(const Class &klass, const Function &function, const AbstractType &field_type)
bool IsSetter(NameIndex name)
NameIndex EnclosingName(NameIndex name)
const String & DartSymbolObfuscate(const char *content) const
TranslationHelper(Thread *thread)
bool StringEquals(StringIndex string_index, const char *other)
StringIndex CanonicalNameString(NameIndex name)
void SetStringOffsets(const TypedData &string_offsets)
const String & DartFieldName(NameIndex field)
void SetConstants(const Array &constants)
void SetStringData(const TypedDataView &string_data)
ObjectPtr LookupMemberByMember(NameIndex kernel_name, bool required=true)
void SetMetadataPayloads(const TypedDataView &metadata_payloads)
const Array & constants()
virtual ClassPtr LookupClassByKernelClass(NameIndex klass, bool required=true)
void ReadUntilExcludingAndSetJustRead(Field field)
void ReadUntilExcluding(Field field)
bool IsGenericCovariantImpl()
TypeTranslator(KernelReaderHelper *helper, ConstantReader *constant_reader, ActiveClass *active_class, bool finalize=false, bool in_constant_context=false)
AbstractType & BuildType()
const TypeArguments & BuildTypeArguments(intptr_t length)
void SetupFunctionParameters(const Class &klass, const Function &function, bool is_method, bool is_closure, FunctionNodeHelper *function_node_helper)
const Type & ReceiverType(const Class &klass)
AbstractType & BuildTypeWithoutFinalization()
void LoadAndSetupTypeParameters(ActiveClass *active_class, const Function &function, const Class ¶meterized_class, const FunctionType ¶meterized_signature, intptr_t type_parameter_count)
const TypeArguments & BuildInstantiatedTypeArguments(const Class &receiver_class, intptr_t length)
void LoadAndSetupBounds(ActiveClass *active_class, const Function &function, const Class ¶meterized_class, const FunctionType ¶meterized_signature, intptr_t type_parameter_count)
TokenPosition equals_position_
intptr_t annotation_count_
void ReadUntilExcluding(Field field)
const EmbeddedViewParams * params
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
uint32_t uint32_t * format
Dart_NativeFunction function
union flutter::testing::@2836::KeyboardChange::@76 content
static void SetupUnboxingInfoOfParameter(const Function &function, intptr_t param_index, const UnboxingInfoMetadata *metadata)
static constexpr int SourceTableFieldCountFromFirstLibraryOffset
static constexpr int LibraryCountFieldCountFromEnd
static void SetupUnboxingInfoOfReturnValue(const Function &function, const UnboxingInfoMetadata *metadata)
static const char *const names[]
const char *const class_name
constexpr intptr_t kWordSize
constexpr intptr_t kIntptrMax
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