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)) -
173 return StringIndex(canonical_names_.GetUint32((8 *
name) + 4));
360 if (
IG->obfuscate()) {
376 if (
IG->obfuscate()) {
384 StringIndex string_index) {
386 ManglePrivateName(lib, &
name);
423 StringIndex setter) {
437 uint8_t*
buffer =
Z->Alloc<uint8_t>(size);
444 ManglePrivateName(parent, &
name);
455 StringIndex getter) {
457 ManglePrivateName(parent, &
name);
469 return ManglePrivateName(parent, &
name);
478 StringIndex method) {
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) {
699 StringIndex constructor_name,
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;
1467 for (intptr_t i = 0; i <
length; ++i) {
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;
1661 intptr_t mid_node_offset =
1664 if (node_offset < mid_node_offset) {
1666 }
else if (node_offset > mid_node_offset) {
1676 if (
left < mappings_num_) {
1677 intptr_t found_node_offset =
1680 if (found_node_offset < 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);
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:
2755 case kThisExpression:
2781 for (intptr_t i = 0; i < list_length; ++i) {
2787 case kRecordLiteral:
2793 case kRecordIndexGet:
2799 case kRecordNameGet:
2805 case kFunctionExpression:
2814 case kBlockExpression:
2819 case kInstantiation:
2824 case kBigIntLiteral:
2828 case kStringLiteral:
2832 case kSpecializedIntLiteral:
2835 case kNegativeIntLiteral:
2839 case kPositiveIntLiteral:
2843 case kDoubleLiteral:
2856 case kConstantExpression:
2861 case kFileUriConstantExpression:
2868 case kCheckLibraryIsLoaded:
2872 case kAwaitExpression:
2875 if (
ReadTag() == kSomething) {
2879 case kFileUriExpression:
2884 case kConstStaticInvocation:
2885 case kConstConstructorInvocation:
2886 case kConstListLiteral:
2887 case kConstSetLiteral:
2888 case kConstMapLiteral:
2889 case kSymbolLiteral:
2890 case kListConcatenation:
2891 case kSetConcatenation:
2892 case kMapConcatenation:
2893 case kInstanceCreation:
2894 case kStaticTearOff:
2895 case kSwitchExpression:
2896 case kPatternAssignment:
2908 case kExpressionStatement:
2916 case kEmptyStatement:
2921 case kAssertStatement:
2925 if (
ReadTag() == kSomething) {
2929 case kLabeledStatement:
2933 case kBreakStatement:
2937 case kWhileStatement:
2947 case kForStatement: {
2951 if (tag == kSomething) {
2958 case kSwitchStatement: {
2964 for (intptr_t i = 0; i < case_count; ++i) {
2967 for (intptr_t j = 0; j < expression_count; ++j) {
2976 case kContinueSwitchStatement:
2986 case kReturnStatement: {
2989 if (tag == kSomething) {
2999 for (intptr_t i = 0; i < catch_count; ++i) {
3003 if (tag == kSomething) {
3007 if (tag == kSomething) {
3019 case kYieldStatement: {
3025 case kVariableDeclaration:
3028 case kFunctionDeclaration:
3033 case kForInStatement:
3034 case kAsyncForInStatement:
3035 case kIfCaseStatement:
3036 case kPatternSwitchStatement:
3037 case kPatternVariableDeclaration:
3053 if ((
H.StringSize(name_index) >= 1) &&
H.CharacterAt(name_index, 0) ==
'_') {
3074 for (intptr_t j = 0; j < name_count; ++j) {
3086 for (intptr_t i = 0; i < combinator_count; ++i) {
3102 const intptr_t count_from_first_library_offset =
3108 count_from_first_library_offset,
3119 const intptr_t count_from_first_library_offset =
3125 count_from_first_library_offset,
3161 const intptr_t line_start_count =
ReadUInt();
3170 const intptr_t line_start_count =
ReadUInt();
3172 for (intptr_t i = 0; i < line_start_count; ++i) {
3185 const intptr_t line_start_count =
ReadUInt();
3187 for (intptr_t i = 0; i < line_start_count; ++i) {
3196 const intptr_t constant_coverage_constructors =
ReadUInt();
3197 for (intptr_t i = 0; i < constant_coverage_constructors; ++i) {
3224 : active_class_(active_class), saved_(*active_class), zone_(
Z) {
3225 active_class_->
enclosing = innermost_signature;
3227 intptr_t num_params = 0;
3231 f = f.parent_function()) {
3232 num_params += f.NumTypeParameters();
3234 if (num_params == 0)
return;
3239 intptr_t index = num_params;
3241 f = f.parent_function()) {
3242 for (intptr_t j = f.NumTypeParameters() - 1; j >= 0; --j) {
3244 params.SetTypeAt(--index, type_param);
3255 : active_class_(active_class), saved_(*active_class), zone_(
Z) {
3256 active_class_->
enclosing = innermost_signature;
3258 const intptr_t num_new_params =
3261 if (num_new_params == 0)
return;
3264 const intptr_t old_param_count =
3265 old_params ==
nullptr ? 0 : old_params->
Length();
3270 for (intptr_t i = 0; i < old_param_count; ++i) {
3274 for (intptr_t i = 0; i < num_new_params; ++i) {
3275 const auto& type_param =
3279 extended_params.
SetTypeAt(index++, type_param);
3286 *active_class_ = saved_;
3293 bool in_constant_context)
3295 constant_reader_(constant_reader),
3296 translation_helper_(helper->translation_helper_),
3297 active_class_(active_class),
3298 type_parameter_scope_(nullptr),
3299 inferred_type_metadata_helper_(helper_, constant_reader_),
3300 unboxing_info_metadata_helper_(helper_),
3301 zone_(translation_helper_.zone()),
3302 result_(
AbstractType::Handle(translation_helper_.zone())),
3303 finalize_(finalize),
3304 in_constant_context_(in_constant_context) {}
3307 BuildTypeInternal();
3315 bool saved_finalize = finalize_;
3317 BuildTypeInternal();
3318 finalize_ = saved_finalize;
3325void TypeTranslator::BuildTypeInternal() {
3330 result_ = Object::dynamic_type().
ptr();
3333 result_ = Object::void_type().
ptr();
3342 result_ =
IG->object_store()->null_type();
3344 case kInterfaceType:
3345 BuildInterfaceType(
false);
3347 case kSimpleInterfaceType:
3348 BuildInterfaceType(
true);
3351 BuildFunctionType(
false);
3353 case kSimpleFunctionType:
3354 BuildFunctionType(
true);
3359 case kTypeParameterType:
3360 BuildTypeParameterType();
3362 case kIntersectionType:
3363 BuildIntersectionType();
3365 case kExtensionType:
3366 BuildExtensionType();
3369 BuildFutureOrType();
3377void TypeTranslator::BuildInterfaceType(
bool simple) {
3383 NameIndex klass_name =
3386 const Class& klass =
Class::Handle(
Z,
H.LookupClassByKernelClass(klass_name));
3389 if (finalize_ || klass.is_type_finalized()) {
3393 result_ = klass.DeclarationType();
3394 result_ = Type::Cast(result_).ToNullability(nullability,
Heap::kOld);
3397 result_ =
Type::New(klass, Object::null_type_arguments(), nullability);
3404 const TypeArguments& type_arguments =
3406 result_ =
Type::New(klass, type_arguments, nullability);
3413void TypeTranslator::BuildFutureOrType() {
3416 const TypeArguments& type_arguments =
3418 BuildTypeInternal();
3419 type_arguments.SetTypeAt(0, result_);
3421 const Class& klass =
Class::Handle(
Z,
IG->object_store()->future_or_class());
3424 result_ =
Type::New(klass, type_arguments, nullability);
3431void TypeTranslator::BuildFunctionType(
bool simple) {
3432 const intptr_t num_enclosing_type_arguments =
3442 bool finalize = finalize_;
3444 intptr_t type_parameter_count = 0;
3449 Object::null_class(), signature,
3450 type_parameter_count);
3453 ActiveTypeParametersScope scope(active_class_, &signature,
Z);
3457 Object::null_class(), signature, type_parameter_count);
3460 intptr_t required_count;
3462 intptr_t positional_count;
3464 required_count = helper_->
ReadUInt();
3471 required_count = positional_count;
3472 all_count = positional_count;
3476 const intptr_t kImplicitClosureParam = 1;
3477 signature.set_num_implicit_parameters(kImplicitClosureParam);
3478 signature.set_num_fixed_parameters(kImplicitClosureParam + required_count);
3479 signature.SetNumOptionalParameters(all_count - required_count,
3480 positional_count > required_count);
3484 signature.CreateNameArrayIncludingFlags();
3487 signature.SetParameterTypeAt(
pos, AbstractType::dynamic_type());
3489 for (intptr_t i = 0; i < positional_count; ++i, ++
pos) {
3490 BuildTypeInternal();
3491 signature.SetParameterTypeAt(
pos, result_);
3495 const intptr_t named_count =
3497 for (intptr_t i = 0; i < named_count; ++i, ++
pos) {
3500 BuildTypeInternal();
3502 signature.SetParameterTypeAt(
pos, result_);
3503 signature.SetParameterNameAt(
pos,
name);
3505 signature.SetIsRequiredAt(
pos);
3509 signature.FinalizeNameArray();
3511 BuildTypeInternal();
3512 signature.set_result_type(result_);
3514 finalize_ = finalize;
3520 result_ = signature.
ptr();
3523void TypeTranslator::BuildRecordType() {
3526 intptr_t named_count = 0;
3528 AlternativeReadingScope alt(&helper_->
reader_);
3529 for (intptr_t i = 0; i < positional_count; ++i) {
3535 const intptr_t num_fields = positional_count + named_count;
3536 const Array& field_types =
3538 const Array& field_names =
3540 ? Object::empty_array()
3545 bool finalize = finalize_;
3549 for (intptr_t i = 0; i < positional_count; ++i) {
3550 BuildTypeInternal();
3551 field_types.SetAt(
pos++, result_);
3555 for (intptr_t i = 0; i < named_count; ++i) {
3557 field_names.SetAt(i,
name);
3558 BuildTypeInternal();
3559 field_types.SetAt(
pos++, result_);
3562 if (named_count != 0) {
3563 field_names.MakeImmutable();
3565 const RecordShape shape =
3568 finalize_ = finalize;
3577 result_ = rec.
ptr();
3580void TypeTranslator::BuildTypeParameterType() {
3582 intptr_t parameter_index = helper_->
ReadUInt();
3586 if (!in_constant_context_) {
3587 const intptr_t class_type_parameter_count =
3589 if (class_type_parameter_count > parameter_index) {
3594 parameter_index -= class_type_parameter_count;
3615 if (class_type_parameter_count > parameter_index) {
3620 parameter_index -= class_type_parameter_count;
3623 const intptr_t procedure_type_parameter_count =
3628 if (procedure_type_parameter_count > 0) {
3629 if (procedure_type_parameter_count > parameter_index) {
3637 parameter_index -= procedure_type_parameter_count;
3642 if (parameter_index < active_class_->local_type_parameters->Length()) {
3643 const auto& type_param = TypeParameter::CheckedHandle(
3645 result_ = type_param.ToNullability(nullability,
Heap::kOld);
3654 if (type_parameter_scope_ !=
nullptr &&
3655 parameter_index < type_parameter_scope_->outer_parameter_count() +
3656 type_parameter_scope_->parameter_count()) {
3663 script, TokenPosition::kNoSource,
3664 "Unbound type parameter found in %s. Please report this at dartbug.com.",
3668void TypeTranslator::BuildIntersectionType() {
3669 BuildTypeInternal();
3673void TypeTranslator::BuildExtensionType() {
3678 BuildTypeInternal();
3682 bool only_dynamic =
true;
3684 for (intptr_t i = 0; i <
length; ++i) {
3685 if (helper_->
ReadTag() != kDynamicType) {
3686 only_dynamic =
false;
3692 if (!only_dynamic) {
3694 for (intptr_t i = 0; i <
length; ++i) {
3695 BuildTypeInternal();
3703 return type_arguments;
3707 const Class& receiver_class,
3716 return type_arguments;
3721 return instantiated_type_arguments;
3727 const Class& parameterized_class,
3729 intptr_t type_parameter_count) {
3731 ASSERT(type_parameter_count >= 0);
3732 if (type_parameter_count == 0) {
3755 if (!parameterized_class.
IsNull()) {
3766 for (intptr_t i = 0; i < type_parameter_count; i++) {
3782 const Class& parameterized_class,
3784 intptr_t type_parameter_count) {
3786 ASSERT(type_parameter_count >= 0);
3787 if (type_parameter_count == 0) {
3792 Z, !parameterized_class.
IsNull()
3797 for (intptr_t i = 0; i < type_parameter_count; i++) {
3830 if (num_type_params > 0) {
3833 for (intptr_t i = 0; i < num_type_params; i++) {
3844 intptr_t param_index,
3846 const intptr_t param_pos =
3847 param_index + (
function.HasThisParameter() ? 1 : 0);
3849 if (param_pos <
function.maximum_unboxed_parameter_count()) {
3852 function.set_unboxed_integer_parameter_at(param_pos);
3856 function.set_unboxed_double_parameter_at(param_pos);
3876 function.set_unboxed_integer_return();
3880 function.set_unboxed_double_return();
3884 function.set_unboxed_record_return();
3895 intptr_t library_kernel_offset) {
3896 const intptr_t kernel_offset =
3897 function.kernel_offset() + library_kernel_offset;
3898 const auto unboxing_info =
3901 if (FLAG_precompiled_mode && unboxing_info !=
nullptr) {
3902 for (intptr_t i = 0; i < unboxing_info->unboxed_args_info.length(); i++) {
3909void TypeTranslator::SetupUnboxingInfoMetadataForFieldAccessors(
3910 const Function& field_accessor,
3911 intptr_t library_kernel_offset) {
3912 const intptr_t kernel_offset =
3913 field_accessor.kernel_offset() + library_kernel_offset;
3914 const auto unboxing_info =
3917 if (FLAG_precompiled_mode && unboxing_info !=
nullptr) {
3918 if (field_accessor.IsImplicitSetterFunction()) {
3919 for (intptr_t i = 0; i < unboxing_info->unboxed_args_info.length(); i++) {
3923 ASSERT(field_accessor.IsImplicitGetterFunction() ||
3924 field_accessor.IsImplicitStaticGetterFunction());
3936 ASSERT(!(is_method && is_closure));
3937 bool is_factory =
function.IsFactory();
3938 intptr_t extra_parameters = (is_method || is_closure || is_factory) ? 1 : 0;
3942 intptr_t type_parameter_count = 0;
3946 signature, type_parameter_count);
3954 type_parameter_count);
3961 intptr_t required_parameter_count =
3965 intptr_t positional_parameter_count =
3968 intptr_t named_parameter_count =
3969 total_parameter_count - positional_parameter_count;
3972 required_parameter_count);
3973 if (named_parameter_count > 0) {
3977 positional_parameter_count - required_parameter_count,
true);
3979 intptr_t parameter_count = extra_parameters + total_parameter_count;
3982 if (parameter_count > 0) {
3992 }
else if (is_closure) {
3994 function.SetParameterNameAt(
pos, Symbols::ClosureParameter());
3996 }
else if (is_factory) {
3998 function.SetParameterNameAt(
pos, Symbols::TypeArgumentsParameter());
4002 ASSERT(!is_method && !is_closure && !is_factory);
4006 for (intptr_t i = 0; i < positional_parameter_count; ++i, ++
pos) {
4014 if (tag == kSomething) {
4022 intptr_t named_parameter_count_check =
4024 ASSERT(named_parameter_count_check == named_parameter_count);
4025 for (intptr_t i = 0; i < named_parameter_count; ++i, ++
pos) {
4031 if (tag == kSomething) {
4047 if (!
function.IsGenerativeConstructor()) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static int const kUInt32Size
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
#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)
static bool SupportsUnboxedDoubles()
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
intptr_t NumTypeParameters() const
void SetTypeParameters(const TypeParameters &value) const
static FunctionTypePtr New(intptr_t num_parent_type_arguments=0, Nullability nullability=Nullability::kLegacy, Heap::Space space=Heap::kOld)
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::kLegacy, 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 New(const Class &clazz, const TypeArguments &arguments, Nullability nullability=Nullability::kLegacy, Heap::Space space=Heap::kOld)
static TypePtr DynamicType()
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
static const uint8_t buffer[]
const uint8_t uint32_t uint32_t GError ** error
uint32_t uint32_t * format
Dart_NativeFunction function
union flutter::testing::@2838::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