Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
dart::kernel::KernelReaderHelper Class Reference

#include <kernel_translation_helper.h>

Inheritance diagram for dart::kernel::KernelReaderHelper:
dart::kernel::KernelFingerprintHelper dart::kernel::KernelTokenPositionCollector dart::kernel::StreamingFlowGraphBuilder

Public Member Functions

 KernelReaderHelper (Zone *zone, TranslationHelper *translation_helper, const TypedDataBase &data, intptr_t data_program_offset)
 
virtual ~KernelReaderHelper ()=default
 
void SetOffset (intptr_t offset)
 
intptr_t ReadListLength ()
 
NameIndex ReadCanonicalNameReference ()
 
virtual void ReportUnexpectedTag (const char *variant, Tag tag)
 
void ReadUntilFunctionNode ()
 
Tag PeekTag (uint8_t *payload=nullptr)
 

Protected Member Functions

virtual void set_current_script_id (intptr_t id)
 
virtual void RecordTokenPosition (TokenPosition position)
 
intptr_t ReaderOffset () const
 
intptr_t ReaderSize () const
 
void SkipBytes (intptr_t skip)
 
bool ReadBool ()
 
uint8_t ReadByte ()
 
uint32_t ReadUInt ()
 
uint32_t ReadUInt32 ()
 
uint32_t PeekUInt ()
 
double ReadDouble ()
 
uint32_t PeekListLength ()
 
StringIndex ReadStringReference ()
 
NameIndex ReadInterfaceMemberNameReference ()
 
StringIndex ReadNameAsStringIndex ()
 
const StringReadNameAsMethodName ()
 
const StringReadNameAsGetterName ()
 
const StringReadNameAsSetterName ()
 
const StringReadNameAsFieldName ()
 
void SkipFlags ()
 
void SkipStringReference ()
 
void SkipConstantReference ()
 
void SkipCanonicalNameReference ()
 
void SkipInterfaceMemberNameReference ()
 
void SkipDartType ()
 
void SkipOptionalDartType ()
 
void SkipInterfaceType (bool simple)
 
void SkipFunctionType (bool simple)
 
void SkipStatementList ()
 
void SkipListOfExpressions ()
 
void SkipListOfNamedExpressions ()
 
void SkipListOfDartTypes ()
 
void SkipListOfStrings ()
 
void SkipListOfVariableDeclarations ()
 
void SkipListOfCanonicalNameReferences ()
 
void SkipTypeParametersList ()
 
void SkipInitializer ()
 
void SkipExpression ()
 
void SkipStatement ()
 
void SkipFunctionNode ()
 
void SkipName ()
 
void SkipArguments ()
 
void SkipVariableDeclaration ()
 
void SkipLibraryCombinator ()
 
void SkipLibraryDependency ()
 
TokenPosition ReadPosition ()
 
Tag ReadTag (uint8_t *payload=nullptr)
 
uint8_t ReadFlags ()
 
Nullability ReadNullability ()
 
Variance ReadVariance ()
 
intptr_t SourceTableSize ()
 
intptr_t GetOffsetForSourceInfo (intptr_t index)
 
StringSourceTableUriFor (intptr_t index)
 
const StringGetSourceFor (intptr_t index)
 
TypedDataPtr GetLineStartsFor (intptr_t index)
 
StringSourceTableImportUriFor (intptr_t index)
 
TypedDataViewPtr GetConstantCoverageFor (intptr_t index)
 

Protected Attributes

Zonezone_
 
TranslationHelpertranslation_helper_
 
Reader reader_
 
intptr_t data_program_offset_
 

Friends

class ClassHelper
 
class CallSiteAttributesMetadataHelper
 
class ConstantReader
 
class ConstantHelper
 
class ConstructorHelper
 
class DirectCallMetadataHelper
 
class FieldHelper
 
class FunctionNodeHelper
 
class InferredTypeMetadataHelper
 
class KernelLoader
 
class LibraryDependencyHelper
 
class LibraryHelper
 
class MetadataHelper
 
class ProcedureAttributesMetadataHelper
 
class ProcedureHelper
 
class SimpleExpressionConverter
 
class ScopeBuilder
 
class TableSelectorMetadataHelper
 
class TypeParameterHelper
 
class TypeTranslator
 
class UnboxingInfoMetadataHelper
 
class VariableDeclarationHelper
 
class ObfuscationProhibitionsMetadataHelper
 
class LoadingUnitsMetadataHelper
 
bool NeedsDynamicInvocationForwarder (const Function &function)
 
ArrayPtr CollectConstConstructorCoverageFrom (const Script &interesting_script)
 

Detailed Description

Definition at line 1266 of file kernel_translation_helper.h.

Constructor & Destructor Documentation

◆ KernelReaderHelper()

dart::kernel::KernelReaderHelper::KernelReaderHelper ( Zone zone,
TranslationHelper translation_helper,
const TypedDataBase data,
intptr_t  data_program_offset 
)
inline

Definition at line 1268 of file kernel_translation_helper.h.

◆ ~KernelReaderHelper()

virtual dart::kernel::KernelReaderHelper::~KernelReaderHelper ( )
virtualdefault

Member Function Documentation

◆ GetConstantCoverageFor()

TypedDataViewPtr dart::kernel::KernelReaderHelper::GetConstantCoverageFor ( intptr_t  index)
protected

Definition at line 3180 of file kernel_translation_helper.cc.

3180 {
3181 AlternativeReadingScope alt(&reader_);
3183 SkipBytes(ReadUInt()); // skip uri.
3184 SkipBytes(ReadUInt()); // skip source.
3185 const intptr_t line_start_count = ReadUInt(); // read number of line start
3186 // entries.
3187 for (intptr_t i = 0; i < line_start_count; ++i) {
3188 ReadUInt();
3189 }
3190
3191 SkipBytes(ReadUInt()); // skip import uri.
3192
3193 intptr_t start_offset = ReaderOffset();
3194
3195 // Read past "constant coverage constructors".
3196 const intptr_t constant_coverage_constructors = ReadUInt();
3197 for (intptr_t i = 0; i < constant_coverage_constructors; ++i) {
3198 ReadUInt();
3199 }
3200
3201 intptr_t end_offset = ReaderOffset();
3202
3203 return reader_.ViewFromTo(start_offset, end_offset);
3204}
TypedDataViewPtr ViewFromTo(intptr_t start, intptr_t end)

◆ GetLineStartsFor()

TypedDataPtr dart::kernel::KernelReaderHelper::GetLineStartsFor ( intptr_t  index)
protected

Definition at line 3154 of file kernel_translation_helper.cc.

3154 {
3155 // Line starts are delta encoded. So get the max delta first so that we
3156 // can store them as tightly as possible.
3157 AlternativeReadingScope alt(&reader_);
3159 SkipBytes(ReadUInt()); // skip uri.
3160 SkipBytes(ReadUInt()); // skip source.
3161 const intptr_t line_start_count = ReadUInt();
3162 return reader_.ReadLineStartsData(line_start_count);
3163}
TypedDataPtr ReadLineStartsData(intptr_t line_start_count)

◆ GetOffsetForSourceInfo()

intptr_t dart::kernel::KernelReaderHelper::GetOffsetForSourceInfo ( intptr_t  index)
protected

Definition at line 3114 of file kernel_translation_helper.cc.

3114 {
3115 AlternativeReadingScope alt(&reader_);
3116 intptr_t library_count = reader_.ReadFromIndexNoReset(
3118
3119 const intptr_t count_from_first_library_offset =
3121
3122 intptr_t source_table_offset = reader_.ReadFromIndexNoReset(
3123 reader_.size(),
3124 LibraryCountFieldCountFromEnd + 1 + library_count + 1 +
3125 count_from_first_library_offset,
3126 1, 0);
3127 intptr_t next_field_offset = reader_.ReadUInt32();
3128 SetOffset(source_table_offset);
3129 intptr_t size = reader_.ReadUInt32(); // read source table size.
3130
3131 return reader_.ReadFromIndexNoReset(next_field_offset, 0, size, index);
3132}
uint32_t ReadFromIndexNoReset(intptr_t end_offset, intptr_t fields_before, intptr_t list_size, intptr_t list_index)
intptr_t size() const
static constexpr int SourceTableFieldCountFromFirstLibraryOffset
static constexpr int LibraryCountFieldCountFromEnd
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
Definition switches.h:259

◆ GetSourceFor()

const String & dart::kernel::KernelReaderHelper::GetSourceFor ( intptr_t  index)
protected

Definition at line 3141 of file kernel_translation_helper.cc.

3141 {
3142 AlternativeReadingScope alt(&reader_);
3144 SkipBytes(ReadUInt()); // skip uri.
3145 intptr_t size = ReadUInt(); // read source List<byte> size.
3146 ASSERT(size >= 0);
3147 if (size == 0) {
3148 return Symbols::Empty();
3149 } else {
3150 return H.DartString(reader_.BufferAt(ReaderOffset()), size, Heap::kOld);
3151 }
3152}
@ kOld
Definition heap.h:39
static const String & Empty()
Definition symbols.h:687
const uint8_t * BufferAt(intptr_t offset)
#define ASSERT(E)
Definition SkMD5.cpp:130

◆ PeekListLength()

uint32_t dart::kernel::KernelReaderHelper::PeekListLength ( )
protected

Definition at line 2206 of file kernel_translation_helper.cc.

2206 {
2207 AlternativeReadingScope alt(&reader_);
2208 return reader_.ReadListLength();
2209}

◆ PeekTag()

Tag dart::kernel::KernelReaderHelper::PeekTag ( uint8_t *  payload = nullptr)

Definition at line 1296 of file kernel_binary_flowgraph.cc.

1296 {
1297 return reader_.PeekTag(payload);
1298}
Tag PeekTag(uint8_t *payload=nullptr)

◆ PeekUInt()

uint32_t dart::kernel::KernelReaderHelper::PeekUInt ( )
protected

Definition at line 2197 of file kernel_translation_helper.cc.

2197 {
2198 AlternativeReadingScope alt(&reader_);
2199 return reader_.ReadUInt();
2200}

◆ ReadBool()

bool dart::kernel::KernelReaderHelper::ReadBool ( )
protected

Definition at line 2181 of file kernel_translation_helper.cc.

2181 {
2182 return reader_.ReadBool();
2183}

◆ ReadByte()

uint8_t dart::kernel::KernelReaderHelper::ReadByte ( )
protected

Definition at line 2185 of file kernel_translation_helper.cc.

2185 {
2186 return reader_.ReadByte();
2187}

◆ ReadCanonicalNameReference()

NameIndex dart::kernel::KernelReaderHelper::ReadCanonicalNameReference ( )

Definition at line 2219 of file kernel_translation_helper.cc.

2219 {
2221}
NameIndex ReadCanonicalNameReference()

◆ ReadDouble()

double dart::kernel::KernelReaderHelper::ReadDouble ( )
protected

Definition at line 2202 of file kernel_translation_helper.cc.

2202 {
2203 return reader_.ReadDouble();
2204}

◆ ReaderOffset()

intptr_t dart::kernel::KernelReaderHelper::ReaderOffset ( ) const
protected

Definition at line 2165 of file kernel_translation_helper.cc.

2165 {
2166 return reader_.offset();
2167}
intptr_t offset() const

◆ ReaderSize()

intptr_t dart::kernel::KernelReaderHelper::ReaderSize ( ) const
protected

Definition at line 2169 of file kernel_translation_helper.cc.

2169 {
2170 return reader_.size();
2171}

◆ ReadFlags()

uint8_t dart::kernel::KernelReaderHelper::ReadFlags ( )
inlineprotected

Definition at line 1348 of file kernel_translation_helper.h.

1348{ return reader_.ReadFlags(); }

◆ ReadInterfaceMemberNameReference()

NameIndex dart::kernel::KernelReaderHelper::ReadInterfaceMemberNameReference ( )
protected

Definition at line 2223 of file kernel_translation_helper.cc.

2223 {
2224 NameIndex name_index = reader_.ReadCanonicalNameReference();
2225 NameIndex origin_name_index = reader_.ReadCanonicalNameReference();
2226 if (!FLAG_precompiled_mode && origin_name_index != NameIndex::kInvalidName) {
2227 // Reference to a skipped member signature target, return the origin target.
2228 return origin_name_index;
2229 }
2230 return name_index;
2231}
static constexpr int kInvalidName
Definition kernel.h:21

◆ ReadListLength()

intptr_t dart::kernel::KernelReaderHelper::ReadListLength ( )

Definition at line 2211 of file kernel_translation_helper.cc.

2211 {
2212 return reader_.ReadListLength();
2213}

◆ ReadNameAsFieldName()

const String & dart::kernel::KernelReaderHelper::ReadNameAsFieldName ( )
protected

Definition at line 2274 of file kernel_translation_helper.cc.

2274 {
2275 StringIndex name_index = ReadStringReference(); // read name index.
2276 if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
2277 NameIndex library_reference =
2278 ReadCanonicalNameReference(); // read library index.
2279 return H.DartFieldName(library_reference, name_index);
2280 } else {
2281 return H.DartFieldName(NameIndex(), name_index);
2282 }
2283}

◆ ReadNameAsGetterName()

const String & dart::kernel::KernelReaderHelper::ReadNameAsGetterName ( )
protected

Definition at line 2263 of file kernel_translation_helper.cc.

2263 {
2264 StringIndex name_index = ReadStringReference(); // read name index.
2265 if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
2266 NameIndex library_reference =
2267 ReadCanonicalNameReference(); // read library index.
2268 return H.DartGetterName(library_reference, name_index);
2269 } else {
2270 return H.DartGetterName(NameIndex(), name_index);
2271 }
2272}

◆ ReadNameAsMethodName()

const String & dart::kernel::KernelReaderHelper::ReadNameAsMethodName ( )
protected

Definition at line 2241 of file kernel_translation_helper.cc.

2241 {
2242 StringIndex name_index = ReadStringReference(); // read name index.
2243 if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
2244 NameIndex library_reference =
2245 ReadCanonicalNameReference(); // read library index.
2246 return H.DartMethodName(library_reference, name_index);
2247 } else {
2248 return H.DartMethodName(NameIndex(), name_index);
2249 }
2250}

◆ ReadNameAsSetterName()

const String & dart::kernel::KernelReaderHelper::ReadNameAsSetterName ( )
protected

Definition at line 2252 of file kernel_translation_helper.cc.

2252 {
2253 StringIndex name_index = ReadStringReference(); // read name index.
2254 if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
2255 NameIndex library_reference =
2256 ReadCanonicalNameReference(); // read library index.
2257 return H.DartSetterName(library_reference, name_index);
2258 } else {
2259 return H.DartSetterName(NameIndex(), name_index);
2260 }
2261}

◆ ReadNameAsStringIndex()

StringIndex dart::kernel::KernelReaderHelper::ReadNameAsStringIndex ( )
protected

Definition at line 2233 of file kernel_translation_helper.cc.

2233 {
2234 StringIndex name_index = ReadStringReference(); // read name index.
2235 if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
2236 ReadUInt(); // read library index.
2237 }
2238 return name_index;
2239}

◆ ReadNullability()

Nullability dart::kernel::KernelReaderHelper::ReadNullability ( )
protected

Definition at line 1300 of file kernel_binary_flowgraph.cc.

1300 {
1301 return reader_.ReadNullability();
1302}
Nullability ReadNullability()

◆ ReadPosition()

TokenPosition dart::kernel::KernelReaderHelper::ReadPosition ( )
protected

Definition at line 3091 of file kernel_translation_helper.cc.

3091 {
3092 TokenPosition position = reader_.ReadPosition();
3093 RecordTokenPosition(position);
3094 return position;
3095}
virtual void RecordTokenPosition(TokenPosition position)
TokenPosition ReadPosition()

◆ ReadStringReference()

StringIndex dart::kernel::KernelReaderHelper::ReadStringReference ( )
protected

Definition at line 2215 of file kernel_translation_helper.cc.

2215 {
2216 return StringIndex(ReadUInt());
2217}

◆ ReadTag()

Tag dart::kernel::KernelReaderHelper::ReadTag ( uint8_t *  payload = nullptr)
protected

Definition at line 1292 of file kernel_binary_flowgraph.cc.

1292 {
1293 return reader_.ReadTag(payload);
1294}
Tag ReadTag(uint8_t *payload=nullptr)

◆ ReadUInt()

uint32_t dart::kernel::KernelReaderHelper::ReadUInt ( )
protected

Definition at line 2189 of file kernel_translation_helper.cc.

2189 {
2190 return reader_.ReadUInt();
2191}

◆ ReadUInt32()

uint32_t dart::kernel::KernelReaderHelper::ReadUInt32 ( )
protected

Definition at line 2193 of file kernel_translation_helper.cc.

2193 {
2194 return reader_.ReadUInt32();
2195}

◆ ReadUntilFunctionNode()

void dart::kernel::KernelReaderHelper::ReadUntilFunctionNode ( )

Definition at line 2311 of file kernel_translation_helper.cc.

2311 {
2312 const Tag tag = PeekTag();
2313 switch (tag) {
2314 case kProcedure: {
2315 ProcedureHelper procedure_helper(this);
2316 procedure_helper.ReadUntilExcluding(ProcedureHelper::kFunction);
2317 // Now at start of FunctionNode.
2318 break;
2319 }
2320 case kConstructor: {
2321 ConstructorHelper constructor_helper(this);
2322 constructor_helper.ReadUntilExcluding(ConstructorHelper::kFunction);
2323 // Now at start of FunctionNode.
2324 // Notice that we also have a list of initializers after that!
2325 break;
2326 }
2328 ReadTag();
2329 ReadPosition();
2331 break;
2332 case kFunctionExpression:
2333 ReadTag();
2334 ReadPosition();
2335 break;
2336 case kFunctionNode:
2337 // Already at start of FunctionNode.
2338 break;
2339 default:
2341 "a procedure, a constructor, a local function or a function node",
2342 tag);
2343 UNREACHABLE();
2344 }
2345 ASSERT(PeekTag() == kFunctionNode);
2346}
#define UNREACHABLE()
Definition assert.h:248
Tag ReadTag(uint8_t *payload=nullptr)
virtual void ReportUnexpectedTag(const char *variant, Tag tag)
Tag PeekTag(uint8_t *payload=nullptr)

◆ ReadVariance()

Variance dart::kernel::KernelReaderHelper::ReadVariance ( )
protected

Definition at line 1304 of file kernel_binary_flowgraph.cc.

1304 {
1305 return reader_.ReadVariance();
1306}

◆ RecordTokenPosition()

virtual void dart::kernel::KernelReaderHelper::RecordTokenPosition ( TokenPosition  position)
inlineprotectedvirtual

Reimplemented in dart::kernel::KernelTokenPositionCollector.

Definition at line 1297 of file kernel_translation_helper.h.

1297 {
1298 // Do nothing by default.
1299 // This is overridden in KernelTokenPositionCollector.
1300 USE(position);
1301 }
static void USE(T &&)
Definition globals.h:618

◆ ReportUnexpectedTag()

void dart::kernel::KernelReaderHelper::ReportUnexpectedTag ( const char *  variant,
Tag  tag 
)
virtual

Reimplemented in dart::kernel::StreamingFlowGraphBuilder.

Definition at line 2306 of file kernel_translation_helper.cc.

2306 {
2307 FATAL("Unexpected tag %d (%s) in ?, expected %s", tag, Reader::TagName(tag),
2308 variant);
2309}
static const char * TagName(Tag tag)
#define FATAL(error)

◆ set_current_script_id()

virtual void dart::kernel::KernelReaderHelper::set_current_script_id ( intptr_t  id)
inlineprotectedvirtual

Reimplemented in dart::kernel::KernelTokenPositionCollector.

Definition at line 1291 of file kernel_translation_helper.h.

1291 {
1292 // Do nothing by default.
1293 // This is overridden in KernelTokenPositionCollector.
1294 USE(id);
1295 }

◆ SetOffset()

void dart::kernel::KernelReaderHelper::SetOffset ( intptr_t  offset)

Definition at line 2173 of file kernel_translation_helper.cc.

2173 {
2175}
void set_offset(intptr_t offset)
Point offset

◆ SkipArguments()

void dart::kernel::KernelReaderHelper::SkipArguments ( )
protected

Definition at line 3058 of file kernel_translation_helper.cc.

3058 {
3059 ReadUInt(); // read argument count.
3060
3061 SkipListOfDartTypes(); // read list of types.
3062 SkipListOfExpressions(); // read positional.
3063 SkipListOfNamedExpressions(); // read named.
3064}

◆ SkipBytes()

void dart::kernel::KernelReaderHelper::SkipBytes ( intptr_t  skip)
protected

Definition at line 2177 of file kernel_translation_helper.cc.

2177 {
2178 reader_.set_offset(ReaderOffset() + bytes);
2179}

◆ SkipCanonicalNameReference()

void dart::kernel::KernelReaderHelper::SkipCanonicalNameReference ( )
protected

Definition at line 2297 of file kernel_translation_helper.cc.

2297 {
2298 ReadUInt();
2299}

◆ SkipConstantReference()

void dart::kernel::KernelReaderHelper::SkipConstantReference ( )
protected

Definition at line 2293 of file kernel_translation_helper.cc.

2293 {
2294 ReadUInt();
2295}

◆ SkipDartType()

void dart::kernel::KernelReaderHelper::SkipDartType ( )
protected

Definition at line 2348 of file kernel_translation_helper.cc.

2348 {
2349 Tag tag = ReadTag();
2350 switch (tag) {
2351 case kInvalidType:
2352 case kDynamicType:
2353 case kVoidType:
2354 case kNullType:
2355 // those contain nothing.
2356 return;
2357 case kNeverType:
2359 return;
2360 case kInterfaceType:
2361 SkipInterfaceType(false);
2362 return;
2363 case kSimpleInterfaceType:
2364 SkipInterfaceType(true);
2365 return;
2366 case kFunctionType:
2367 SkipFunctionType(false);
2368 return;
2369 case kSimpleFunctionType:
2370 SkipFunctionType(true);
2371 return;
2372 case kRecordType: {
2375 const intptr_t named_count = ReadListLength();
2376 for (intptr_t i = 0; i < named_count; ++i) {
2378 SkipDartType();
2379 ReadFlags();
2380 }
2381 return;
2382 }
2383 case kExtensionType: {
2385 SkipCanonicalNameReference(); // read index for canonical name.
2386 SkipListOfDartTypes(); // read type arguments
2387 SkipDartType(); // read type erasure.
2388 break;
2389 }
2390 case kTypedefType:
2391 ReadNullability(); // read nullability.
2392 ReadUInt(); // read index for canonical name.
2393 SkipListOfDartTypes(); // read list of types.
2394 return;
2395 case kTypeParameterType:
2396 ReadNullability(); // read nullability.
2397 ReadUInt(); // read index for parameter.
2398 return;
2399 case kIntersectionType:
2400 SkipDartType(); // read left.
2401 SkipDartType(); // read right.
2402 return;
2403 case kFutureOrType:
2405 SkipDartType(); // read type argument.
2406 break;
2407 default:
2408 ReportUnexpectedTag("type", tag);
2409 UNREACHABLE();
2410 }
2411}

◆ SkipExpression()

void dart::kernel::KernelReaderHelper::SkipExpression ( )
protected

Definition at line 2547 of file kernel_translation_helper.cc.

2547 {
2548 uint8_t payload = 0;
2549 Tag tag = ReadTag(&payload);
2550 switch (tag) {
2551 case kInvalidExpression:
2552 ReadPosition();
2554 if (ReadTag() == kSomething) {
2555 SkipExpression(); // read expression.
2556 }
2557 return;
2558 case kVariableGet:
2559 ReadPosition(); // read position.
2560 ReadUInt(); // read kernel position.
2561 ReadUInt(); // read relative variable index.
2562 SkipOptionalDartType(); // read promoted type.
2563 return;
2564 case kSpecializedVariableGet:
2565 ReadPosition(); // read position.
2566 ReadUInt(); // read kernel position.
2567 return;
2568 case kVariableSet:
2569 ReadPosition(); // read position.
2570 ReadUInt(); // read kernel position.
2571 ReadUInt(); // read relative variable index.
2572 SkipExpression(); // read expression.
2573 return;
2574 case kSpecializedVariableSet:
2575 ReadPosition(); // read position.
2576 ReadUInt(); // read kernel position.
2577 SkipExpression(); // read expression.
2578 return;
2579 case kInstanceGet:
2580 ReadByte(); // read kind.
2581 ReadPosition(); // read position.
2582 SkipExpression(); // read receiver.
2583 SkipName(); // read name.
2584 SkipDartType(); // read result_type.
2585 SkipInterfaceMemberNameReference(); // read interface_target_reference.
2586 return;
2587 case kDynamicGet:
2588 ReadByte(); // read kind.
2589 ReadPosition(); // read position.
2590 SkipExpression(); // read receiver.
2591 SkipName(); // read name.
2592 return;
2593 case kInstanceTearOff:
2594 ReadByte(); // read kind.
2595 ReadPosition(); // read position.
2596 SkipExpression(); // read receiver.
2597 SkipName(); // read name.
2598 SkipDartType(); // read result_type.
2599 SkipInterfaceMemberNameReference(); // read interface_target_reference.
2600 return;
2601 case kFunctionTearOff:
2602 // Removed by lowering kernel transformation.
2603 UNREACHABLE();
2604 break;
2605 case kInstanceSet:
2606 ReadByte(); // read kind.
2607 ReadPosition(); // read position.
2608 SkipExpression(); // read receiver.
2609 SkipName(); // read name.
2610 SkipExpression(); // read value.
2611 SkipInterfaceMemberNameReference(); // read interface_target_reference.
2612 return;
2613 case kDynamicSet:
2614 ReadByte(); // read kind.
2615 ReadPosition(); // read position.
2616 SkipExpression(); // read receiver.
2617 SkipName(); // read name.
2618 SkipExpression(); // read value.
2619 return;
2620 case kAbstractSuperPropertyGet:
2621 // Abstract super property getters must be converted into super property
2622 // getters during mixin transformation.
2623 UNREACHABLE();
2624 break;
2625 case kAbstractSuperPropertySet:
2626 // Abstract super property setters must be converted into super property
2627 // setters during mixin transformation.
2628 UNREACHABLE();
2629 break;
2630 case kSuperPropertyGet:
2631 ReadPosition(); // read position.
2632 SkipName(); // read name.
2633 SkipInterfaceMemberNameReference(); // read interface_target_reference.
2634 return;
2635 case kSuperPropertySet:
2636 ReadPosition(); // read position.
2637 SkipName(); // read name.
2638 SkipExpression(); // read value.
2639 SkipInterfaceMemberNameReference(); // read interface_target_reference.
2640 return;
2641 case kStaticGet:
2642 ReadPosition(); // read position.
2643 SkipCanonicalNameReference(); // read target_reference.
2644 return;
2645 case kStaticSet:
2646 ReadPosition(); // read position.
2647 SkipCanonicalNameReference(); // read target_reference.
2648 SkipExpression(); // read expression.
2649 return;
2650 case kInstanceInvocation:
2651 ReadByte(); // read kind.
2652 ReadFlags(); // read flags.
2653 ReadPosition(); // read position.
2654 SkipExpression(); // read receiver.
2655 SkipName(); // read name.
2656 SkipArguments(); // read arguments.
2657 SkipDartType(); // read function_type.
2658 SkipInterfaceMemberNameReference(); // read interface_target_reference.
2659 return;
2660 case kDynamicInvocation:
2661 ReadByte(); // read kind.
2662 ReadByte(); // read flags.
2663 ReadPosition(); // read position.
2664 SkipExpression(); // read receiver.
2665 SkipName(); // read name.
2666 SkipArguments(); // read arguments.
2667 return;
2668 case kLocalFunctionInvocation:
2669 ReadPosition(); // read position.
2670 ReadUInt(); // read variable kernel position.
2671 ReadUInt(); // read relative variable index.
2672 SkipArguments(); // read arguments.
2673 SkipDartType(); // read function_type.
2674 return;
2675 case kFunctionInvocation:
2676 ReadByte(); // read kind.
2677 ReadPosition(); // read position.
2678 SkipExpression(); // read receiver.
2679 SkipArguments(); // read arguments.
2680 SkipDartType(); // read function_type.
2681 return;
2682 case kEqualsCall:
2683 ReadPosition(); // read position.
2684 SkipExpression(); // read left.
2685 SkipExpression(); // read right.
2686 SkipDartType(); // read function_type.
2687 SkipInterfaceMemberNameReference(); // read interface_target_reference.
2688 return;
2689 case kEqualsNull:
2690 ReadPosition(); // read position.
2691 SkipExpression(); // read expression.
2692 return;
2693 case kAbstractSuperMethodInvocation:
2694 // Abstract super method invocations must be converted into super
2695 // method invocations during mixin transformation.
2696 UNREACHABLE();
2697 break;
2698 case kSuperMethodInvocation:
2699 ReadPosition(); // read position.
2700 SkipName(); // read name.
2701 SkipArguments(); // read arguments.
2702 SkipInterfaceMemberNameReference(); // read interface_target_reference.
2703 return;
2704 case kStaticInvocation:
2705 ReadPosition(); // read position.
2706 SkipCanonicalNameReference(); // read procedure_reference.
2707 SkipArguments(); // read arguments.
2708 return;
2709 case kConstructorInvocation:
2710 ReadPosition(); // read position.
2711 SkipCanonicalNameReference(); // read target_reference.
2712 SkipArguments(); // read arguments.
2713 return;
2714 case kNot:
2715 ReadPosition(); // read position.
2716 SkipExpression(); // read expression.
2717 return;
2718 case kNullCheck:
2719 ReadPosition(); // read position.
2720 SkipExpression(); // read expression.
2721 return;
2722 case kLogicalExpression:
2723 ReadPosition(); // read position.
2724 SkipExpression(); // read left.
2725 SkipBytes(1); // read operator.
2726 SkipExpression(); // read right.
2727 return;
2728 case kConditionalExpression:
2729 ReadPosition(); // read position.
2730 SkipExpression(); // read condition.
2731 SkipExpression(); // read then.
2732 SkipExpression(); // read otherwise.
2733 SkipOptionalDartType(); // read unused static type.
2734 return;
2735 case kStringConcatenation:
2736 ReadPosition(); // read position.
2737 SkipListOfExpressions(); // read list of expressions.
2738 return;
2739 case kIsExpression:
2740 ReadPosition(); // read position.
2741 SkipFlags(); // read flags.
2742 SkipExpression(); // read operand.
2743 SkipDartType(); // read type.
2744 return;
2745 case kAsExpression:
2746 ReadPosition(); // read position.
2747 SkipFlags(); // read flags.
2748 SkipExpression(); // read operand.
2749 SkipDartType(); // read type.
2750 return;
2751 case kTypeLiteral:
2752 ReadPosition(); // read position.
2753 SkipDartType(); // read type.
2754 return;
2755 case kThisExpression:
2756 ReadPosition(); // read position.
2757 return;
2758 case kRethrow:
2759 ReadPosition(); // read position.
2760 return;
2761 case kThrow:
2762 ReadPosition(); // read position.
2763 SkipFlags(); // read flags.
2764 SkipExpression(); // read expression.
2765 return;
2766 case kListLiteral:
2767 ReadPosition(); // read position.
2768 SkipDartType(); // read type.
2769 SkipListOfExpressions(); // read list of expressions.
2770 return;
2771 case kSetLiteral:
2772 // Set literals are currently desugared in the frontend and will not
2773 // reach the VM. See http://dartbug.com/35124 for discussion.
2774 UNREACHABLE();
2775 return;
2776 case kMapLiteral: {
2777 ReadPosition(); // read position.
2778 SkipDartType(); // read key type.
2779 SkipDartType(); // read value type.
2780 intptr_t list_length = ReadListLength(); // read list length.
2781 for (intptr_t i = 0; i < list_length; ++i) {
2782 SkipExpression(); // read ith key.
2783 SkipExpression(); // read ith value.
2784 }
2785 return;
2786 }
2787 case kRecordLiteral:
2788 ReadPosition(); // read position.
2789 SkipListOfExpressions(); // read positionals.
2790 SkipListOfNamedExpressions(); // read named.
2791 SkipDartType(); // read recordType.
2792 return;
2793 case kRecordIndexGet:
2794 ReadPosition(); // read position.
2795 SkipExpression(); // read receiver.
2796 SkipDartType(); // read recordType.
2797 ReadUInt(); // read index.
2798 return;
2799 case kRecordNameGet:
2800 ReadPosition(); // read position.
2801 SkipExpression(); // read receiver.
2802 SkipDartType(); // read recordType.
2803 SkipStringReference(); // read name.
2804 return;
2805 case kFunctionExpression:
2806 ReadPosition(); // read position.
2807 SkipFunctionNode(); // read function node.
2808 return;
2809 case kLet:
2810 ReadPosition(); // read position.
2811 SkipVariableDeclaration(); // read variable declaration.
2812 SkipExpression(); // read expression.
2813 return;
2814 case kBlockExpression:
2815 ReadPosition(); // read position.
2817 SkipExpression(); // read expression.
2818 return;
2819 case kInstantiation:
2820 ReadPosition(); // read position.
2821 SkipExpression(); // read expression.
2822 SkipListOfDartTypes(); // read type arguments.
2823 return;
2824 case kBigIntLiteral:
2825 ReadPosition(); // read position.
2826 SkipStringReference(); // read string reference.
2827 return;
2828 case kStringLiteral:
2829 ReadPosition(); // read position.
2830 SkipStringReference(); // read string reference.
2831 return;
2832 case kSpecializedIntLiteral:
2833 ReadPosition(); // read position.
2834 return;
2835 case kNegativeIntLiteral:
2836 ReadPosition(); // read position.
2837 ReadUInt(); // read value.
2838 return;
2839 case kPositiveIntLiteral:
2840 ReadPosition(); // read position.
2841 ReadUInt(); // read value.
2842 return;
2843 case kDoubleLiteral:
2844 ReadPosition(); // read position.
2845 ReadDouble(); // read value.
2846 return;
2847 case kTrueLiteral:
2848 ReadPosition(); // read position.
2849 return;
2850 case kFalseLiteral:
2851 ReadPosition(); // read position.
2852 return;
2853 case kNullLiteral:
2854 ReadPosition(); // read position.
2855 return;
2856 case kConstantExpression:
2857 ReadPosition(); // read position.
2858 SkipDartType(); // read type.
2860 return;
2861 case kFileUriConstantExpression:
2862 ReadPosition(); // read position.
2863 ReadUInt(); // skip uri
2864 SkipDartType(); // read type.
2866 return;
2867 case kLoadLibrary:
2868 case kCheckLibraryIsLoaded:
2869 ReadPosition(); // read file offset.
2870 ReadUInt(); // skip library index
2871 return;
2872 case kAwaitExpression:
2873 ReadPosition(); // read position.
2874 SkipExpression(); // read operand.
2875 if (ReadTag() == kSomething) {
2876 SkipDartType(); // read runtime check type.
2877 }
2878 return;
2879 case kFileUriExpression:
2880 ReadUInt(); // skip uri
2881 ReadPosition(); // read position
2882 SkipExpression(); // read expression
2883 return;
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:
2897 // These nodes are internal to the front end and
2898 // removed by the constant evaluator.
2899 default:
2900 ReportUnexpectedTag("expression", tag);
2901 UNREACHABLE();
2902 }
2903}

◆ SkipFlags()

void dart::kernel::KernelReaderHelper::SkipFlags ( )
protected

Definition at line 2285 of file kernel_translation_helper.cc.

2285 {
2286 ReadFlags();
2287}

◆ SkipFunctionNode()

void dart::kernel::KernelReaderHelper::SkipFunctionNode ( )
protected

Definition at line 3046 of file kernel_translation_helper.cc.

3046 {
3047 FunctionNodeHelper function_node_helper(this);
3048 function_node_helper.ReadUntilExcluding(FunctionNodeHelper::kEnd);
3049}

◆ SkipFunctionType()

void dart::kernel::KernelReaderHelper::SkipFunctionType ( bool  simple)
protected

Definition at line 2431 of file kernel_translation_helper.cc.

2431 {
2432 ReadNullability(); // read nullability.
2433
2434 if (!simple) {
2435 SkipTypeParametersList(); // read type_parameters.
2436 ReadUInt(); // read required parameter count.
2437 ReadUInt(); // read total parameter count.
2438 }
2439
2440 SkipListOfDartTypes(); // read positional_parameters types.
2441
2442 if (!simple) {
2443 const intptr_t named_count =
2444 ReadListLength(); // read named_parameters list length.
2445 for (intptr_t i = 0; i < named_count; ++i) {
2446 // read string reference (i.e. named_parameters[i].name).
2448 SkipDartType(); // read named_parameters[i].type.
2449 SkipBytes(1); // read flags
2450 }
2451 }
2452
2453 SkipDartType(); // read return type.
2454}

◆ SkipInitializer()

void dart::kernel::KernelReaderHelper::SkipInitializer ( )
protected

Definition at line 2514 of file kernel_translation_helper.cc.

2514 {
2515 Tag tag = ReadTag();
2516 ReadByte(); // read isSynthetic flag.
2517 switch (tag) {
2518 case kInvalidInitializer:
2519 return;
2520 case kFieldInitializer:
2521 ReadPosition(); // read position.
2522 SkipCanonicalNameReference(); // read field_reference.
2523 SkipExpression(); // read value.
2524 return;
2525 case kSuperInitializer:
2526 ReadPosition(); // read position.
2527 SkipCanonicalNameReference(); // read target_reference.
2528 SkipArguments(); // read arguments.
2529 return;
2530 case kRedirectingInitializer:
2531 ReadPosition(); // read position.
2532 SkipCanonicalNameReference(); // read target_reference.
2533 SkipArguments(); // read arguments.
2534 return;
2535 case kLocalInitializer:
2536 SkipVariableDeclaration(); // read variable.
2537 return;
2538 case kAssertInitializer:
2539 SkipStatement();
2540 return;
2541 default:
2542 ReportUnexpectedTag("initializer", tag);
2543 UNREACHABLE();
2544 }
2545}

◆ SkipInterfaceMemberNameReference()

void dart::kernel::KernelReaderHelper::SkipInterfaceMemberNameReference ( )
protected

Definition at line 2301 of file kernel_translation_helper.cc.

◆ SkipInterfaceType()

void dart::kernel::KernelReaderHelper::SkipInterfaceType ( bool  simple)
protected

Definition at line 2423 of file kernel_translation_helper.cc.

2423 {
2424 ReadNullability(); // read nullability.
2425 ReadUInt(); // read klass_name.
2426 if (!simple) {
2427 SkipListOfDartTypes(); // read list of types.
2428 }
2429}

◆ SkipLibraryCombinator()

void dart::kernel::KernelReaderHelper::SkipLibraryCombinator ( )
protected

Definition at line 3071 of file kernel_translation_helper.cc.

3071 {
3072 ReadBool(); // read is_show.
3073 intptr_t name_count = ReadUInt(); // read list length.
3074 for (intptr_t j = 0; j < name_count; ++j) {
3075 ReadUInt(); // read ith entry of name_indices.
3076 }
3077}

◆ SkipLibraryDependency()

void dart::kernel::KernelReaderHelper::SkipLibraryDependency ( )
protected

Definition at line 3079 of file kernel_translation_helper.cc.

3079 {
3080 ReadPosition(); // read file offset.
3081 ReadFlags();
3082 SkipListOfExpressions(); // Annotations.
3084 ReadStringReference(); // Name.
3085 intptr_t combinator_count = ReadListLength();
3086 for (intptr_t i = 0; i < combinator_count; ++i) {
3088 }
3089}

◆ SkipListOfCanonicalNameReferences()

void dart::kernel::KernelReaderHelper::SkipListOfCanonicalNameReferences ( )
protected

Definition at line 2499 of file kernel_translation_helper.cc.

2499 {
2500 intptr_t list_length = ReadListLength(); // read list length.
2501 for (intptr_t i = 0; i < list_length; ++i) {
2503 }
2504}

◆ SkipListOfDartTypes()

void dart::kernel::KernelReaderHelper::SkipListOfDartTypes ( )
protected

Definition at line 2478 of file kernel_translation_helper.cc.

2478 {
2479 intptr_t list_length = ReadListLength(); // read list length.
2480 for (intptr_t i = 0; i < list_length; ++i) {
2481 SkipDartType(); // read ith type.
2482 }
2483}

◆ SkipListOfExpressions()

void dart::kernel::KernelReaderHelper::SkipListOfExpressions ( )
protected

Definition at line 2463 of file kernel_translation_helper.cc.

2463 {
2464 intptr_t list_length = ReadListLength(); // read list length.
2465 for (intptr_t i = 0; i < list_length; ++i) {
2466 SkipExpression(); // read ith expression.
2467 }
2468}

◆ SkipListOfNamedExpressions()

void dart::kernel::KernelReaderHelper::SkipListOfNamedExpressions ( )
protected

Definition at line 2470 of file kernel_translation_helper.cc.

2470 {
2471 const intptr_t list_length = ReadListLength(); // read list length.
2472 for (intptr_t i = 0; i < list_length; ++i) {
2473 SkipStringReference(); // read ith name index.
2474 SkipExpression(); // read ith expression.
2475 }
2476}

◆ SkipListOfStrings()

void dart::kernel::KernelReaderHelper::SkipListOfStrings ( )
protected

Definition at line 2485 of file kernel_translation_helper.cc.

2485 {
2486 intptr_t list_length = ReadListLength(); // read list length.
2487 for (intptr_t i = 0; i < list_length; ++i) {
2488 SkipStringReference(); // read ith string index.
2489 }
2490}

◆ SkipListOfVariableDeclarations()

void dart::kernel::KernelReaderHelper::SkipListOfVariableDeclarations ( )
protected

Definition at line 2492 of file kernel_translation_helper.cc.

2492 {
2493 intptr_t list_length = ReadListLength(); // read list length.
2494 for (intptr_t i = 0; i < list_length; ++i) {
2495 SkipVariableDeclaration(); // read ith variable declaration.
2496 }
2497}

◆ SkipName()

void dart::kernel::KernelReaderHelper::SkipName ( )
protected

Definition at line 3051 of file kernel_translation_helper.cc.

3051 {
3052 StringIndex name_index = ReadStringReference(); // read name index.
3053 if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
3054 SkipCanonicalNameReference(); // read library index.
3055 }
3056}

◆ SkipOptionalDartType()

void dart::kernel::KernelReaderHelper::SkipOptionalDartType ( )
protected

Definition at line 2413 of file kernel_translation_helper.cc.

2413 {
2414 Tag tag = ReadTag(); // read tag.
2415 if (tag == kNothing) {
2416 return;
2417 }
2418 ASSERT(tag == kSomething);
2419
2420 SkipDartType(); // read type.
2421}

◆ SkipStatement()

void dart::kernel::KernelReaderHelper::SkipStatement ( )
protected

Definition at line 2905 of file kernel_translation_helper.cc.

2905 {
2906 Tag tag = ReadTag(); // read tag.
2907 switch (tag) {
2908 case kExpressionStatement:
2909 SkipExpression(); // read expression.
2910 return;
2911 case kBlock:
2912 ReadPosition(); // read file offset.
2913 ReadPosition(); // read file end offset.
2915 return;
2916 case kEmptyStatement:
2917 return;
2918 case kAssertBlock:
2920 return;
2921 case kAssertStatement:
2922 SkipExpression(); // Read condition.
2923 ReadPosition(); // read condition start offset.
2924 ReadPosition(); // read condition end offset.
2925 if (ReadTag() == kSomething) {
2926 SkipExpression(); // read (rest of) message.
2927 }
2928 return;
2929 case kLabeledStatement:
2930 ReadPosition(); // read position.
2931 SkipStatement(); // read body.
2932 return;
2933 case kBreakStatement:
2934 ReadPosition(); // read position.
2935 ReadUInt(); // read target_index.
2936 return;
2937 case kWhileStatement:
2938 ReadPosition(); // read position.
2939 SkipExpression(); // read condition.
2940 SkipStatement(); // read body.
2941 return;
2942 case kDoStatement:
2943 ReadPosition(); // read position.
2944 SkipStatement(); // read body.
2945 SkipExpression(); // read condition.
2946 return;
2947 case kForStatement: {
2948 ReadPosition(); // read position.
2949 SkipListOfVariableDeclarations(); // read variables.
2950 Tag tag = ReadTag(); // Read first part of condition.
2951 if (tag == kSomething) {
2952 SkipExpression(); // read rest of condition.
2953 }
2954 SkipListOfExpressions(); // read updates.
2955 SkipStatement(); // read body.
2956 return;
2957 }
2958 case kSwitchStatement: {
2959 ReadPosition(); // read position.
2960 ReadBool(); // read exhaustive flag.
2961 SkipExpression(); // read condition.
2962 SkipOptionalDartType(); // read expression type
2963 int case_count = ReadListLength(); // read number of cases.
2964 for (intptr_t i = 0; i < case_count; ++i) {
2965 ReadPosition(); // read file offset.
2966 int expression_count = ReadListLength(); // read number of expressions.
2967 for (intptr_t j = 0; j < expression_count; ++j) {
2968 ReadPosition(); // read jth position.
2969 SkipExpression(); // read jth expression.
2970 }
2971 ReadBool(); // read is_default.
2972 SkipStatement(); // read body.
2973 }
2974 return;
2975 }
2976 case kContinueSwitchStatement:
2977 ReadPosition(); // read position.
2978 ReadUInt(); // read target_index.
2979 return;
2980 case kIfStatement:
2981 ReadPosition(); // read position.
2982 SkipExpression(); // read condition.
2983 SkipStatement(); // read then.
2984 SkipStatement(); // read otherwise.
2985 return;
2986 case kReturnStatement: {
2987 ReadPosition(); // read position
2988 Tag tag = ReadTag(); // read (first part of) expression.
2989 if (tag == kSomething) {
2990 SkipExpression(); // read (rest of) expression.
2991 }
2992 return;
2993 }
2994 case kTryCatch: {
2995 ReadPosition(); // read position
2996 SkipStatement(); // read body.
2997 ReadByte(); // read flags
2998 intptr_t catch_count = ReadListLength(); // read number of catches.
2999 for (intptr_t i = 0; i < catch_count; ++i) {
3000 ReadPosition(); // read position.
3001 SkipDartType(); // read guard.
3002 tag = ReadTag(); // read first part of exception.
3003 if (tag == kSomething) {
3004 SkipVariableDeclaration(); // read exception.
3005 }
3006 tag = ReadTag(); // read first part of stack trace.
3007 if (tag == kSomething) {
3008 SkipVariableDeclaration(); // read stack trace.
3009 }
3010 SkipStatement(); // read body.
3011 }
3012 return;
3013 }
3014 case kTryFinally:
3015 ReadPosition(); // read position
3016 SkipStatement(); // read body.
3017 SkipStatement(); // read finalizer.
3018 return;
3019 case kYieldStatement: {
3020 ReadPosition(); // read position.
3021 ReadByte(); // read flags.
3022 SkipExpression(); // read expression.
3023 return;
3024 }
3025 case kVariableDeclaration:
3026 SkipVariableDeclaration(); // read variable declaration.
3027 return;
3029 ReadPosition(); // read position.
3030 SkipVariableDeclaration(); // read variable.
3031 SkipFunctionNode(); // read function node.
3032 return;
3033 case kForInStatement:
3034 case kAsyncForInStatement:
3035 case kIfCaseStatement:
3036 case kPatternSwitchStatement:
3037 case kPatternVariableDeclaration:
3038 // These nodes are internal to the front end and
3039 // removed by the constant evaluator.
3040 default:
3041 ReportUnexpectedTag("statement", tag);
3042 UNREACHABLE();
3043 }
3044}

◆ SkipStatementList()

void dart::kernel::KernelReaderHelper::SkipStatementList ( )
protected

Definition at line 2456 of file kernel_translation_helper.cc.

2456 {
2457 intptr_t list_length = ReadListLength(); // read list length.
2458 for (intptr_t i = 0; i < list_length; ++i) {
2459 SkipStatement(); // read ith expression.
2460 }
2461}

◆ SkipStringReference()

void dart::kernel::KernelReaderHelper::SkipStringReference ( )
protected

Definition at line 2289 of file kernel_translation_helper.cc.

2289 {
2290 ReadUInt();
2291}

◆ SkipTypeParametersList()

void dart::kernel::KernelReaderHelper::SkipTypeParametersList ( )
protected

Definition at line 2506 of file kernel_translation_helper.cc.

2506 {
2507 intptr_t list_length = ReadListLength(); // read list length.
2508 for (intptr_t i = 0; i < list_length; ++i) {
2509 TypeParameterHelper helper(this);
2510 helper.Finish();
2511 }
2512}

◆ SkipVariableDeclaration()

void dart::kernel::KernelReaderHelper::SkipVariableDeclaration ( )
protected

◆ SourceTableImportUriFor()

String & dart::kernel::KernelReaderHelper::SourceTableImportUriFor ( intptr_t  index)
protected

Definition at line 3165 of file kernel_translation_helper.cc.

3165 {
3166 AlternativeReadingScope alt(&reader_);
3168 SkipBytes(ReadUInt()); // skip uri.
3169 SkipBytes(ReadUInt()); // skip source.
3170 const intptr_t line_start_count = ReadUInt(); // read number of line start
3171 // entries.
3172 for (intptr_t i = 0; i < line_start_count; ++i) {
3173 ReadUInt();
3174 }
3175
3176 intptr_t size = ReadUInt(); // read import uri List<byte> size.
3177 return H.DartString(reader_.BufferAt(ReaderOffset()), size, Heap::kOld);
3178}

◆ SourceTableSize()

intptr_t dart::kernel::KernelReaderHelper::SourceTableSize ( )
protected

Definition at line 3097 of file kernel_translation_helper.cc.

3097 {
3098 AlternativeReadingScope alt(&reader_);
3099 intptr_t library_count = reader_.ReadFromIndexNoReset(
3101
3102 const intptr_t count_from_first_library_offset =
3104
3105 intptr_t source_table_offset = reader_.ReadFromIndexNoReset(
3106 reader_.size(),
3107 LibraryCountFieldCountFromEnd + 1 + library_count + 1 +
3108 count_from_first_library_offset,
3109 1, 0);
3110 SetOffset(source_table_offset); // read source table offset.
3111 return reader_.ReadUInt32(); // read source table size.
3112}

◆ SourceTableUriFor()

String & dart::kernel::KernelReaderHelper::SourceTableUriFor ( intptr_t  index)
protected

Definition at line 3134 of file kernel_translation_helper.cc.

3134 {
3135 AlternativeReadingScope alt(&reader_);
3137 intptr_t size = ReadUInt(); // read uri List<byte> size.
3138 return H.DartString(reader_.BufferAt(ReaderOffset()), size, Heap::kOld);
3139}

Friends And Related Symbol Documentation

◆ CallSiteAttributesMetadataHelper

friend class CallSiteAttributesMetadataHelper
friend

Definition at line 1372 of file kernel_translation_helper.h.

◆ ClassHelper

friend class ClassHelper
friend

Definition at line 1371 of file kernel_translation_helper.h.

◆ CollectConstConstructorCoverageFrom

ArrayPtr CollectConstConstructorCoverageFrom ( const Script interesting_script)
friend

◆ ConstantHelper

friend class ConstantHelper
friend

Definition at line 1374 of file kernel_translation_helper.h.

◆ ConstantReader

friend class ConstantReader
friend

Definition at line 1373 of file kernel_translation_helper.h.

◆ ConstructorHelper

friend class ConstructorHelper
friend

Definition at line 1375 of file kernel_translation_helper.h.

◆ DirectCallMetadataHelper

friend class DirectCallMetadataHelper
friend

Definition at line 1376 of file kernel_translation_helper.h.

◆ FieldHelper

friend class FieldHelper
friend

Definition at line 1377 of file kernel_translation_helper.h.

◆ FunctionNodeHelper

friend class FunctionNodeHelper
friend

Definition at line 1378 of file kernel_translation_helper.h.

◆ InferredTypeMetadataHelper

friend class InferredTypeMetadataHelper
friend

Definition at line 1379 of file kernel_translation_helper.h.

◆ KernelLoader

friend class KernelLoader
friend

Definition at line 1380 of file kernel_translation_helper.h.

◆ LibraryDependencyHelper

friend class LibraryDependencyHelper
friend

Definition at line 1381 of file kernel_translation_helper.h.

◆ LibraryHelper

friend class LibraryHelper
friend

Definition at line 1382 of file kernel_translation_helper.h.

◆ LoadingUnitsMetadataHelper

friend class LoadingUnitsMetadataHelper
friend

Definition at line 1394 of file kernel_translation_helper.h.

◆ MetadataHelper

friend class MetadataHelper
friend

Definition at line 1383 of file kernel_translation_helper.h.

◆ NeedsDynamicInvocationForwarder

bool NeedsDynamicInvocationForwarder ( const Function function)
friend

Definition at line 657 of file kernel.cc.

657 {
658 Zone* zone = Thread::Current()->zone();
659
660 // Right now closures do not need a dyn:* forwarder.
661 // See https://github.com/dart-lang/sdk/issues/40813
662 if (function.IsClosureFunction()) return false;
663
664 // Method extractors have no parameters to check and return value is a closure
665 // and therefore not an unboxed primitive type.
666 if (function.IsMethodExtractor()) {
667 return false;
668 }
669
670 // Record field getters have no parameters to check and 'dynamic' return type.
671 if (function.IsRecordFieldGetter()) {
672 return false;
673 }
674
675 // Invoke field dispatchers are dynamically generated, will invoke a getter to
676 // obtain the field value and then invoke ".call()" on the result.
677 // Those dynamically generated dispathers don't have proper kernel metadata
678 // associated with them - we can therefore not query if there are dynamic
679 // calls to them or not and are therefore conservative.
680 if (function.IsInvokeFieldDispatcher()) {
681 return true;
682 }
683
684 // The dyn:* forwarders perform unboxing of parameters before calling the
685 // actual target (which accepts unboxed parameters) and boxes return values
686 // of the return value.
687 if (function.HasUnboxedParameters() || function.HasUnboxedReturnValue()) {
688 return true;
689 }
690
691 if (function.MaxNumberOfParametersInRegisters(zone) > 0) {
692 return true;
693 }
694
695 // There are no parameters to type check for getters and if the return value
696 // is boxed, then the dyn:* forwarder is not needed.
697 if (function.IsImplicitGetterFunction()) {
698 return false;
699 }
700
701 // Covariant parameters (both explicitly covariant and generic-covariant-impl)
702 // are checked in the body of a function and therefore don't need checks in a
703 // dynamic invocation forwarder. So dynamic invocation forwarder is only
704 // needed if there are non-covariant parameters of non-top type.
705 if (function.IsImplicitSetterFunction()) {
706 const auto& field = Field::Handle(zone, function.accessor_field());
707 return !(field.is_covariant() || field.is_generic_covariant_impl());
708 }
709
710 const auto& type_params =
711 TypeParameters::Handle(zone, function.type_parameters());
712 if (!type_params.IsNull()) {
713 auto& bound = AbstractType::Handle(zone);
714 for (intptr_t i = 0, n = type_params.Length(); i < n; ++i) {
715 bound = type_params.BoundAt(i);
716 if (!bound.IsTopTypeForSubtyping() &&
717 !type_params.IsGenericCovariantImplAt(i)) {
718 return true;
719 }
720 }
721 }
722
723 const intptr_t num_params = function.NumParameters();
724 BitVector is_covariant(zone, num_params);
725 BitVector is_generic_covariant_impl(zone, num_params);
726 ReadParameterCovariance(function, &is_covariant, &is_generic_covariant_impl);
727
728 auto& type = AbstractType::Handle(zone);
729 for (intptr_t i = function.NumImplicitParameters(); i < num_params; ++i) {
730 type = function.ParameterTypeAt(i);
731 if (!type.IsTopTypeForSubtyping() &&
732 !is_generic_covariant_impl.Contains(i) && !is_covariant.Contains(i)) {
733 return true;
734 }
735 }
736
737 return false;
738}
static Object & Handle()
Definition object.h:407
Zone * zone() const
static Thread * Current()
Definition thread.h:361
Dart_NativeFunction function
Definition fuchsia.cc:51

◆ ObfuscationProhibitionsMetadataHelper

Definition at line 1393 of file kernel_translation_helper.h.

◆ ProcedureAttributesMetadataHelper

friend class ProcedureAttributesMetadataHelper
friend

Definition at line 1384 of file kernel_translation_helper.h.

◆ ProcedureHelper

friend class ProcedureHelper
friend

Definition at line 1385 of file kernel_translation_helper.h.

◆ ScopeBuilder

friend class ScopeBuilder
friend

Definition at line 1387 of file kernel_translation_helper.h.

◆ SimpleExpressionConverter

friend class SimpleExpressionConverter
friend

Definition at line 1386 of file kernel_translation_helper.h.

◆ TableSelectorMetadataHelper

friend class TableSelectorMetadataHelper
friend

Definition at line 1388 of file kernel_translation_helper.h.

◆ TypeParameterHelper

friend class TypeParameterHelper
friend

Definition at line 1389 of file kernel_translation_helper.h.

◆ TypeTranslator

friend class TypeTranslator
friend

Definition at line 1390 of file kernel_translation_helper.h.

◆ UnboxingInfoMetadataHelper

friend class UnboxingInfoMetadataHelper
friend

Definition at line 1391 of file kernel_translation_helper.h.

◆ VariableDeclarationHelper

friend class VariableDeclarationHelper
friend

Definition at line 1392 of file kernel_translation_helper.h.

Member Data Documentation

◆ data_program_offset_

intptr_t dart::kernel::KernelReaderHelper::data_program_offset_
protected

Definition at line 1369 of file kernel_translation_helper.h.

◆ reader_

Reader dart::kernel::KernelReaderHelper::reader_
protected

Definition at line 1362 of file kernel_translation_helper.h.

◆ translation_helper_

TranslationHelper& dart::kernel::KernelReaderHelper::translation_helper_
protected

Definition at line 1361 of file kernel_translation_helper.h.

◆ zone_

Zone* dart::kernel::KernelReaderHelper::zone_
protected

Definition at line 1360 of file kernel_translation_helper.h.


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