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

Public Member Functions

 BackgroundCompilationQueue ()
 
virtual ~BackgroundCompilationQueue ()
 
void VisitObjectPointers (ObjectPointerVisitor *visitor)
 
bool IsEmpty () const
 
void Add (QueueElement *value)
 
QueueElementPeek () const
 
FunctionPtr PeekFunction () const
 
QueueElementRemove ()
 
bool ContainsObj (const Object &obj) const
 
void Clear ()
 

Detailed Description

Definition at line 1021 of file compiler.cc.

Constructor & Destructor Documentation

◆ BackgroundCompilationQueue()

dart::BackgroundCompilationQueue::BackgroundCompilationQueue ( )
inline

Definition at line 1023 of file compiler.cc.

1023: first_(nullptr), last_(nullptr) {}

◆ ~BackgroundCompilationQueue()

virtual dart::BackgroundCompilationQueue::~BackgroundCompilationQueue ( )
inlinevirtual

Definition at line 1024 of file compiler.cc.

Member Function Documentation

◆ Add()

void dart::BackgroundCompilationQueue::Add ( QueueElement value)
inline

Definition at line 1037 of file compiler.cc.

1037 {
1038 ASSERT(value != nullptr);
1039 ASSERT(value->next() == nullptr);
1040 if (first_ == nullptr) {
1041 first_ = value;
1042 ASSERT(last_ == nullptr);
1043 } else {
1044 ASSERT(last_ != nullptr);
1045 last_->set_next(value);
1046 }
1047 last_ = value;
1048 ASSERT(first_ != nullptr && last_ != nullptr);
1049 }
void set_next(QueueElement *elem)
Definition: compiler.cc:1004
#define ASSERT(E)
uint8_t value

◆ Clear()

void dart::BackgroundCompilationQueue::Clear ( )
inline

Definition at line 1083 of file compiler.cc.

1083 {
1084 while (!IsEmpty()) {
1085 QueueElement* e = Remove();
1086 delete e;
1087 }
1088 ASSERT((first_ == nullptr) && (last_ == nullptr));
1089 }

◆ ContainsObj()

bool dart::BackgroundCompilationQueue::ContainsObj ( const Object obj) const
inline

Definition at line 1072 of file compiler.cc.

1072 {
1073 QueueElement* p = first_;
1074 while (p != nullptr) {
1075 if (p->function() == obj.ptr()) {
1076 return true;
1077 }
1078 p = p->next();
1079 }
1080 return false;
1081 }

◆ IsEmpty()

bool dart::BackgroundCompilationQueue::IsEmpty ( ) const
inline

Definition at line 1035 of file compiler.cc.

1035{ return first_ == nullptr; }

◆ Peek()

QueueElement * dart::BackgroundCompilationQueue::Peek ( ) const
inline

Definition at line 1051 of file compiler.cc.

1051{ return first_; }

◆ PeekFunction()

FunctionPtr dart::BackgroundCompilationQueue::PeekFunction ( ) const
inline

Definition at line 1053 of file compiler.cc.

1053 {
1054 QueueElement* e = Peek();
1055 if (e == nullptr) {
1056 return Function::null();
1057 } else {
1058 return e->Function();
1059 }
1060 }
QueueElement * Peek() const
Definition: compiler.cc:1051
static ObjectPtr null()
Definition: object.h:433

◆ Remove()

QueueElement * dart::BackgroundCompilationQueue::Remove ( )
inline

Definition at line 1062 of file compiler.cc.

1062 {
1063 ASSERT(first_ != nullptr);
1064 QueueElement* result = first_;
1065 first_ = first_->next();
1066 if (first_ == nullptr) {
1067 last_ = nullptr;
1068 }
1069 return result;
1070 }
QueueElement * next() const
Definition: compiler.cc:1005
GAsyncResult * result

◆ VisitObjectPointers()

void dart::BackgroundCompilationQueue::VisitObjectPointers ( ObjectPointerVisitor visitor)
inline

Definition at line 1026 of file compiler.cc.

1026 {
1027 ASSERT(visitor != nullptr);
1028 QueueElement* p = first_;
1029 while (p != nullptr) {
1030 visitor->VisitPointer(p->function_untag());
1031 p = p->next();
1032 }
1033 }

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