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

#include <kernel_loader.h>

Public Member Functions

 LibraryIndex (const TypedDataView &kernel_data)
 
intptr_t class_count () const
 
intptr_t procedure_count () const
 
intptr_t ClassOffset (intptr_t index) const
 
intptr_t ProcedureOffset (intptr_t index) const
 
intptr_t SizeOfClassAtOffset (intptr_t class_offset) const
 
intptr_t SourceReferencesOffset ()
 

Detailed Description

Definition at line 84 of file kernel_loader.h.

Constructor & Destructor Documentation

◆ LibraryIndex()

dart::kernel::LibraryIndex::LibraryIndex ( const TypedDataView kernel_data)
explicit

Definition at line 181 of file kernel_loader.cc.

182 : reader_(kernel_data) {
183 intptr_t data_size = reader_.size();
184
185 procedure_count_ = reader_.ReadUInt32At(data_size - 4);
186 procedure_index_offset_ = data_size - 4 - (procedure_count_ + 1) * 4;
187
188 class_count_ = reader_.ReadUInt32At(procedure_index_offset_ - 4);
189 class_index_offset_ = procedure_index_offset_ - 4 - (class_count_ + 1) * 4;
190
191 source_references_offset_ = -1;
192 source_references_offset_ = reader_.ReadUInt32At(class_index_offset_ - 4);
193}
uint32_t ReadUInt32At(intptr_t offset) const
intptr_t size() const

Member Function Documentation

◆ class_count()

intptr_t dart::kernel::LibraryIndex::class_count ( ) const
inline

Definition at line 88 of file kernel_loader.h.

88{ return class_count_; }

◆ ClassOffset()

intptr_t dart::kernel::LibraryIndex::ClassOffset ( intptr_t  index) const
inline

Definition at line 91 of file kernel_loader.h.

91 {
92 return reader_.ReadUInt32At(class_index_offset_ + index * 4);
93 }

◆ procedure_count()

intptr_t dart::kernel::LibraryIndex::procedure_count ( ) const
inline

Definition at line 89 of file kernel_loader.h.

89{ return procedure_count_; }

◆ ProcedureOffset()

intptr_t dart::kernel::LibraryIndex::ProcedureOffset ( intptr_t  index) const
inline

Definition at line 95 of file kernel_loader.h.

95 {
96 return reader_.ReadUInt32At(procedure_index_offset_ + index * 4);
97 }

◆ SizeOfClassAtOffset()

intptr_t dart::kernel::LibraryIndex::SizeOfClassAtOffset ( intptr_t  class_offset) const
inline

Definition at line 99 of file kernel_loader.h.

99 {
100 for (intptr_t i = 0, offset = class_index_offset_; i < class_count_;
101 ++i, offset += 4) {
102 if (static_cast<intptr_t>(reader_.ReadUInt32At(offset)) == class_offset) {
103 return reader_.ReadUInt32At(offset + 4) - class_offset;
104 }
105 }
106 UNREACHABLE();
107 return -1;
108 }
#define UNREACHABLE()
Definition: assert.h:248
SeparatedVector2 offset

◆ SourceReferencesOffset()

intptr_t dart::kernel::LibraryIndex::SourceReferencesOffset ( )
inline

Definition at line 110 of file kernel_loader.h.

110{ return source_references_offset_; }

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