Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 836 of file il.h.

Constructor & Destructor Documentation

◆ BinaryFeedback()

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

Definition at line 838 of file il.h.

838: feedback_(zone, 2) {}

Member Function Documentation

◆ ArgumentIs()

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

Definition at line 845 of file il.h.

845 {
846 if (feedback_.is_empty()) {
847 return false;
848 }
849 for (intptr_t i = 0, n = feedback_.length(); i < n; i++) {
850 if (feedback_[i].second != cid) {
851 return false;
852 }
853 }
854 return true;
855 }
intptr_t length() const
const intptr_t cid

◆ Create()

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

Definition at line 4094 of file il.cc.

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

◆ CreateMonomorphic()

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

Definition at line 4110 of file il.cc.

4112 {
4113 BinaryFeedback* result = new (zone) BinaryFeedback(zone);
4114 result->feedback_.Add({receiver_cid, argument_cid});
4115 return result;
4116}

◆ IncludesOperands()

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

Definition at line 886 of file il.h.

886 {
887 for (intptr_t i = 0, n = feedback_.length(); i < n; i++) {
888 if ((feedback_[i].first == cid) && (feedback_[i].second == cid)) {
889 return true;
890 }
891 }
892 return false;
893 }

◆ OperandsAre()

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

Definition at line 881 of file il.h.

881 {
882 if (feedback_.length() != 1) return false;
883 return (feedback_[0].first == cid) && (feedback_[0].second == cid);
884 }

◆ OperandsAreEither()

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

Definition at line 857 of file il.h.

857 {
858 if (feedback_.is_empty()) {
859 return false;
860 }
861 for (intptr_t i = 0, n = feedback_.length(); i < n; i++) {
862 if ((feedback_[i].first != cid_a) && (feedback_[i].first != cid_b)) {
863 return false;
864 }
865 if ((feedback_[i].second != cid_a) && (feedback_[i].second != cid_b)) {
866 return false;
867 }
868 }
869 return true;
870 }

◆ OperandsAreSmiOrDouble()

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

Definition at line 877 of file il.h.

877 {
878 return OperandsAreEither(kSmiCid, kDoubleCid);
879 }
bool OperandsAreEither(intptr_t cid_a, intptr_t cid_b) const
Definition: il.h:857

◆ OperandsAreSmiOrMint()

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

Definition at line 874 of file il.h.

874 {
875 return OperandsAreEither(kSmiCid, kMintCid);
876 }

◆ OperandsAreSmiOrNull()

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

Definition at line 871 of file il.h.

871 {
872 return OperandsAreEither(kSmiCid, kNullCid);
873 }
@ kNullCid
Definition: class_id.h:252

Friends And Related Function Documentation

◆ Cids

friend class Cids
friend

Definition at line 898 of file il.h.


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