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

#include <kernel_translation_helper.h>

Public Types

enum  Field {
  kStart , kCanonicalName , kSourceUriIndex , kStartPosition ,
  kPosition , kEndPosition , kKind , kStubKind ,
  kFlags , kName , kAnnotations , kStubTarget ,
  kSignatureType , kFunction , kEnd
}
 
enum  Kind {
  kMethod , kGetter , kSetter , kOperator ,
  kFactory
}
 
enum  StubKind {
  kRegularStubKind , kAbstractForwardingStubKind , kConcreteForwardingStubKind , kNoSuchMethodForwarderStubKind ,
  kMemberSignatureStubKind , kAbstractMixinStubKind , kConcreteMixinStubKind
}
 
enum  Flag {
  kStatic = 1 << 0 , kAbstract = 1 << 1 , kExternal = 1 << 2 , kConst = 1 << 3 ,
  kExtensionMember = 1 << 4 , kSyntheticProcedure = 1 << 5 , kInternalImplementation = 1 << 6 , kExtensionTypeMember = 1 << 7 ,
  kHasWeakTearoffReferencePragma = 1 << 8
}
 

Public Member Functions

 ProcedureHelper (KernelReaderHelper *helper)
 
void ReadUntilIncluding (Field field)
 
void ReadUntilExcluding (Field field)
 
void SetNext (Field field)
 
void SetJustRead (Field field)
 
bool IsStatic () const
 
bool IsAbstract () const
 
bool IsExternal () const
 
bool IsConst () const
 
bool IsSynthetic () const
 
bool IsInternalImplementation () const
 
bool IsForwardingStub () const
 
bool IsNoSuchMethodForwarder () const
 
bool IsExtensionMember () const
 
bool IsExtensionTypeMember () const
 
bool IsMemberSignature () const
 

Public Attributes

NameIndex canonical_name_
 
TokenPosition start_position_ = TokenPosition::kNoSource
 
TokenPosition position_ = TokenPosition::kNoSource
 
TokenPosition end_position_ = TokenPosition::kNoSource
 
Kind kind_
 
uint32_t flags_ = 0
 
intptr_t source_uri_index_ = 0
 
intptr_t annotation_count_ = 0
 
StubKind stub_kind_
 
NameIndex concrete_forwarding_stub_target_
 

Detailed Description

Definition at line 554 of file kernel_translation_helper.h.

Member Enumeration Documentation

◆ Field

Enumerator
kStart 
kCanonicalName 
kSourceUriIndex 
kStartPosition 
kPosition 
kEndPosition 
kKind 
kStubKind 
kFlags 
kName 
kAnnotations 
kStubTarget 
kSignatureType 
kFunction 
kEnd 

Definition at line 556 of file kernel_translation_helper.h.

556 {
557 kStart, // tag.
561 kPosition,
563 kKind,
564 kStubKind,
565 kFlags,
566 kName,
570 kFunction,
571 kEnd,
572 };

◆ Flag

Enumerator
kStatic 
kAbstract 
kExternal 
kConst 
kExtensionMember 
kSyntheticProcedure 
kInternalImplementation 
kExtensionTypeMember 
kHasWeakTearoffReferencePragma 

Definition at line 592 of file kernel_translation_helper.h.

◆ Kind

◆ StubKind

Enumerator
kRegularStubKind 
kAbstractForwardingStubKind 
kConcreteForwardingStubKind 
kNoSuchMethodForwarderStubKind 
kMemberSignatureStubKind 
kAbstractMixinStubKind 
kConcreteMixinStubKind 

Definition at line 582 of file kernel_translation_helper.h.

Constructor & Destructor Documentation

◆ ProcedureHelper()

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

Definition at line 604 of file kernel_translation_helper.h.

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

Member Function Documentation

◆ IsAbstract()

bool dart::kernel::ProcedureHelper::IsAbstract ( ) const
inline

Definition at line 617 of file kernel_translation_helper.h.

◆ IsConst()

bool dart::kernel::ProcedureHelper::IsConst ( ) const
inline

Definition at line 619 of file kernel_translation_helper.h.

619{ return (flags_ & kConst) != 0; }

◆ IsExtensionMember()

bool dart::kernel::ProcedureHelper::IsExtensionMember ( ) const
inline

Definition at line 631 of file kernel_translation_helper.h.

631{ return (flags_ & kExtensionMember) != 0; }

◆ IsExtensionTypeMember()

bool dart::kernel::ProcedureHelper::IsExtensionTypeMember ( ) const
inline

Definition at line 632 of file kernel_translation_helper.h.

632 {
633 return (flags_ & kExtensionTypeMember) != 0;
634 }

◆ IsExternal()

bool dart::kernel::ProcedureHelper::IsExternal ( ) const
inline

Definition at line 618 of file kernel_translation_helper.h.

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

◆ IsForwardingStub()

bool dart::kernel::ProcedureHelper::IsForwardingStub ( ) const
inline

◆ IsInternalImplementation()

bool dart::kernel::ProcedureHelper::IsInternalImplementation ( ) const
inline

Definition at line 621 of file kernel_translation_helper.h.

621 {
622 return (flags_ & kInternalImplementation) != 0;
623 }

◆ IsMemberSignature()

bool dart::kernel::ProcedureHelper::IsMemberSignature ( ) const
inline

Definition at line 635 of file kernel_translation_helper.h.

635 {
637 }

◆ IsNoSuchMethodForwarder()

bool dart::kernel::ProcedureHelper::IsNoSuchMethodForwarder ( ) const
inline

Definition at line 628 of file kernel_translation_helper.h.

628 {
630 }

◆ IsStatic()

bool dart::kernel::ProcedureHelper::IsStatic ( ) const
inline

Definition at line 616 of file kernel_translation_helper.h.

616{ return (flags_ & kStatic) != 0; }

◆ IsSynthetic()

bool dart::kernel::ProcedureHelper::IsSynthetic ( ) const
inline

Definition at line 620 of file kernel_translation_helper.h.

620{ return (flags_ & kSyntheticProcedure) != 0; }

◆ ReadUntilExcluding()

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

Definition at line 1169 of file kernel_translation_helper.cc.

1169 {
1170 if (field <= next_read_) return;
1171
1172 // Ordered with fall-through.
1173 switch (next_read_) {
1174 case kStart: {
1175 Tag tag = helper_->ReadTag(); // read tag.
1176 ASSERT(tag == kProcedure);
1177 if (++next_read_ == field) return;
1178 }
1180 case kCanonicalName:
1182 helper_->ReadCanonicalNameReference(); // read canonical_name.
1183 if (++next_read_ == field) return;
1185 case kSourceUriIndex:
1186 source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
1188 if (++next_read_ == field) return;
1190 case kStartPosition:
1191 start_position_ = helper_->ReadPosition(); // read position.
1192 if (++next_read_ == field) return;
1194 case kPosition:
1195 position_ = helper_->ReadPosition(); // read position.
1196 if (++next_read_ == field) return;
1198 case kEndPosition:
1199 end_position_ = helper_->ReadPosition(); // read end position.
1200 if (++next_read_ == field) return;
1202 case kKind:
1203 kind_ = static_cast<Kind>(helper_->ReadByte());
1204 if (++next_read_ == field) return;
1206 case kStubKind:
1207 stub_kind_ = static_cast<StubKind>(helper_->ReadByte());
1208 if (++next_read_ == field) return;
1210 case kFlags:
1211 flags_ = helper_->ReadUInt();
1212 if (++next_read_ == field) return;
1214 case kName:
1215 helper_->SkipName(); // read name.
1216 if (++next_read_ == field) return;
1218 case kAnnotations: {
1219 annotation_count_ = helper_->ReadListLength(); // read list length.
1220 for (intptr_t i = 0; i < annotation_count_; ++i) {
1221 helper_->SkipExpression(); // read ith expression.
1222 }
1223 if (++next_read_ == field) return;
1224 }
1226 case kStubTarget:
1229 helper_->ReadCanonicalNameReference();
1230 } else {
1231 helper_->ReadCanonicalNameReference();
1232 }
1233 if (++next_read_ == field) return;
1235 case kSignatureType:
1236 helper_->SkipOptionalDartType(); // read signature type.
1237 if (++next_read_ == field) return;
1239 case kFunction:
1240 helper_->SkipFunctionNode(); // read function node.
1241 if (++next_read_ == field) return;
1243 case kEnd:
1244 return;
1245 }
1246}
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::ProcedureHelper::ReadUntilIncluding ( Field  field)
inline

Definition at line 607 of file kernel_translation_helper.h.

607 {
608 ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
609 }

◆ SetJustRead()

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

Definition at line 614 of file kernel_translation_helper.h.

614{ next_read_ = field + 1; }

◆ SetNext()

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

Definition at line 613 of file kernel_translation_helper.h.

613{ next_read_ = field; }

Member Data Documentation

◆ annotation_count_

intptr_t dart::kernel::ProcedureHelper::annotation_count_ = 0

Definition at line 646 of file kernel_translation_helper.h.

◆ canonical_name_

NameIndex dart::kernel::ProcedureHelper::canonical_name_

Definition at line 639 of file kernel_translation_helper.h.

◆ concrete_forwarding_stub_target_

NameIndex dart::kernel::ProcedureHelper::concrete_forwarding_stub_target_

Definition at line 650 of file kernel_translation_helper.h.

◆ end_position_

TokenPosition dart::kernel::ProcedureHelper::end_position_ = TokenPosition::kNoSource

Definition at line 642 of file kernel_translation_helper.h.

◆ flags_

uint32_t dart::kernel::ProcedureHelper::flags_ = 0

Definition at line 644 of file kernel_translation_helper.h.

◆ kind_

Kind dart::kernel::ProcedureHelper::kind_

Definition at line 643 of file kernel_translation_helper.h.

◆ position_

TokenPosition dart::kernel::ProcedureHelper::position_ = TokenPosition::kNoSource

Definition at line 641 of file kernel_translation_helper.h.

◆ source_uri_index_

intptr_t dart::kernel::ProcedureHelper::source_uri_index_ = 0

Definition at line 645 of file kernel_translation_helper.h.

◆ start_position_

TokenPosition dart::kernel::ProcedureHelper::start_position_ = TokenPosition::kNoSource

Definition at line 640 of file kernel_translation_helper.h.

◆ stub_kind_

StubKind dart::kernel::ProcedureHelper::stub_kind_

Definition at line 647 of file kernel_translation_helper.h.


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