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

Public Member Functions

 MetadataEvaluator (Zone *zone, TranslationHelper *translation_helper, const TypedDataView &data, intptr_t data_program_offset, ActiveClass *active_class)
 
ObjectPtr EvaluateMetadata (intptr_t kernel_offset, bool is_annotations_offset)
 
- 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)
 

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 413 of file kernel.cc.

Constructor & Destructor Documentation

◆ MetadataEvaluator()

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

Definition at line 415 of file kernel.cc.

420 : KernelReaderHelper(zone, translation_helper, data, data_program_offset),
421 constant_reader_(this, active_class) {}
KernelReaderHelper(Zone *zone, TranslationHelper *translation_helper, const TypedDataBase &data, intptr_t data_program_offset)
static int8_t data[kExtLength]

Member Function Documentation

◆ EvaluateMetadata()

ObjectPtr dart::kernel::MetadataEvaluator::EvaluateMetadata ( intptr_t  kernel_offset,
bool  is_annotations_offset 
)
inline

Definition at line 423 of file kernel.cc.

424 {
425 SetOffset(kernel_offset);
426
427 // Library and LibraryDependency objects do not have a tag in kernel binary.
428 // Synthetic metadata fields corresponding to these objects keep kernel
429 // offset of annotations list instead of annotated object.
430 if (!is_annotations_offset) {
431 const Tag tag = PeekTag();
432
433 if (tag == kClass) {
434 ClassHelper class_helper(this);
435 class_helper.ReadUntilExcluding(ClassHelper::kAnnotations);
436 } else if (tag == kProcedure) {
437 ProcedureHelper procedure_helper(this);
438 procedure_helper.ReadUntilExcluding(ProcedureHelper::kAnnotations);
439 } else if (tag == kField) {
440 FieldHelper field_helper(this);
441 field_helper.ReadUntilExcluding(FieldHelper::kAnnotations);
442 } else if (tag == kConstructor) {
443 ConstructorHelper constructor_helper(this);
444 constructor_helper.ReadUntilExcluding(ConstructorHelper::kAnnotations);
445 } else if (tag == kFunctionDeclaration) {
446 ReadTag();
447 ReadPosition(); // fileOffset
448 VariableDeclarationHelper variable_declaration_helper(this);
449 variable_declaration_helper.ReadUntilExcluding(
451 } else {
452 FATAL("No support for metadata on this type of kernel node: %" Pd32
453 "\n",
454 tag);
455 }
456 }
457
458 return constant_reader_.ReadAnnotations();
459 }
Tag ReadTag(uint8_t *payload=nullptr)
Tag PeekTag(uint8_t *payload=nullptr)
#define FATAL(error)
#define Pd32
Definition: globals.h:412

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