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

#include <method_recognizer.h>

Inheritance diagram for dart::FactoryRecognizer:
dart::AllStatic

Static Public Member Functions

static intptr_t ResultCid (const Function &factory)
 
static intptr_t GetResultCidOfListFactory (Zone *zone, const Function &function, intptr_t argument_count)
 

Detailed Description

Definition at line 64 of file method_recognizer.h.

Member Function Documentation

◆ GetResultCidOfListFactory()

intptr_t dart::FactoryRecognizer::GetResultCidOfListFactory ( Zone zone,
const Function function,
intptr_t  argument_count 
)
static

Definition at line 333 of file method_recognizer.cc.

335 {
336 if (!function.IsFactory()) {
337 return kDynamicCid;
338 }
339
340 const Class& owner = Class::Handle(zone, function.Owner());
341 if ((owner.library() != Library::CoreLibrary()) &&
342 (owner.library() != Library::TypedDataLibrary())) {
343 return kDynamicCid;
344 }
345
346 if (owner.Name() == Symbols::List().ptr()) {
347 if (function.name() == Symbols::ListFactory().ptr()) {
349 return (argument_count == 1) ? kGrowableObjectArrayCid : kArrayCid;
350 } else if (function.name() == Symbols::ListFilledFactory().ptr()) {
352 return (argument_count == 3) ? kArrayCid : kDynamicCid;
353 }
354 }
355
356 return ResultCid(function);
357}
SkIDChangeListener::List List
static intptr_t ResultCid(const Function &factory)
static LibraryPtr CoreLibrary()
Definition: object.cc:14787
static LibraryPtr TypedDataLibrary()
Definition: object.cc:14825
static Object & Handle()
Definition: object.h:407
#define ASSERT(E)
Dart_NativeFunction function
Definition: fuchsia.cc:51
int argument_count
Definition: fuchsia.cc:52
@ kDynamicCid
Definition: class_id.h:253

◆ ResultCid()

intptr_t dart::FactoryRecognizer::ResultCid ( const Function factory)
static

Definition at line 315 of file method_recognizer.cc.

315 {
316 ASSERT(factory.IsFactory());
317 const Class& function_class = Class::Handle(factory.Owner());
318 const Library& lib = Library::Handle(function_class.library());
319 ASSERT((lib.ptr() == Library::CoreLibrary()) ||
320 (lib.ptr() == Library::TypedDataLibrary()));
321 const String& factory_name = String::Handle(factory.name());
322 for (intptr_t i = 0;
323 factory_recognizer_list[i].symbol_id != Symbols::kIllegal; i++) {
325 factory_name,
327 return factory_recognizer_list[i].cid;
328 }
329 }
330 return kDynamicCid;
331}
static bool EqualsIgnoringPrivateKey(const String &str1, const String &str2)
Definition: object.cc:24299
static const String & Symbol(intptr_t index)
Definition: symbols.h:607
const intptr_t symbol_id
static const struct dart::@133 factory_recognizer_list[]

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