Flutter Engine
The Flutter Engine
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::Instruction dart::ZoneAllocated 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
virtual intptr_t PredecessorCount () const =0
 
virtual BlockEntryInstrPredecessorAt (intptr_t index) const =0
 
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
 
virtual bool HasUnknownSideEffects () 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 Member Functions inherited from dart::Instruction
 Instruction (const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
 Instruction (intptr_t deopt_id=DeoptId::kNone)
 
virtual ~Instruction ()
 
virtual Tag tag () const =0
 
virtual intptr_t statistics_tag () const
 
intptr_t deopt_id () const
 
virtual TokenPosition token_pos () const
 
InstructionSource source () const
 
virtual intptr_t InputCount () const =0
 
virtual ValueInputAt (intptr_t i) const =0
 
void SetInputAt (intptr_t i, Value *value)
 
InputsIterable inputs ()
 
void UnuseAllInputs ()
 
virtual intptr_t ArgumentCount () const
 
ValueArgumentValueAt (intptr_t index) const
 
DefinitionArgumentAt (intptr_t index) const
 
virtual void SetMoveArguments (MoveArgumentsArray *move_arguments)
 
virtual MoveArgumentsArrayGetMoveArguments () const
 
virtual void ReplaceInputsWithMoveArguments (MoveArgumentsArray *move_arguments)
 
bool HasMoveArguments () const
 
void RepairArgumentUsesInEnvironment () const
 
virtual bool ComputeCanDeoptimize () const =0
 
virtual bool ComputeCanDeoptimizeAfterCall () const
 
bool CanDeoptimize () const
 
virtual void Accept (InstructionVisitor *visitor)=0
 
Instructionprevious () const
 
void set_previous (Instruction *instr)
 
Instructionnext () const
 
void set_next (Instruction *instr)
 
void LinkTo (Instruction *next)
 
InstructionRemoveFromGraph (bool return_previous=true)
 
virtual intptr_t SuccessorCount () const
 
virtual BlockEntryInstrSuccessorAt (intptr_t index) const
 
SuccessorsIterable successors () const
 
void Goto (JoinEntryInstr *entry)
 
virtual const char * DebugName () const =0
 
void CheckField (const Field &field) const
 
const char * ToCString () const
 
 DECLARE_INSTRUCTION_TYPE_CHECK (BlockEntryWithInitialDefs, BlockEntryWithInitialDefs) template< typename T > T *Cast()
 
template<typename T >
const TCast () const
 
LocationSummarylocs ()
 
bool HasLocs () const
 
virtual LocationSummaryMakeLocationSummary (Zone *zone, bool is_optimizing) const =0
 
void InitializeLocationSummary (Zone *zone, bool optimizing)
 
virtual void EmitNativeCode (FlowGraphCompiler *compiler)
 
Environmentenv () const
 
void SetEnvironment (Environment *deopt_env)
 
void RemoveEnvironment ()
 
void ReplaceInEnvironment (Definition *current, Definition *replacement)
 
virtual intptr_t NumberOfInputsConsumedBeforeCall () const
 
intptr_t GetPassSpecificId (CompilerPass::Id pass) const
 
void SetPassSpecificId (CompilerPass::Id pass, intptr_t id)
 
bool HasPassSpecificId (CompilerPass::Id pass) const
 
bool HasUnmatchedInputRepresentations () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
SpeculativeMode SpeculativeModeOfInputs () const
 
virtual SpeculativeMode SpeculativeModeOfInput (intptr_t index) const
 
virtual Representation representation () const
 
bool WasEliminated () const
 
virtual intptr_t DeoptimizationTarget () const
 
virtual InstructionCanonicalize (FlowGraph *flow_graph)
 
void InsertBefore (Instruction *next)
 
void InsertAfter (Instruction *prev)
 
InstructionAppendInstruction (Instruction *tail)
 
virtual bool AllowsCSE () const
 
virtual bool HasUnknownSideEffects () const =0
 
virtual bool CanCallDart () const
 
virtual bool CanTriggerGC () const
 
virtual BlockEntryInstrGetBlock ()
 
virtual intptr_t inlining_id () const
 
virtual void set_inlining_id (intptr_t value)
 
virtual bool has_inlining_id () const
 
virtual uword Hash () const
 
bool Equals (const Instruction &other) const
 
virtual bool AttributesEqual (const Instruction &other) const
 
void InheritDeoptTarget (Zone *zone, Instruction *other)
 
bool NeedsEnvironment () const
 
virtual bool CanBecomeDeoptimizationTarget () const
 
void InheritDeoptTargetAfter (FlowGraph *flow_graph, Definition *call, Definition *result)
 
virtual bool MayThrow () const =0
 
virtual bool MayHaveVisibleEffect () const
 
virtual bool CanEliminate (const BlockEntryInstr *block) const
 
bool CanEliminate ()
 
bool IsDominatedBy (Instruction *dom)
 
void ClearEnv ()
 
void Unsupported (FlowGraphCompiler *compiler)
 
virtual bool UseSharedSlowPathStub (bool is_optimizing) const
 
Location::Kind RegisterKindForResult () 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)
 

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
 
- Public Types inherited from dart::Instruction
enum  Tag { FOR_EACH_INSTRUCTION =(DECLARE_TAG) kNumInstructions }
 
enum  SpeculativeMode { kGuardInputs , kNotSpeculative }
 
using InputsIterable = InstructionIndexedPropertyIterable< InputsTrait >
 
using SuccessorsIterable = InstructionIndexedPropertyIterable< SuccessorsTrait >
 
- Static Public Member Functions inherited from dart::Instruction
static const ICDataGetICData (const ZoneGrowableArray< const ICData * > &ic_data_array, intptr_t deopt_id, bool is_static_call)
 
static LocationSummaryMakeCallSummary (Zone *zone, const Instruction *instr, LocationSummary *locs=nullptr)
 
static bool SlowPathSharingSupported (bool is_optimizing)
 
- Static Public Attributes inherited from dart::Instruction
static const intptr_t kInstructionAttrs [kNumInstructions]
 
- 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 Member Functions inherited from dart::Instruction
intptr_t GetDeoptId () const
 
virtual void CopyDeoptIdFrom (const Instruction &instr)
 
void WriteExtraWithoutInputs (FlowGraphSerializer *s)
 
void ReadExtraWithoutInputs (FlowGraphDeserializer *d)
 
- Protected Attributes inherited from dart::TemplateInstruction< 0, NoThrow >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 2052 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 2054 of file il.h.

2059 phis_(nullptr),
2060 predecessors_(2) // Two is the assumed to be the common case.
2061 {}
intptr_t try_index() const
Definition: il.h:1730
intptr_t block_id() const
Definition: il.h:1661
intptr_t stack_depth() const
Definition: il.h:1756
friend class BlockEntryInstr
Definition: il.h:1403
intptr_t deopt_id() const
Definition: il.h:993
GrowableArray< BlockEntryInstr * > predecessors_
Definition: il.h:2107

Member Function Documentation

◆ AddPredecessor()

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

Implements dart::BlockEntryInstr.

Definition at line 1422 of file il.cc.

1422 {
1423 // Require the predecessors to be sorted by block_id to make managing
1424 // their corresponding phi inputs simpler.
1425 intptr_t pred_id = predecessor->block_id();
1426 intptr_t index = 0;
1427 while ((index < predecessors_.length()) &&
1428 (predecessors_[index]->block_id() < pred_id)) {
1429 ++index;
1430 }
1431#if defined(DEBUG)
1432 for (intptr_t i = index; i < predecessors_.length(); ++i) {
1433 ASSERT(predecessors_[i]->block_id() != pred_id);
1434 }
1435#endif
1436 predecessors_.InsertAt(index, predecessor);
1437}
#define ASSERT(E)

◆ ClearPredecessors()

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

Implements dart::BlockEntryInstr.

Definition at line 2104 of file il.h.

2104{ 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 2081 of file il.h.

2081{ return false; }

◆ IndexOfPredecessor()

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

Definition at line 1439 of file il.cc.

1439 {
1440 for (intptr_t i = 0; i < predecessors_.length(); ++i) {
1441 if (predecessors_[i] == pred) return i;
1442 }
1443 return -1;
1444}

◆ InsertPhi() [1/2]

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

Definition at line 1918 of file il.cc.

1918 {
1919 // Lazily initialize the array of phis.
1920 // Currently, phis are stored in a sparse array that holds the phi
1921 // for variable with index i at position i.
1922 // TODO(fschneider): Store phis in a more compact way.
1923 if (phis_ == nullptr) {
1924 phis_ = new ZoneGrowableArray<PhiInstr*>(var_count);
1925 for (intptr_t i = 0; i < var_count; i++) {
1926 phis_->Add(nullptr);
1927 }
1928 }
1929 ASSERT((*phis_)[var_index] == nullptr);
1930 return (*phis_)[var_index] = new PhiInstr(this, PredecessorCount());
1931}
virtual intptr_t PredecessorCount() const
Definition: il.h:2065

◆ InsertPhi() [2/2]

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

Definition at line 1933 of file il.cc.

1933 {
1934 // Lazily initialize the array of phis.
1935 if (phis_ == nullptr) {
1936 phis_ = new ZoneGrowableArray<PhiInstr*>(1);
1937 }
1938 phis_->Add(phi);
1939}

◆ phis()

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

Definition at line 2073 of file il.h.

2073{ return phis_; }

◆ PredecessorAt()

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

Implements dart::BlockEntryInstr.

Definition at line 2066 of file il.h.

2066 {
2067 return predecessors_[index];
2068 }

◆ PredecessorCount()

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

Implements dart::BlockEntryInstr.

Definition at line 2065 of file il.h.

2065{ return predecessors_.length(); }

◆ RemoveDeadPhis()

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

Definition at line 1952 of file il.cc.

1952 {
1953 if (phis_ == nullptr) return;
1954
1955 intptr_t to_index = 0;
1956 for (intptr_t from_index = 0; from_index < phis_->length(); ++from_index) {
1957 PhiInstr* phi = (*phis_)[from_index];
1958 if (phi != nullptr) {
1959 if (phi->is_alive()) {
1960 (*phis_)[to_index++] = phi;
1961 for (intptr_t i = phi->InputCount() - 1; i >= 0; --i) {
1962 Value* input = phi->InputAt(i);
1963 input->definition()->AddInputUse(input);
1964 }
1965 } else {
1966 phi->ReplaceUsesWith(replacement);
1967 }
1968 }
1969 }
1970 if (to_index == 0) {
1971 phis_ = nullptr;
1972 } else {
1973 phis_->TruncateTo(to_index);
1974 }
1975}

◆ RemovePhi()

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

Definition at line 1941 of file il.cc.

1941 {
1942 ASSERT(phis_ != nullptr);
1943 for (intptr_t index = 0; index < phis_->length(); ++index) {
1944 if (phi == (*phis_)[index]) {
1945 (*phis_)[index] = phis_->Last();
1946 phis_->RemoveLast();
1947 return;
1948 }
1949 }
1950}

Friends And Related Function Documentation

◆ ConstantPropagator

friend class ConstantPropagator
friend

Definition at line 2101 of file il.h.

◆ DeadCodeElimination

friend class DeadCodeElimination
friend

Definition at line 2102 of file il.h.

◆ IndirectEntryInstr

friend class IndirectEntryInstr
friend

Definition at line 2098 of file il.h.

◆ InlineExitCollector

Definition at line 2096 of file il.h.

◆ PolymorphicInliner

friend class PolymorphicInliner
friend

Definition at line 2097 of file il.h.

Member Data Documentation

◆ predecessors_

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

Definition at line 2107 of file il.h.


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