Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 >

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
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
 

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
 
- Protected Member Functions inherited from dart::BlockEntryWithInitialDefs
void PrintInitialDefinitionsTo (BaseTextBuffer *f) 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 Attributes inherited from dart::TemplateInstruction< 0, NoThrow >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 1937 of file il.h.

Constructor & Destructor Documentation

◆ GraphEntryInstr()

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

Definition at line 1215 of file il.cc.

1218 osr_id,
1219 CompilerState::Current().GetNextDeoptId()) {}
static CompilerState & Current()
const ParsedFunction & parsed_function() const
Definition il.h:1995
intptr_t osr_id() const
Definition il.h:1963
GraphEntryInstr(const ParsedFunction &parsed_function, intptr_t osr_id)
Definition il.cc:1215

Member Function Documentation

◆ AddCatchEntry()

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

Definition at line 1951 of file il.h.

1951{ catch_entries_.Add(entry); }

◆ AddIndirectEntry()

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

Definition at line 1955 of file il.h.

1955 {
1956 indirect_entries_.Add(entry);
1957 }

◆ AddPredecessor()

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

Implements dart::BlockEntryInstr.

Definition at line 2019 of file il.h.

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

◆ catch_entries()

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

Definition at line 1997 of file il.h.

1997 {
1998 return catch_entries_;
1999 }

◆ ClearPredecessors()

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

Implements dart::BlockEntryInstr.

Definition at line 2018 of file il.h.

2018{}

◆ constant_null()

ConstantInstr * dart::GraphEntryInstr::constant_null ( )

Definition at line 1236 of file il.cc.

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

◆ entry_count()

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

Definition at line 1965 of file il.h.

1965{ return entry_count_; }

◆ fixed_slot_count()

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

Definition at line 1981 of file il.h.

1981{ return fixed_slot_count_; }

◆ GetCatchEntry()

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

Definition at line 1246 of file il.cc.

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

◆ HasSingleEntryPoint()

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

Definition at line 2005 of file il.h.

2005 {
2006 return catch_entries().is_empty() && unchecked_entry() == nullptr;
2007 }
FunctionEntryInstr * unchecked_entry() const
Definition il.h:1987
const GrowableArray< CatchBlockEntryInstr * > & catch_entries() const
Definition il.h:1997

◆ indirect_entries()

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

Definition at line 2001 of file il.h.

2001 {
2002 return indirect_entries_;
2003 }

◆ IsCompiledForOsr()

bool dart::GraphEntryInstr::IsCompiledForOsr ( ) const

Definition at line 1255 of file il.cc.

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

◆ MarkFrameless()

void dart::GraphEntryInstr::MarkFrameless ( )
inline

Definition at line 1976 of file il.h.

1976{ needs_frame_ = false; }

◆ NeedsFrame()

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

Definition at line 1975 of file il.h.

1975{ return needs_frame_; }

◆ normal_entry()

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

Definition at line 1986 of file il.h.

1986{ return normal_entry_; }

◆ osr_entry()

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

Definition at line 1992 of file il.h.

1992{ return osr_entry_; }

◆ osr_id()

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

Definition at line 1963 of file il.h.

1963{ return osr_id_; }

◆ parsed_function()

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

Definition at line 1995 of file il.h.

1995{ return parsed_function_; }

◆ PredecessorAt()

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

Implements dart::BlockEntryInstr.

Definition at line 1944 of file il.h.

1944 {
1945 UNREACHABLE();
1946 return nullptr;
1947 }

◆ PredecessorCount()

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

Implements dart::BlockEntryInstr.

Definition at line 1943 of file il.h.

1943{ return 0; }

◆ RelinkToOsrEntry()

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

Definition at line 1740 of file il.cc.

1740 {
1741 ASSERT(osr_id_ != Compiler::kNoOSRDeoptId);
1742 BitVector* block_marks = new (zone) BitVector(zone, max_block_id + 1);
1743 bool found = FindOsrEntryAndRelink(this, /*parent=*/nullptr, block_marks);
1744 ASSERT(found);
1745}
bool FindOsrEntryAndRelink(GraphEntryInstr *graph_entry, Instruction *parent, BitVector *block_marks)
Definition il.cc:1747

◆ set_entry_count()

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

Definition at line 1966 of file il.h.

1966{ entry_count_ = count; }
int count

◆ set_fixed_slot_count()

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

Definition at line 1982 of file il.h.

1982 {
1983 ASSERT(count >= 0);
1984 fixed_slot_count_ = count;
1985 }

◆ set_normal_entry()

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

Definition at line 1988 of file il.h.

1988{ normal_entry_ = entry; }

◆ set_osr_entry()

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

Definition at line 1993 of file il.h.

1993{ osr_entry_ = entry; }

◆ set_spill_slot_count()

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

Definition at line 1969 of file il.h.

1969 {
1970 ASSERT(count >= 0);
1971 spill_slot_count_ = count;
1972 }

◆ set_unchecked_entry()

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

Definition at line 1989 of file il.h.

1989 {
1990 unchecked_entry_ = target;
1991 }
uint32_t * target

◆ spill_slot_count()

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

Definition at line 1968 of file il.h.

1968{ return spill_slot_count_; }

◆ SuccessorAt()

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

Definition at line 1985 of file il.cc.

1985 {
1986 if (normal_entry() != nullptr) {
1987 if (index == 0) return normal_entry_;
1988 index--;
1989 }
1990 if (unchecked_entry() != nullptr) {
1991 if (index == 0) return unchecked_entry();
1992 index--;
1993 }
1994 if (osr_entry() != nullptr) {
1995 if (index == 0) return osr_entry();
1996 index--;
1997 }
1998 return catch_entries_[index];
1999}
FunctionEntryInstr * normal_entry() const
Definition il.h:1986
OsrEntryInstr * osr_entry() const
Definition il.h:1992

◆ SuccessorCount()

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

Definition at line 1979 of file il.cc.

1979 {
1980 return (normal_entry() == nullptr ? 0 : 1) +
1981 (unchecked_entry() == nullptr ? 0 : 1) +
1982 (osr_entry() == nullptr ? 0 : 1) + catch_entries_.length();
1983}

◆ unchecked_entry()

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

Definition at line 1987 of file il.h.

1987{ return unchecked_entry_; }

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