Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 162 of file kernel_loader.cc.

163 : reader_(kernel_data) {
164 intptr_t data_size = reader_.size();
165
166 procedure_count_ = reader_.ReadUInt32At(data_size - 4);
167 procedure_index_offset_ = data_size - 4 - (procedure_count_ + 1) * 4;
168
169 class_count_ = reader_.ReadUInt32At(procedure_index_offset_ - 4);
170 class_index_offset_ = procedure_index_offset_ - 4 - (class_count_ + 1) * 4;
171
172 source_references_offset_ = -1;
173 source_references_offset_ = reader_.ReadUInt32At(class_index_offset_ - 4);
174}
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
Point 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: