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

#include <il.h>

Inheritance diagram for dart::GraphEntryInstr:
dart::BlockEntryWithInitialDefs dart::BlockEntryInstr dart::TemplateInstruction< 0, NoThrow > dart::Instruction dart::ZoneAllocated

Public Member Functions

 GraphEntryInstr (const ParsedFunction &parsed_function, intptr_t osr_id)
 
virtual intptr_t PredecessorCount () const
 
virtual BlockEntryInstrPredecessorAt (intptr_t index) const
 
virtual intptr_t SuccessorCount () const
 
virtual BlockEntryInstrSuccessorAt (intptr_t index) const
 
void AddCatchEntry (CatchBlockEntryInstr *entry)
 
CatchBlockEntryInstrGetCatchEntry (intptr_t index)
 
void AddIndirectEntry (IndirectEntryInstr *entry)
 
ConstantInstrconstant_null ()
 
void RelinkToOsrEntry (Zone *zone, intptr_t max_block_id)
 
bool IsCompiledForOsr () const
 
intptr_t osr_id () const
 
intptr_t entry_count () const
 
void set_entry_count (intptr_t count)
 
intptr_t spill_slot_count () const
 
void set_spill_slot_count (intptr_t count)
 
bool NeedsFrame () const
 
void MarkFrameless ()
 
intptr_t fixed_slot_count () const
 
void set_fixed_slot_count (intptr_t count)
 
FunctionEntryInstrnormal_entry () const
 
FunctionEntryInstrunchecked_entry () const
 
void set_normal_entry (FunctionEntryInstr *entry)
 
void set_unchecked_entry (FunctionEntryInstr *target)
 
OsrEntryInstrosr_entry () const
 
void set_osr_entry (OsrEntryInstr *entry)
 
const ParsedFunctionparsed_function () const
 
const GrowableArray< CatchBlockEntryInstr * > & catch_entries () const
 
const GrowableArray< IndirectEntryInstr * > & indirect_entries () const
 
bool HasSingleEntryPoint () const
 
- Public Member Functions inherited from dart::BlockEntryWithInitialDefs
 BlockEntryWithInitialDefs (intptr_t block_id, intptr_t try_index, intptr_t deopt_id, intptr_t stack_depth)
 
GrowableArray< Definition * > * initial_definitions ()
 
const GrowableArray< Definition * > * initial_definitions () const
 
virtual BlockEntryWithInitialDefsAsBlockEntryWithInitialDefs ()
 
virtual const BlockEntryWithInitialDefsAsBlockEntryWithInitialDefs () const
 
- 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)
 

Private Member Functions

virtual void ClearPredecessors ()
 
virtual void AddPredecessor (BlockEntryInstr *predecessor)
 

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::BlockEntryWithInitialDefs
virtual void PrintBlockHeaderTo (BaseTextBuffer *f) const
 
void PrintInitialDefinitionsTo (BaseTextBuffer *f, std::function< void(BaseTextBuffer *f)> callback) const
 
- 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 1952 of file il.h.

Constructor & Destructor Documentation

◆ GraphEntryInstr()

dart::GraphEntryInstr::GraphEntryInstr ( const ParsedFunction parsed_function,
intptr_t  osr_id 
)

Definition at line 1217 of file il.cc.

1220 osr_id,
1221 CompilerState::Current().GetNextDeoptId()) {}
static CompilerState & Current()
const ParsedFunction & parsed_function() const
Definition: il.h:2010
intptr_t osr_id() const
Definition: il.h:1978
GraphEntryInstr(const ParsedFunction &parsed_function, intptr_t osr_id)
Definition: il.cc:1217

Member Function Documentation

◆ AddCatchEntry()

void dart::GraphEntryInstr::AddCatchEntry ( CatchBlockEntryInstr entry)
inline

Definition at line 1966 of file il.h.

1966{ catch_entries_.Add(entry); }

◆ AddIndirectEntry()

void dart::GraphEntryInstr::AddIndirectEntry ( IndirectEntryInstr entry)
inline

Definition at line 1970 of file il.h.

1970 {
1971 indirect_entries_.Add(entry);
1972 }

◆ AddPredecessor()

virtual void dart::GraphEntryInstr::AddPredecessor ( BlockEntryInstr predecessor)
inlineprivatevirtual

Implements dart::BlockEntryInstr.

Definition at line 2034 of file il.h.

2034{ UNREACHABLE(); }
#define UNREACHABLE()
Definition: assert.h:248

◆ catch_entries()

const GrowableArray< CatchBlockEntryInstr * > & dart::GraphEntryInstr::catch_entries ( ) const
inline

Definition at line 2012 of file il.h.

2012 {
2013 return catch_entries_;
2014 }

◆ ClearPredecessors()

virtual void dart::GraphEntryInstr::ClearPredecessors ( )
inlineprivatevirtual

Implements dart::BlockEntryInstr.

Definition at line 2033 of file il.h.

2033{}

◆ constant_null()

ConstantInstr * dart::GraphEntryInstr::constant_null ( )

Definition at line 1238 of file il.cc.

1238 {
1240 for (intptr_t i = 0; i < initial_definitions()->length(); ++i) {
1241 ConstantInstr* defn = (*initial_definitions())[i]->AsConstant();
1242 if (defn != nullptr && defn->value().IsNull()) return defn;
1243 }
1244 UNREACHABLE();
1245 return nullptr;
1246}
GrowableArray< Definition * > * initial_definitions()
Definition: il.h:1917
#define ASSERT(E)
size_t length

◆ entry_count()

intptr_t dart::GraphEntryInstr::entry_count ( ) const
inline

Definition at line 1980 of file il.h.

1980{ return entry_count_; }

◆ fixed_slot_count()

intptr_t dart::GraphEntryInstr::fixed_slot_count ( ) const
inline

Definition at line 1996 of file il.h.

1996{ return fixed_slot_count_; }

◆ GetCatchEntry()

CatchBlockEntryInstr * dart::GraphEntryInstr::GetCatchEntry ( intptr_t  index)

Definition at line 1248 of file il.cc.

1248 {
1249 // TODO(fschneider): Sort the catch entries by catch_try_index to avoid
1250 // searching.
1251 for (intptr_t i = 0; i < catch_entries_.length(); ++i) {
1252 if (catch_entries_[i]->catch_try_index() == index) return catch_entries_[i];
1253 }
1254 return nullptr;
1255}

◆ HasSingleEntryPoint()

bool dart::GraphEntryInstr::HasSingleEntryPoint ( ) const
inline

Definition at line 2020 of file il.h.

2020 {
2021 return catch_entries().is_empty() && unchecked_entry() == nullptr;
2022 }
FunctionEntryInstr * unchecked_entry() const
Definition: il.h:2002
const GrowableArray< CatchBlockEntryInstr * > & catch_entries() const
Definition: il.h:2012

◆ indirect_entries()

const GrowableArray< IndirectEntryInstr * > & dart::GraphEntryInstr::indirect_entries ( ) const
inline

Definition at line 2016 of file il.h.

2016 {
2017 return indirect_entries_;
2018 }

◆ IsCompiledForOsr()

bool dart::GraphEntryInstr::IsCompiledForOsr ( ) const

Definition at line 1257 of file il.cc.

1257 {
1258 return osr_id_ != Compiler::kNoOSRDeoptId;
1259}
static constexpr intptr_t kNoOSRDeoptId
Definition: compiler.h:73

◆ MarkFrameless()

void dart::GraphEntryInstr::MarkFrameless ( )
inline

Definition at line 1991 of file il.h.

1991{ needs_frame_ = false; }

◆ NeedsFrame()

bool dart::GraphEntryInstr::NeedsFrame ( ) const
inline

Definition at line 1990 of file il.h.

1990{ return needs_frame_; }

◆ normal_entry()

FunctionEntryInstr * dart::GraphEntryInstr::normal_entry ( ) const
inline

Definition at line 2001 of file il.h.

2001{ return normal_entry_; }

◆ osr_entry()

OsrEntryInstr * dart::GraphEntryInstr::osr_entry ( ) const
inline

Definition at line 2007 of file il.h.

2007{ return osr_entry_; }

◆ osr_id()

intptr_t dart::GraphEntryInstr::osr_id ( ) const
inline

Definition at line 1978 of file il.h.

1978{ return osr_id_; }

◆ parsed_function()

const ParsedFunction & dart::GraphEntryInstr::parsed_function ( ) const
inline

Definition at line 2010 of file il.h.

2010{ return parsed_function_; }

◆ PredecessorAt()

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

Implements dart::BlockEntryInstr.

Definition at line 1959 of file il.h.

1959 {
1960 UNREACHABLE();
1961 return nullptr;
1962 }

◆ PredecessorCount()

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

Implements dart::BlockEntryInstr.

Definition at line 1958 of file il.h.

1958{ return 0; }

◆ RelinkToOsrEntry()

void dart::GraphEntryInstr::RelinkToOsrEntry ( Zone zone,
intptr_t  max_block_id 
)

Definition at line 1749 of file il.cc.

1749 {
1750 ASSERT(osr_id_ != Compiler::kNoOSRDeoptId);
1751 BitVector* block_marks = new (zone) BitVector(zone, max_block_id + 1);
1752 bool found = FindOsrEntryAndRelink(this, /*parent=*/nullptr, block_marks);
1753 ASSERT(found);
1754}
bool FindOsrEntryAndRelink(GraphEntryInstr *graph_entry, Instruction *parent, BitVector *block_marks)
Definition: il.cc:1756

◆ set_entry_count()

void dart::GraphEntryInstr::set_entry_count ( intptr_t  count)
inline

Definition at line 1981 of file il.h.

1981{ entry_count_ = count; }
int count
Definition: FontMgrTest.cpp:50

◆ set_fixed_slot_count()

void dart::GraphEntryInstr::set_fixed_slot_count ( intptr_t  count)
inline

Definition at line 1997 of file il.h.

1997 {
1998 ASSERT(count >= 0);
1999 fixed_slot_count_ = count;
2000 }

◆ set_normal_entry()

void dart::GraphEntryInstr::set_normal_entry ( FunctionEntryInstr entry)
inline

Definition at line 2003 of file il.h.

2003{ normal_entry_ = entry; }

◆ set_osr_entry()

void dart::GraphEntryInstr::set_osr_entry ( OsrEntryInstr entry)
inline

Definition at line 2008 of file il.h.

2008{ osr_entry_ = entry; }

◆ set_spill_slot_count()

void dart::GraphEntryInstr::set_spill_slot_count ( intptr_t  count)
inline

Definition at line 1984 of file il.h.

1984 {
1985 ASSERT(count >= 0);
1986 spill_slot_count_ = count;
1987 }

◆ set_unchecked_entry()

void dart::GraphEntryInstr::set_unchecked_entry ( FunctionEntryInstr target)
inline

Definition at line 2004 of file il.h.

2004 {
2005 unchecked_entry_ = target;
2006 }
uint32_t * target

◆ spill_slot_count()

intptr_t dart::GraphEntryInstr::spill_slot_count ( ) const
inline

Definition at line 1983 of file il.h.

1983{ return spill_slot_count_; }

◆ SuccessorAt()

BlockEntryInstr * dart::GraphEntryInstr::SuccessorAt ( intptr_t  index) const
virtual

Reimplemented from dart::Instruction.

Definition at line 1994 of file il.cc.

1994 {
1995 if (normal_entry() != nullptr) {
1996 if (index == 0) return normal_entry_;
1997 index--;
1998 }
1999 if (unchecked_entry() != nullptr) {
2000 if (index == 0) return unchecked_entry();
2001 index--;
2002 }
2003 if (osr_entry() != nullptr) {
2004 if (index == 0) return osr_entry();
2005 index--;
2006 }
2007 return catch_entries_[index];
2008}
FunctionEntryInstr * normal_entry() const
Definition: il.h:2001
OsrEntryInstr * osr_entry() const
Definition: il.h:2007

◆ SuccessorCount()

intptr_t dart::GraphEntryInstr::SuccessorCount ( ) const
virtual

Reimplemented from dart::Instruction.

Definition at line 1988 of file il.cc.

1988 {
1989 return (normal_entry() == nullptr ? 0 : 1) +
1990 (unchecked_entry() == nullptr ? 0 : 1) +
1991 (osr_entry() == nullptr ? 0 : 1) + catch_entries_.length();
1992}

◆ unchecked_entry()

FunctionEntryInstr * dart::GraphEntryInstr::unchecked_entry ( ) const
inline

Definition at line 2002 of file il.h.

2002{ return unchecked_entry_; }

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