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

#include <kernel_translation_helper.h>

Public Types

enum  Field {
  kStart , kCanonicalName , kSourceUriIndex , kStartPosition ,
  kPosition , kEndPosition , kFlags , kName ,
  kAnnotations , kFunction , kInitializers , kEnd
}
 
enum  Flag { kConst = 1 << 0 , kExternal = 1 << 1 , kSynthetic = 1 << 2 }
 

Public Member Functions

 ConstructorHelper (KernelReaderHelper *helper)
 
void ReadUntilIncluding (Field field)
 
void ReadUntilExcluding (Field field)
 
void SetNext (Field field)
 
void SetJustRead (Field field)
 
bool IsExternal ()
 
bool IsConst ()
 
bool IsSynthetic ()
 

Public Attributes

NameIndex canonical_name_
 
TokenPosition start_position_ = TokenPosition::kNoSource
 
TokenPosition position_ = TokenPosition::kNoSource
 
TokenPosition end_position_ = TokenPosition::kNoSource
 
uint8_t flags_ = 0
 
intptr_t source_uri_index_ = 0
 
intptr_t annotation_count_ = 0
 

Detailed Description

Definition at line 666 of file kernel_translation_helper.h.

Member Enumeration Documentation

◆ Field

Enumerator
kStart 
kCanonicalName 
kSourceUriIndex 
kStartPosition 
kPosition 
kEndPosition 
kFlags 
kName 
kAnnotations 
kFunction 
kInitializers 
kEnd 

Definition at line 668 of file kernel_translation_helper.h.

◆ Flag

Enumerator
kConst 
kExternal 
kSynthetic 

Definition at line 683 of file kernel_translation_helper.h.

Constructor & Destructor Documentation

◆ ConstructorHelper()

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

Definition at line 689 of file kernel_translation_helper.h.

690 : helper_(helper), next_read_(kStart) {}

Member Function Documentation

◆ IsConst()

bool dart::kernel::ConstructorHelper::IsConst ( )
inline

Definition at line 702 of file kernel_translation_helper.h.

◆ IsExternal()

bool dart::kernel::ConstructorHelper::IsExternal ( )
inline

Definition at line 701 of file kernel_translation_helper.h.

701{ return (flags_ & kExternal) != 0; }

◆ IsSynthetic()

bool dart::kernel::ConstructorHelper::IsSynthetic ( )
inline

Definition at line 703 of file kernel_translation_helper.h.

703{ return (flags_ & kSynthetic) != 0; }

◆ ReadUntilExcluding()

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

Definition at line 1248 of file kernel_translation_helper.cc.

1248 {
1249 if (field <= next_read_) return;
1250
1251 // Ordered with fall-through.
1252 switch (next_read_) {
1253 case kStart: {
1254 Tag tag = helper_->ReadTag(); // read tag.
1255 ASSERT(tag == kConstructor);
1256 if (++next_read_ == field) return;
1257 }
1259 case kCanonicalName:
1261 helper_->ReadCanonicalNameReference(); // read canonical_name.
1262 if (++next_read_ == field) return;
1264 case kSourceUriIndex:
1265 source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
1267 if (++next_read_ == field) return;
1269 case kStartPosition:
1270 start_position_ = helper_->ReadPosition(); // read position.
1271 if (++next_read_ == field) return;
1273 case kPosition:
1274 position_ = helper_->ReadPosition(); // read position.
1275 if (++next_read_ == field) return;
1277 case kEndPosition:
1278 end_position_ = helper_->ReadPosition(); // read end position.
1279 if (++next_read_ == field) return;
1281 case kFlags:
1282 flags_ = helper_->ReadFlags();
1283 if (++next_read_ == field) return;
1285 case kName:
1286 helper_->SkipName(); // read name.
1287 if (++next_read_ == field) return;
1289 case kAnnotations: {
1290 annotation_count_ = helper_->ReadListLength(); // read list length.
1291 for (intptr_t i = 0; i < annotation_count_; ++i) {
1292 helper_->SkipExpression(); // read ith expression.
1293 }
1294 if (++next_read_ == field) return;
1295 }
1297 case kFunction:
1298 helper_->SkipFunctionNode(); // read function.
1299 if (++next_read_ == field) return;
1301 case kInitializers: {
1302 intptr_t list_length =
1303 helper_->ReadListLength(); // read initializers list length.
1304 for (intptr_t i = 0; i < list_length; i++) {
1305 helper_->SkipInitializer();
1306 }
1307 if (++next_read_ == field) return;
1308 }
1310 case kEnd:
1311 return;
1312 }
1313}
Tag ReadTag(uint8_t *payload=nullptr)
virtual void set_current_script_id(intptr_t id)
#define ASSERT(E)
#define FALL_THROUGH
Definition: globals.h:15

◆ ReadUntilIncluding()

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

Definition at line 692 of file kernel_translation_helper.h.

692 {
693 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
694 }

◆ SetJustRead()

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

Definition at line 699 of file kernel_translation_helper.h.

699{ next_read_ = field + 1; }

◆ SetNext()

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

Definition at line 698 of file kernel_translation_helper.h.

698{ next_read_ = field; }

Member Data Documentation

◆ annotation_count_

intptr_t dart::kernel::ConstructorHelper::annotation_count_ = 0

Definition at line 711 of file kernel_translation_helper.h.

◆ canonical_name_

NameIndex dart::kernel::ConstructorHelper::canonical_name_

Definition at line 705 of file kernel_translation_helper.h.

◆ end_position_

TokenPosition dart::kernel::ConstructorHelper::end_position_ = TokenPosition::kNoSource

Definition at line 708 of file kernel_translation_helper.h.

◆ flags_

uint8_t dart::kernel::ConstructorHelper::flags_ = 0

Definition at line 709 of file kernel_translation_helper.h.

◆ position_

TokenPosition dart::kernel::ConstructorHelper::position_ = TokenPosition::kNoSource

Definition at line 707 of file kernel_translation_helper.h.

◆ source_uri_index_

intptr_t dart::kernel::ConstructorHelper::source_uri_index_ = 0

Definition at line 710 of file kernel_translation_helper.h.

◆ start_position_

TokenPosition dart::kernel::ConstructorHelper::start_position_ = TokenPosition::kNoSource

Definition at line 706 of file kernel_translation_helper.h.


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