Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Public Attributes | List of all members
dart::kernel::FunctionNodeHelper Class Reference

#include <kernel_translation_helper.h>

Public Types

enum  Field {
  kStart , kPosition , kEndPosition , kAsyncMarker ,
  kDartAsyncMarker , kTypeParameters , kTotalParameterCount , kRequiredParameterCount ,
  kPositionalParameters , kNamedParameters , kReturnType , kEmittedValueType ,
  kRedirectingFactoryTarget , kBody , kEnd
}
 
enum  AsyncMarker : intptr_t { kSync = 0 , kSyncStar = 1 , kAsync = 2 , kAsyncStar = 3 }
 

Public Member Functions

 FunctionNodeHelper (KernelReaderHelper *helper)
 
void ReadUntilIncluding (Field field)
 
void ReadUntilExcluding (Field field)
 
void SetNext (Field field)
 
void SetJustRead (Field field)
 

Public Attributes

TokenPosition position_ = TokenPosition::kNoSource
 
TokenPosition end_position_ = TokenPosition::kNoSource
 
AsyncMarker async_marker_
 
AsyncMarker dart_async_marker_
 
intptr_t total_parameter_count_ = 0
 
intptr_t required_parameter_count_ = 0
 

Detailed Description

Definition at line 283 of file kernel_translation_helper.h.

Member Enumeration Documentation

◆ AsyncMarker

Enumerator
kSync 
kSyncStar 
kAsync 
kAsyncStar 

Definition at line 303 of file kernel_translation_helper.h.

◆ Field

Enumerator
kStart 
kPosition 
kEndPosition 
kAsyncMarker 
kDartAsyncMarker 
kTypeParameters 
kTotalParameterCount 
kRequiredParameterCount 
kPositionalParameters 
kNamedParameters 
kReturnType 
kEmittedValueType 
kRedirectingFactoryTarget 
kBody 
kEnd 

Definition at line 285 of file kernel_translation_helper.h.

285 {
286 kStart, // tag.
287 kPosition,
299 kBody,
300 kEnd,
301 };

Constructor & Destructor Documentation

◆ FunctionNodeHelper()

dart::kernel::FunctionNodeHelper::FunctionNodeHelper ( KernelReaderHelper helper)
inlineexplicit

Definition at line 310 of file kernel_translation_helper.h.

310 {
311 helper_ = helper;
312 next_read_ = kStart;
313 }

Member Function Documentation

◆ ReadUntilExcluding()

void dart::kernel::FunctionNodeHelper::ReadUntilExcluding ( Field  field)

Definition at line 935 of file kernel_translation_helper.cc.

935 {
936 if (field <= next_read_) return;
937
938 // Ordered with fall-through.
939 switch (next_read_) {
940 case kStart: {
941 Tag tag = helper_->ReadTag(); // read tag.
942 ASSERT(tag == kFunctionNode);
943 if (++next_read_ == field) return;
944 }
946 case kPosition:
947 position_ = helper_->ReadPosition(); // read position.
948 if (++next_read_ == field) return;
950 case kEndPosition:
951 end_position_ = helper_->ReadPosition(); // read end position.
952 if (++next_read_ == field) return;
954 case kAsyncMarker:
955 async_marker_ = static_cast<AsyncMarker>(helper_->ReadByte());
956 if (++next_read_ == field) return;
958 case kDartAsyncMarker:
959 dart_async_marker_ = static_cast<AsyncMarker>(
960 helper_->ReadByte()); // read dart async marker.
961 if (++next_read_ == field) return;
963 case kTypeParameters:
964 helper_->SkipTypeParametersList(); // read type parameters.
965 if (++next_read_ == field) return;
969 helper_->ReadUInt(); // read total parameter count.
970 if (++next_read_ == field) return;
974 helper_->ReadUInt(); // read required parameter count.
975 if (++next_read_ == field) return;
978 helper_->SkipListOfVariableDeclarations(); // read positionals.
979 if (++next_read_ == field) return;
981 case kNamedParameters:
982 helper_->SkipListOfVariableDeclarations(); // read named.
983 if (++next_read_ == field) return;
985 case kReturnType:
986 helper_->SkipDartType(); // read return type.
987 if (++next_read_ == field) return;
990 helper_->SkipOptionalDartType(); // read emitted value type.
991 if (++next_read_ == field) return;
994 Tag tag = helper_->ReadTag(); // read tag.
995 if (tag == kSomething) {
996 helper_->ReadCanonicalNameReference(); // read target.
997 tag = helper_->ReadTag();
998 if (tag == kSomething) {
999 helper_->SkipListOfDartTypes(); // read type arguments.
1000 } else {
1001 ASSERT(tag == kNothing);
1002 }
1003 tag = helper_->ReadTag();
1004 if (tag == kSomething) {
1005 helper_->ReadStringReference(); // read error message.
1006 } else {
1007 ASSERT(tag == kNothing);
1008 }
1009 } else {
1010 ASSERT(tag == kNothing);
1011 }
1012 if (++next_read_ == field) return;
1013 }
1015 case kBody:
1016 if (helper_->ReadTag() == kSomething)
1017 helper_->SkipStatement(); // read body.
1018 if (++next_read_ == field) return;
1020 case kEnd:
1021 return;
1022 }
1023}
Tag ReadTag(uint8_t *payload=nullptr)
#define ASSERT(E)
#define FALL_THROUGH
Definition: globals.h:15

◆ ReadUntilIncluding()

void dart::kernel::FunctionNodeHelper::ReadUntilIncluding ( Field  field)
inline

Definition at line 315 of file kernel_translation_helper.h.

315 {
316 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
317 }

◆ SetJustRead()

void dart::kernel::FunctionNodeHelper::SetJustRead ( Field  field)
inline

Definition at line 322 of file kernel_translation_helper.h.

322{ next_read_ = field + 1; }

◆ SetNext()

void dart::kernel::FunctionNodeHelper::SetNext ( Field  field)
inline

Definition at line 321 of file kernel_translation_helper.h.

321{ next_read_ = field; }

Member Data Documentation

◆ async_marker_

AsyncMarker dart::kernel::FunctionNodeHelper::async_marker_

Definition at line 326 of file kernel_translation_helper.h.

◆ dart_async_marker_

AsyncMarker dart::kernel::FunctionNodeHelper::dart_async_marker_

Definition at line 327 of file kernel_translation_helper.h.

◆ end_position_

TokenPosition dart::kernel::FunctionNodeHelper::end_position_ = TokenPosition::kNoSource

Definition at line 325 of file kernel_translation_helper.h.

◆ position_

TokenPosition dart::kernel::FunctionNodeHelper::position_ = TokenPosition::kNoSource

Definition at line 324 of file kernel_translation_helper.h.

◆ required_parameter_count_

intptr_t dart::kernel::FunctionNodeHelper::required_parameter_count_ = 0

Definition at line 329 of file kernel_translation_helper.h.

◆ total_parameter_count_

intptr_t dart::kernel::FunctionNodeHelper::total_parameter_count_ = 0

Definition at line 328 of file kernel_translation_helper.h.


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