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

Public Member Functions

 InterfaceFinder (Zone *zone, ClassTable *class_table, GrowableArray< intptr_t > *cids)
 
void FindAllInterfaces (const Class &klass)
 

Detailed Description

Definition at line 110 of file class_finalizer.cc.

Constructor & Destructor Documentation

◆ InterfaceFinder()

dart::InterfaceFinder::InterfaceFinder ( Zone zone,
ClassTable class_table,
GrowableArray< intptr_t > *  cids 
)
inline

Definition at line 112 of file class_finalizer.cc.

115 : class_table_(class_table),
116 array_handles_(zone),
117 class_handles_(zone),
118 type_handles_(zone),
119 cids_(cids) {}

Member Function Documentation

◆ FindAllInterfaces()

void dart::InterfaceFinder::FindAllInterfaces ( const Class klass)
inline

Definition at line 121 of file class_finalizer.cc.

121 {
122 // The class is implementing its own interface.
123 cids_->Add(klass.id());
124
125 ScopedHandle<Array> array(&array_handles_);
126 ScopedHandle<Class> interface_class(&class_handles_);
127 ScopedHandle<Class> current_class(&class_handles_);
128 ScopedHandle<AbstractType> type(&type_handles_);
129
130 *current_class = klass.ptr();
131 while (true) {
132 // We don't care about top types.
133 const intptr_t cid = current_class->id();
134 if (cid == kObjectCid || cid == kDynamicCid || cid == kVoidCid) {
135 break;
136 }
137
138 // The class is implementing its directly declared implemented interfaces.
139 *array = klass.interfaces();
140 if (!array->IsNull()) {
141 for (intptr_t i = 0; i < array->Length(); ++i) {
142 *type ^= array->At(i);
143 *interface_class = class_table_->At(type->type_class_id());
144 FindAllInterfaces(*interface_class);
145 }
146 }
147
148 // The class is implementing its super type's interfaces.
149 *type = current_class->super_type();
150 if (type->IsNull()) break;
151 *current_class = class_table_->At(type->type_class_id());
152 }
153 }
GLenum type
void Add(const T &value)
ClassPtr At(intptr_t cid) const
Definition: class_table.h:362
void FindAllInterfaces(const Class &klass)
@ kVoidCid
Definition: class_id.h:254
@ kDynamicCid
Definition: class_id.h:253
const intptr_t cid

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