Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::FunctionTypeMapping Class Reference
Inheritance diagram for dart::FunctionTypeMapping:
dart::ValueObject

Public Member Functions

 FunctionTypeMapping (Zone *zone, FunctionTypeMapping **mapping, const FunctionType &from, const FunctionType &to)
 
const FunctionTypeFind (const Object &from) const
 
TypeParameterPtr MapTypeParameter (const TypeParameter &type_param) const
 
bool ContainsOwnersOfTypeParameters (const TypeParameter &p1, const TypeParameter &p2) const
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 6507 of file object.cc.

Constructor & Destructor Documentation

◆ FunctionTypeMapping()

dart::FunctionTypeMapping::FunctionTypeMapping ( Zone zone,
FunctionTypeMapping **  mapping,
const FunctionType from,
const FunctionType to 
)
inline

Definition at line 6509 of file object.cc.

6513 : zone_(zone), parent_(*mapping), from_(from), to_(to) {
6514 // Add self to the linked list.
6515 *mapping = this;
6516 }

Member Function Documentation

◆ ContainsOwnersOfTypeParameters()

bool dart::FunctionTypeMapping::ContainsOwnersOfTypeParameters ( const TypeParameter p1,
const TypeParameter p2 
) const
inline

Definition at line 6542 of file object.cc.

6543 {
6544 auto& from = FunctionType::Handle(zone_, p1.parameterized_function_type());
6545 const FunctionType* to = Find(from);
6546 if (to != nullptr) {
6547 return to->ptr() == p2.parameterized_function_type();
6548 }
6549 from = p2.parameterized_function_type();
6550 to = Find(from);
6551 if (to != nullptr) {
6552 return to->ptr() == p1.parameterized_function_type();
6553 }
6554 return false;
6555 }
const FunctionType * Find(const Object &from) const
Definition: object.cc:6518
static Object & Handle()
Definition: object.h:407

◆ Find()

const FunctionType * dart::FunctionTypeMapping::Find ( const Object from) const
inline

Definition at line 6518 of file object.cc.

6518 {
6519 if (!from.IsFunctionType()) {
6520 return nullptr;
6521 }
6522 for (const FunctionTypeMapping* scope = this; scope != nullptr;
6523 scope = scope->parent_) {
6524 if (scope->from_.ptr() == from.ptr()) {
6525 return &(scope->to_);
6526 }
6527 }
6528 return nullptr;
6529 }
FunctionTypeMapping(Zone *zone, FunctionTypeMapping **mapping, const FunctionType &from, const FunctionType &to)
Definition: object.cc:6509

◆ MapTypeParameter()

TypeParameterPtr dart::FunctionTypeMapping::MapTypeParameter ( const TypeParameter type_param) const
inline

Definition at line 6531 of file object.cc.

6531 {
6532 ASSERT(type_param.IsFunctionTypeParameter());
6533 const FunctionType* new_owner = Find(
6534 FunctionType::Handle(zone_, type_param.parameterized_function_type()));
6535 if (new_owner != nullptr) {
6536 return new_owner->TypeParameterAt(type_param.index() - type_param.base(),
6537 type_param.nullability());
6538 }
6539 return type_param.ptr();
6540 }
#define ASSERT(E)

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