Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 6562 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 6564 of file object.cc.

6568 : zone_(zone), parent_(*mapping), from_(from), to_(to) {
6569 // Add self to the linked list.
6570 *mapping = this;
6571 }

Member Function Documentation

◆ ContainsOwnersOfTypeParameters()

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

Definition at line 6597 of file object.cc.

6598 {
6599 auto& from = FunctionType::Handle(zone_, p1.parameterized_function_type());
6600 const FunctionType* to = Find(from);
6601 if (to != nullptr) {
6602 return to->ptr() == p2.parameterized_function_type();
6603 }
6604 from = p2.parameterized_function_type();
6605 to = Find(from);
6606 if (to != nullptr) {
6607 return to->ptr() == p1.parameterized_function_type();
6608 }
6609 return false;
6610 }
const FunctionType * Find(const Object &from) const
Definition object.cc:6573
static Object & Handle()
Definition object.h:407

◆ Find()

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

Definition at line 6573 of file object.cc.

6573 {
6574 if (!from.IsFunctionType()) {
6575 return nullptr;
6576 }
6577 for (const FunctionTypeMapping* scope = this; scope != nullptr;
6578 scope = scope->parent_) {
6579 if (scope->from_.ptr() == from.ptr()) {
6580 return &(scope->to_);
6581 }
6582 }
6583 return nullptr;
6584 }

◆ MapTypeParameter()

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

Definition at line 6586 of file object.cc.

6586 {
6587 ASSERT(type_param.IsFunctionTypeParameter());
6588 const FunctionType* new_owner = Find(
6589 FunctionType::Handle(zone_, type_param.parameterized_function_type()));
6590 if (new_owner != nullptr) {
6591 return new_owner->TypeParameterAt(type_param.index() - type_param.base(),
6592 type_param.nullability());
6593 }
6594 return type_param.ptr();
6595 }
#define ASSERT(E)

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