Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
dart::kernel::Fragment Class Reference

#include <base_flow_graph_builder.h>

Public Member Functions

 Fragment ()
 
 Fragment (Instruction *instruction)
 
 Fragment (Instruction *entry, Instruction *current)
 
bool is_open () const
 
bool is_closed () const
 
bool is_empty () const
 
bool is_valid () const
 
void Prepend (Instruction *start)
 
Fragmentoperator+= (const Fragment &other)
 
Fragmentoperator<<= (Instruction *next)
 
Fragment closed ()
 

Public Attributes

Instructionentry = nullptr
 
Instructioncurrent = nullptr
 

Detailed Description

Definition at line 28 of file base_flow_graph_builder.h.

Constructor & Destructor Documentation

◆ Fragment() [1/3]

dart::kernel::Fragment::Fragment ( )
inline

Definition at line 33 of file base_flow_graph_builder.h.

33{}

◆ Fragment() [2/3]

dart::kernel::Fragment::Fragment ( Instruction instruction)
inlineexplicit

Definition at line 35 of file base_flow_graph_builder.h.

36 : entry(instruction), current(instruction) {}

◆ Fragment() [3/3]

dart::kernel::Fragment::Fragment ( Instruction entry,
Instruction current 
)
inline

Definition at line 38 of file base_flow_graph_builder.h.

41 }
#define ASSERT(E)

Member Function Documentation

◆ closed()

Fragment dart::kernel::Fragment::closed ( )

Definition at line 71 of file base_flow_graph_builder.cc.

71 {
72 ASSERT(entry != nullptr);
73 return Fragment(entry, nullptr);
74}

◆ is_closed()

bool dart::kernel::Fragment::is_closed ( ) const
inline

Definition at line 44 of file base_flow_graph_builder.h.

44{ return !is_open(); }

◆ is_empty()

bool dart::kernel::Fragment::is_empty ( ) const
inline

Definition at line 46 of file base_flow_graph_builder.h.

46{ return entry == nullptr && current == nullptr; }

◆ is_open()

bool dart::kernel::Fragment::is_open ( ) const
inline

Definition at line 43 of file base_flow_graph_builder.h.

43{ return entry == nullptr || current != nullptr; }

◆ is_valid()

bool dart::kernel::Fragment::is_valid ( ) const
inline

Definition at line 49 of file base_flow_graph_builder.h.

49{ return is_empty() || (entry != nullptr); }

◆ operator+=()

Fragment & dart::kernel::Fragment::operator+= ( const Fragment other)

Definition at line 32 of file base_flow_graph_builder.cc.

32 {
34 ASSERT(other.is_valid());
35 if (entry == nullptr) {
36 entry = other.entry;
37 current = other.current;
38 } else if (other.entry != nullptr) {
39 if (current != nullptr) {
40 current->LinkTo(other.entry);
41 }
42 // Although [other.entry] could be unreachable (if this fragment is
43 // closed), there could be a yield continuation point in the middle of
44 // [other] fragment so [other.current] is still reachable.
45 current = other.current;
46 }
47 return *this;
48}
void LinkTo(Instruction *next)
Definition: il.h:1108

◆ operator<<=()

Fragment & dart::kernel::Fragment::operator<<= ( Instruction next)

Definition at line 50 of file base_flow_graph_builder.cc.

50 {
52 if (entry == nullptr) {
53 entry = current = next;
54 } else if (current != nullptr) {
56 current = next;
57 }
58 return *this;
59}
static float next(float f)

◆ Prepend()

void dart::kernel::Fragment::Prepend ( Instruction start)

Definition at line 61 of file base_flow_graph_builder.cc.

61 {
63 if (entry == nullptr) {
65 } else {
66 start->LinkTo(entry);
67 entry = start;
68 }
69}

Member Data Documentation

◆ current

Instruction* dart::kernel::Fragment::current = nullptr

Definition at line 31 of file base_flow_graph_builder.h.

◆ entry

Instruction* dart::kernel::Fragment::entry = nullptr

Definition at line 30 of file base_flow_graph_builder.h.


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