Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
dart::kernel::KernelFingerprintHelper Class Reference
Inheritance diagram for dart::kernel::KernelFingerprintHelper:
dart::kernel::KernelReaderHelper

Public Member Functions

 KernelFingerprintHelper (Zone *zone, TranslationHelper *translation_helper, const TypedDataView &data, intptr_t data_program_offset)
 
virtual ~KernelFingerprintHelper ()
 
uint32_t CalculateFieldFingerprint ()
 
uint32_t CalculateFunctionFingerprint ()
 
- Public Member Functions inherited from dart::kernel::KernelReaderHelper
 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)
 

Static Public Member Functions

static uint32_t CalculateHash (uint32_t current, uint32_t val)
 

Additional Inherited Members

- Protected Member Functions inherited from dart::kernel::KernelReaderHelper
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 inherited from dart::kernel::KernelReaderHelper
Zonezone_
 
TranslationHelpertranslation_helper_
 
Reader reader_
 
intptr_t data_program_offset_
 

Detailed Description

Definition at line 14 of file kernel_fingerprints.cc.

Constructor & Destructor Documentation

◆ KernelFingerprintHelper()

dart::kernel::KernelFingerprintHelper::KernelFingerprintHelper ( Zone zone,
TranslationHelper translation_helper,
const TypedDataView data,
intptr_t  data_program_offset 
)
inline

Definition at line 16 of file kernel_fingerprints.cc.

20 : KernelReaderHelper(zone, translation_helper, data, data_program_offset),
21 hash_(0) {}
KernelReaderHelper(Zone *zone, TranslationHelper *translation_helper, const TypedDataBase &data, intptr_t data_program_offset)
static int8_t data[kExtLength]

◆ ~KernelFingerprintHelper()

virtual dart::kernel::KernelFingerprintHelper::~KernelFingerprintHelper ( )
inlinevirtual

Definition at line 23 of file kernel_fingerprints.cc.

23{}

Member Function Documentation

◆ CalculateFieldFingerprint()

uint32_t dart::kernel::KernelFingerprintHelper::CalculateFieldFingerprint ( )

Definition at line 875 of file kernel_fingerprints.cc.

875 {
876 hash_ = 0;
877 FieldHelper field_helper(this);
878
879 field_helper.ReadUntilExcluding(FieldHelper::kName);
880 const String& name = ReadNameAsFieldName(); // read name.
881 field_helper.SetJustRead(FieldHelper::kName);
882
883 field_helper.ReadUntilExcluding(FieldHelper::kType);
884 CalculateDartTypeFingerprint(); // read type.
885 field_helper.SetJustRead(FieldHelper::kType);
886
887 if (ReadTag() == kSomething) {
888 if (PeekTag() == kFunctionExpression) {
889 AlternativeReadingScope alt(&reader_);
890 CalculateExpressionFingerprint();
891 }
893 }
894
895 BuildHash(name.Hash());
896 BuildHash(field_helper.flags_);
897 BuildHash(field_helper.annotation_count_);
898 return hash_;
899}
Tag ReadTag(uint8_t *payload=nullptr)
Tag PeekTag(uint8_t *payload=nullptr)
const char *const name

◆ CalculateFunctionFingerprint()

uint32_t dart::kernel::KernelFingerprintHelper::CalculateFunctionFingerprint ( )

Definition at line 932 of file kernel_fingerprints.cc.

932 {
933 hash_ = 0;
934 Tag tag = PeekTag();
935 if (tag == kField) {
937 } else if (tag == kConstructor) {
938 CalculateConstructorFingerprint();
939 return hash_;
940 }
941 ProcedureHelper procedure_helper(this);
942 procedure_helper.ReadUntilExcluding(ProcedureHelper::kName);
943 const String& name = ReadNameAsMethodName(); // Read name.
944 procedure_helper.SetJustRead(ProcedureHelper::kName);
945
946 procedure_helper.ReadUntilExcluding(ProcedureHelper::kFunction);
947 CalculateFunctionNodeFingerprint();
948
949 BuildHash(procedure_helper.kind_);
950 BuildHash(procedure_helper.flags_);
951 BuildHash(procedure_helper.annotation_count_);
952 BuildHash(procedure_helper.stub_kind_);
953 BuildHash(name.Hash());
954 return hash_;
955}

◆ CalculateHash()

static uint32_t dart::kernel::KernelFingerprintHelper::CalculateHash ( uint32_t  current,
uint32_t  val 
)
inlinestatic

Definition at line 27 of file kernel_fingerprints.cc.

27 {
28 return current * 31 + val;
29 }

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