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

#include <il.h>

Inheritance diagram for dart::JoinEntryInstr:
dart::BlockEntryInstr dart::TemplateInstruction< 0, NoThrow > dart::IndirectEntryInstr

Public Member Functions

 JoinEntryInstr (intptr_t block_id, intptr_t try_index, intptr_t deopt_id, intptr_t stack_depth=0)
 
virtual intptr_t PredecessorCount () const
 
virtual BlockEntryInstrPredecessorAt (intptr_t index) const
 
intptr_t IndexOfPredecessor (BlockEntryInstr *pred) const
 
ZoneGrowableArray< PhiInstr * > * phis () const
 
PhiInstrInsertPhi (intptr_t var_index, intptr_t var_count)
 
void RemoveDeadPhis (Definition *replacement)
 
void InsertPhi (PhiInstr *phi)
 
void RemovePhi (PhiInstr *phi)
 
virtual bool HasUnknownSideEffects () const
 
virtual void ClearPredecessors ()
 
virtual void AddPredecessor (BlockEntryInstr *predecessor)
 
 DISALLOW_COPY_AND_ASSIGN (JoinEntryInstr)
 
- Public Member Functions inherited from dart::BlockEntryInstr
intptr_t preorder_number () const
 
void set_preorder_number (intptr_t number)
 
intptr_t postorder_number () const
 
void set_postorder_number (intptr_t number)
 
intptr_t block_id () const
 
void set_start_pos (intptr_t pos)
 
intptr_t start_pos () const
 
void set_end_pos (intptr_t pos)
 
intptr_t end_pos () const
 
BlockEntryInstrdominator () const
 
BlockEntryInstrImmediateDominator () const
 
const GrowableArray< BlockEntryInstr * > & dominated_blocks ()
 
void AddDominatedBlock (BlockEntryInstr *block)
 
void ClearDominatedBlocks ()
 
bool Dominates (BlockEntryInstr *other) const
 
Instructionlast_instruction () const
 
void set_last_instruction (Instruction *instr)
 
ParallelMoveInstrparallel_move () const
 
bool HasParallelMove () const
 
bool HasNonRedundantParallelMove () const
 
ParallelMoveInstrGetParallelMove ()
 
bool DiscoverBlock (BlockEntryInstr *predecessor, GrowableArray< BlockEntryInstr * > *preorder, GrowableArray< intptr_t > *parent)
 
virtual bool CanBecomeDeoptimizationTarget () const
 
virtual bool ComputeCanDeoptimize () const
 
intptr_t try_index () const
 
void set_try_index (intptr_t index)
 
bool InsideTryBlock () const
 
LoopInfoloop_info () const
 
void set_loop_info (LoopInfo *loop_info)
 
bool IsLoopHeader () const
 
intptr_t NestingDepth () const
 
virtual BlockEntryInstrGetBlock ()
 
virtual TokenPosition token_pos () const
 
void ReplaceAsPredecessorWith (BlockEntryInstr *new_block)
 
void set_block_id (intptr_t block_id)
 
intptr_t stack_depth () const
 
void set_stack_depth (intptr_t s)
 
void ClearAllInstructions ()
 
InstructionsIterable instructions ()
 
- Public Member Functions inherited from dart::TemplateInstruction< 0, NoThrow >
 TemplateInstruction (intptr_t deopt_id=DeoptId::kNone)
 
 TemplateInstruction (const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
virtual intptr_t InputCount () const
 
virtual ValueInputAt (intptr_t i) const
 
virtual bool MayThrow () const
 

Public Attributes

GrowableArray< BlockEntryInstr * > predecessors_
 

Friends

class(JoinEntryInstr, BlockEntryInstr, FIELD_LIST) DECLARE_EXTRA_SERIALIZATION private InlineExitCollector
 
class PolymorphicInliner
 
class IndirectEntryInstr
 
class ConstantPropagator
 
class DeadCodeElimination
 

Additional Inherited Members

- Public Types inherited from dart::TemplateInstruction< 0, NoThrow >
using BaseClass = typename NoCSE< Instruction, PureInstruction >::Base
 
- Protected Member Functions inherited from dart::BlockEntryInstr
 BlockEntryInstr (intptr_t block_id, intptr_t try_index, intptr_t deopt_id, intptr_t stack_depth)
 
bool FindOsrEntryAndRelink (GraphEntryInstr *graph_entry, Instruction *parent, BitVector *block_marks)
 
- Protected Attributes inherited from dart::TemplateInstruction< 0, NoThrow >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 2037 of file il.h.

Constructor & Destructor Documentation

◆ JoinEntryInstr()

dart::JoinEntryInstr::JoinEntryInstr ( intptr_t  block_id,
intptr_t  try_index,
intptr_t  deopt_id,
intptr_t  stack_depth = 0 
)
inline

Definition at line 2039 of file il.h.

2044 phis_(nullptr),
2045 predecessors_(2) // Two is the assumed to be the common case.
2046 {}
intptr_t try_index() const
Definition il.h:1724
intptr_t block_id() const
Definition il.h:1655
BlockEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t deopt_id, intptr_t stack_depth)
Definition il.h:1776
intptr_t stack_depth() const
Definition il.h:1750
GrowableArray< BlockEntryInstr * > predecessors_
Definition il.h:2092

Member Function Documentation

◆ AddPredecessor()

void dart::JoinEntryInstr::AddPredecessor ( BlockEntryInstr predecessor)
virtual

Implements dart::BlockEntryInstr.

Definition at line 1413 of file il.cc.

1413 {
1414 // Require the predecessors to be sorted by block_id to make managing
1415 // their corresponding phi inputs simpler.
1416 intptr_t pred_id = predecessor->block_id();
1417 intptr_t index = 0;
1418 while ((index < predecessors_.length()) &&
1419 (predecessors_[index]->block_id() < pred_id)) {
1420 ++index;
1421 }
1422#if defined(DEBUG)
1423 for (intptr_t i = index; i < predecessors_.length(); ++i) {
1424 ASSERT(predecessors_[i]->block_id() != pred_id);
1425 }
1426#endif
1427 predecessors_.InsertAt(index, predecessor);
1428}
#define ASSERT(E)

◆ ClearPredecessors()

virtual void dart::JoinEntryInstr::ClearPredecessors ( )
inlinevirtual

Implements dart::BlockEntryInstr.

Definition at line 2089 of file il.h.

2089{ predecessors_.Clear(); }

◆ DISALLOW_COPY_AND_ASSIGN()

dart::JoinEntryInstr::DISALLOW_COPY_AND_ASSIGN ( JoinEntryInstr  )

◆ HasUnknownSideEffects()

virtual bool dart::JoinEntryInstr::HasUnknownSideEffects ( ) const
inlinevirtual

Reimplemented from dart::BlockEntryInstr.

Definition at line 2066 of file il.h.

2066{ return false; }

◆ IndexOfPredecessor()

intptr_t dart::JoinEntryInstr::IndexOfPredecessor ( BlockEntryInstr pred) const

Definition at line 1430 of file il.cc.

1430 {
1431 for (intptr_t i = 0; i < predecessors_.length(); ++i) {
1432 if (predecessors_[i] == pred) return i;
1433 }
1434 return -1;
1435}

◆ InsertPhi() [1/2]

PhiInstr * dart::JoinEntryInstr::InsertPhi ( intptr_t  var_index,
intptr_t  var_count 
)

Definition at line 1909 of file il.cc.

1909 {
1910 // Lazily initialize the array of phis.
1911 // Currently, phis are stored in a sparse array that holds the phi
1912 // for variable with index i at position i.
1913 // TODO(fschneider): Store phis in a more compact way.
1914 if (phis_ == nullptr) {
1915 phis_ = new ZoneGrowableArray<PhiInstr*>(var_count);
1916 for (intptr_t i = 0; i < var_count; i++) {
1917 phis_->Add(nullptr);
1918 }
1919 }
1920 ASSERT((*phis_)[var_index] == nullptr);
1921 return (*phis_)[var_index] = new PhiInstr(this, PredecessorCount());
1922}
virtual intptr_t PredecessorCount() const
Definition il.h:2050

◆ InsertPhi() [2/2]

void dart::JoinEntryInstr::InsertPhi ( PhiInstr phi)

Definition at line 1924 of file il.cc.

1924 {
1925 // Lazily initialize the array of phis.
1926 if (phis_ == nullptr) {
1927 phis_ = new ZoneGrowableArray<PhiInstr*>(1);
1928 }
1929 phis_->Add(phi);
1930}

◆ phis()

ZoneGrowableArray< PhiInstr * > * dart::JoinEntryInstr::phis ( ) const
inline

Definition at line 2058 of file il.h.

2058{ return phis_; }

◆ PredecessorAt()

virtual BlockEntryInstr * dart::JoinEntryInstr::PredecessorAt ( intptr_t  index) const
inlinevirtual

Implements dart::BlockEntryInstr.

Definition at line 2051 of file il.h.

2051 {
2052 return predecessors_[index];
2053 }

◆ PredecessorCount()

virtual intptr_t dart::JoinEntryInstr::PredecessorCount ( ) const
inlinevirtual

Implements dart::BlockEntryInstr.

Definition at line 2050 of file il.h.

2050{ return predecessors_.length(); }

◆ RemoveDeadPhis()

void dart::JoinEntryInstr::RemoveDeadPhis ( Definition replacement)

Definition at line 1943 of file il.cc.

1943 {
1944 if (phis_ == nullptr) return;
1945
1946 intptr_t to_index = 0;
1947 for (intptr_t from_index = 0; from_index < phis_->length(); ++from_index) {
1948 PhiInstr* phi = (*phis_)[from_index];
1949 if (phi != nullptr) {
1950 if (phi->is_alive()) {
1951 (*phis_)[to_index++] = phi;
1952 for (intptr_t i = phi->InputCount() - 1; i >= 0; --i) {
1953 Value* input = phi->InputAt(i);
1954 input->definition()->AddInputUse(input);
1955 }
1956 } else {
1957 phi->ReplaceUsesWith(replacement);
1958 }
1959 }
1960 }
1961 if (to_index == 0) {
1962 phis_ = nullptr;
1963 } else {
1964 phis_->TruncateTo(to_index);
1965 }
1966}

◆ RemovePhi()

void dart::JoinEntryInstr::RemovePhi ( PhiInstr phi)

Definition at line 1932 of file il.cc.

1932 {
1933 ASSERT(phis_ != nullptr);
1934 for (intptr_t index = 0; index < phis_->length(); ++index) {
1935 if (phi == (*phis_)[index]) {
1936 (*phis_)[index] = phis_->Last();
1937 phis_->RemoveLast();
1938 return;
1939 }
1940 }
1941}

Friends And Related Symbol Documentation

◆ ConstantPropagator

friend class ConstantPropagator
friend

Definition at line 2086 of file il.h.

◆ DeadCodeElimination

friend class DeadCodeElimination
friend

Definition at line 2087 of file il.h.

◆ IndirectEntryInstr

friend class IndirectEntryInstr
friend

Definition at line 2083 of file il.h.

◆ InlineExitCollector

Definition at line 2081 of file il.h.

◆ PolymorphicInliner

friend class PolymorphicInliner
friend

Definition at line 2082 of file il.h.

Member Data Documentation

◆ predecessors_

GrowableArray<BlockEntryInstr*> dart::JoinEntryInstr::predecessors_

Definition at line 2092 of file il.h.


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