Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
dart::BinaryFeedback Class Reference

#include <il.h>

Inheritance diagram for dart::BinaryFeedback:
dart::ZoneAllocated

Public Member Functions

 BinaryFeedback (Zone *zone)
 
bool ArgumentIs (intptr_t cid) const
 
bool OperandsAreEither (intptr_t cid_a, intptr_t cid_b) const
 
bool OperandsAreSmiOrNull () const
 
bool OperandsAreSmiOrMint () const
 
bool OperandsAreSmiOrDouble () const
 
bool OperandsAre (intptr_t cid) const
 
bool IncludesOperands (intptr_t cid) const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Static Public Member Functions

static const BinaryFeedbackCreate (Zone *zone, const ICData &ic_data)
 
static const BinaryFeedbackCreateMonomorphic (Zone *zone, intptr_t receiver_cid, intptr_t argument_cid)
 

Friends

class Cids
 

Detailed Description

Definition at line 830 of file il.h.

Constructor & Destructor Documentation

◆ BinaryFeedback()

dart::BinaryFeedback::BinaryFeedback ( Zone zone)
inlineexplicit

Definition at line 832 of file il.h.

832: feedback_(zone, 2) {}

Member Function Documentation

◆ ArgumentIs()

bool dart::BinaryFeedback::ArgumentIs ( intptr_t  cid) const
inline

Definition at line 839 of file il.h.

839 {
840 if (feedback_.is_empty()) {
841 return false;
842 }
843 for (intptr_t i = 0, n = feedback_.length(); i < n; i++) {
844 if (feedback_[i].second != cid) {
845 return false;
846 }
847 }
848 return true;
849 }
intptr_t length() const
const intptr_t cid

◆ Create()

const BinaryFeedback * dart::BinaryFeedback::Create ( Zone zone,
const ICData ic_data 
)
static

Definition at line 4097 of file il.cc.

4098 {
4099 BinaryFeedback* result = new (zone) BinaryFeedback(zone);
4100 if (ic_data.NumArgsTested() == 2) {
4101 for (intptr_t i = 0, n = ic_data.NumberOfChecks(); i < n; i++) {
4102 if (ic_data.GetCountAt(i) == 0) {
4103 continue;
4104 }
4105 GrowableArray<intptr_t> arg_ids;
4106 ic_data.GetClassIdsAt(i, &arg_ids);
4107 result->feedback_.Add({arg_ids[0], arg_ids[1]});
4108 }
4109 }
4110 return result;
4111}
BinaryFeedback(Zone *zone)
Definition il.h:832
GAsyncResult * result

◆ CreateMonomorphic()

const BinaryFeedback * dart::BinaryFeedback::CreateMonomorphic ( Zone zone,
intptr_t  receiver_cid,
intptr_t  argument_cid 
)
static

Definition at line 4113 of file il.cc.

4115 {
4116 BinaryFeedback* result = new (zone) BinaryFeedback(zone);
4117 result->feedback_.Add({receiver_cid, argument_cid});
4118 return result;
4119}

◆ IncludesOperands()

bool dart::BinaryFeedback::IncludesOperands ( intptr_t  cid) const
inline

Definition at line 880 of file il.h.

880 {
881 for (intptr_t i = 0, n = feedback_.length(); i < n; i++) {
882 if ((feedback_[i].first == cid) && (feedback_[i].second == cid)) {
883 return true;
884 }
885 }
886 return false;
887 }

◆ OperandsAre()

bool dart::BinaryFeedback::OperandsAre ( intptr_t  cid) const
inline

Definition at line 875 of file il.h.

875 {
876 if (feedback_.length() != 1) return false;
877 return (feedback_[0].first == cid) && (feedback_[0].second == cid);
878 }

◆ OperandsAreEither()

bool dart::BinaryFeedback::OperandsAreEither ( intptr_t  cid_a,
intptr_t  cid_b 
) const
inline

Definition at line 851 of file il.h.

851 {
852 if (feedback_.is_empty()) {
853 return false;
854 }
855 for (intptr_t i = 0, n = feedback_.length(); i < n; i++) {
856 if ((feedback_[i].first != cid_a) && (feedback_[i].first != cid_b)) {
857 return false;
858 }
859 if ((feedback_[i].second != cid_a) && (feedback_[i].second != cid_b)) {
860 return false;
861 }
862 }
863 return true;
864 }

◆ OperandsAreSmiOrDouble()

bool dart::BinaryFeedback::OperandsAreSmiOrDouble ( ) const
inline

Definition at line 871 of file il.h.

871 {
872 return OperandsAreEither(kSmiCid, kDoubleCid);
873 }
bool OperandsAreEither(intptr_t cid_a, intptr_t cid_b) const
Definition il.h:851

◆ OperandsAreSmiOrMint()

bool dart::BinaryFeedback::OperandsAreSmiOrMint ( ) const
inline

Definition at line 868 of file il.h.

868 {
869 return OperandsAreEither(kSmiCid, kMintCid);
870 }

◆ OperandsAreSmiOrNull()

bool dart::BinaryFeedback::OperandsAreSmiOrNull ( ) const
inline

Definition at line 865 of file il.h.

865 {
866 return OperandsAreEither(kSmiCid, kNullCid);
867 }
@ kNullCid
Definition class_id.h:252

Friends And Related Symbol Documentation

◆ Cids

friend class Cids
friend

Definition at line 892 of file il.h.


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