Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Friends | List of all members
dart::Instruction Class Referenceabstract

#include <il.h>

Inheritance diagram for dart::Instruction:
dart::ZoneAllocated dart::TemplateDefinition< 1, NoThrow > dart::TemplateDefinition< 3, NoThrow > dart::TemplateDefinition< 1, Throws > dart::TemplateDefinition< 3, Throws > dart::TemplateDefinition< 2, Throws > dart::TemplateDefinition< 2, NoThrow > dart::TemplateDefinition< N, Throws > dart::TemplateDefinition< 0, NoThrow > dart::TemplateDefinition< 5, NoThrow > dart::TemplateInstruction< 0, NoThrow > dart::TemplateInstruction< 1, NoThrow > dart::TemplateInstruction< 5, NoThrow > dart::TemplateInstruction< 2, Throws > dart::TemplateInstruction< 2, NoThrow > dart::TemplateInstruction< 3, NoThrow > dart::TemplateInstruction< 1, Throws > dart::BranchInstr dart::CheckConditionInstr dart::Definition dart::PureInstruction dart::ReturnBaseInstr dart::TemplateComparison< N, ThrowsTrait, CSETrait > dart::TemplateDefinition< N, ThrowsTrait, CSETrait > dart::TemplateInstruction< N, ThrowsTrait, CSETrait >

Classes

struct  InputsTrait
 
struct  SuccessorsTrait
 

Public Types

enum  Tag { FOR_EACH_INSTRUCTION =(DECLARE_TAG) kNumInstructions }
 
enum  SpeculativeMode { kGuardInputs , kNotSpeculative }
 
using InputsIterable = InstructionIndexedPropertyIterable< InputsTrait >
 
using SuccessorsIterable = InstructionIndexedPropertyIterable< SuccessorsTrait >
 

Public Member Functions

 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)
 

Static Public Member Functions

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

static const intptr_t kInstructionAttrs [kNumInstructions]
 

Protected Member Functions

intptr_t GetDeoptId () const
 
virtual void CopyDeoptIdFrom (const Instruction &instr)
 
void WriteExtraWithoutInputs (FlowGraphSerializer *s)
 
void ReadExtraWithoutInputs (FlowGraphDeserializer *d)
 

Private Member Functions

virtual void RawSetInputAt (intptr_t i, Value *value)=0
 

Friends

class CallSiteInliner
 
class LICM
 
class ComparisonInstr
 
class Scheduler
 
class BlockEntryInstr
 
class CatchBlockEntryInstr
 
class DebugStepCheckInstr
 
class StrictCompareInstr
 
class BranchInstr
 
class IfThenElseInstr
 
class CheckConditionInstr
 

Detailed Description

Definition at line 962 of file il.h.

Member Typedef Documentation

◆ InputsIterable

Definition at line 1031 of file il.h.

◆ SuccessorsIterable

Definition at line 1135 of file il.h.

Member Enumeration Documentation

◆ SpeculativeMode

Enumerator
kGuardInputs 
kNotSpeculative 

Definition at line 970 of file il.h.

970 {
971 // Types of inputs should be checked when unboxing for this instruction.
973 // Each input is guaranteed to have a valid type for the input
974 // representation and its type should not be checked when unboxing.
976 };
@ kGuardInputs
Definition: il.h:972
@ kNotSpeculative
Definition: il.h:975

◆ Tag

Enumerator
FOR_EACH_INSTRUCTION 

Definition at line 965 of file il.h.

965{ FOR_EACH_INSTRUCTION(DECLARE_TAG) kNumInstructions };
@ FOR_EACH_INSTRUCTION
Definition: il.h:965
#define DECLARE_TAG(type, attrs)
Definition: il.h:964

Constructor & Destructor Documentation

◆ Instruction() [1/2]

dart::Instruction::Instruction ( const InstructionSource source,
intptr_t  deopt_id = DeoptId::kNone 
)
inlineexplicit

Definition at line 980 of file il.h.

982 : deopt_id_(deopt_id), inlining_id_(source.inlining_id) {}
InstructionSource source() const
Definition: il.h:1008
intptr_t deopt_id() const
Definition: il.h:993

◆ Instruction() [2/2]

dart::Instruction::Instruction ( intptr_t  deopt_id = DeoptId::kNone)
inlineexplicit

Definition at line 984 of file il.h.

985 : Instruction(InstructionSource(), deopt_id) {}
Instruction(const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
Definition: il.h:980

◆ ~Instruction()

virtual dart::Instruction::~Instruction ( )
inlinevirtual

Definition at line 987 of file il.h.

987{}

Member Function Documentation

◆ Accept()

virtual void dart::Instruction::Accept ( InstructionVisitor visitor)
pure virtual

◆ AllowsCSE()

virtual bool dart::Instruction::AllowsCSE ( ) const
inlinevirtual

◆ AppendInstruction()

Instruction * dart::Instruction::AppendInstruction ( Instruction tail)

Definition at line 1341 of file il.cc.

1341 {
1342 LinkTo(tail);
1343 // Update def-use chains whenever instructions are added to the graph
1344 // after initial graph construction.
1345 for (intptr_t i = tail->InputCount() - 1; i >= 0; --i) {
1346 Value* input = tail->InputAt(i);
1347 input->definition()->AddInputUse(input);
1348 }
1349 return tail;
1350}
void LinkTo(Instruction *next)
Definition: il.h:1108

◆ ArgumentAt()

Definition * dart::Instruction::ArgumentAt ( intptr_t  index) const
inline

Definition at line 3441 of file il.h.

3441 {
3442 return ArgumentValueAt(index)->definition();
3443}
Value * ArgumentValueAt(intptr_t index) const
Definition: il.h:3435
Definition * definition() const
Definition: il.h:103

◆ ArgumentCount()

virtual intptr_t dart::Instruction::ArgumentCount ( ) const
inlinevirtual

Reimplemented in dart::BranchInstr, dart::TemplateDartCall< kExtraInputs >, dart::TemplateDartCall< 0 >, and dart::TemplateDartCall< 1 >.

Definition at line 1041 of file il.h.

1041{ return 0; }

◆ ArgumentValueAt()

Value * dart::Instruction::ArgumentValueAt ( intptr_t  index) const
inline

Definition at line 3435 of file il.h.

3435 {
3436 MoveArgumentsArray* move_arguments = GetMoveArguments();
3437 return move_arguments != nullptr ? (*move_arguments)[index]->value()
3438 : InputAt(index);
3439}
virtual Value * InputAt(intptr_t i) const =0
virtual MoveArgumentsArray * GetMoveArguments() const
Definition: il.h:1050
ZoneGrowableArray< MoveArgumentInstr * > MoveArgumentsArray
Definition: il.h:902

◆ AttributesEqual()

virtual bool dart::Instruction::AttributesEqual ( const Instruction other) const
inlinevirtual

Reimplemented in dart::StoreIndexedUnsafeInstr, dart::LoadIndexedUnsafeInstr, dart::MemoryCopyInstr, dart::TailCallInstr, dart::DartReturnInstr, dart::NativeReturnInstr, dart::ComparisonInstr, dart::DeoptimizeInstr, dart::ConstraintInstr, dart::ConstantInstr, dart::AssertSubtypeInstr, dart::AssertAssignableInstr, dart::AssertBooleanInstr, dart::StrictCompareInstr, dart::TestCidsInstr, dart::TestRangeInstr, dart::EqualityCompareInstr, dart::RelationalOpInstr, dart::IfThenElseInstr, dart::GuardFieldClassInstr, dart::GuardFieldLengthInstr, dart::GuardFieldTypeInstr, dart::LoadStaticFieldInstr, dart::OneByteStringFromCharCodeInstr, dart::StringToCharCodeInstr, dart::Utf8ScanInstr, dart::AllocateClosureInstr, dart::LoadUntaggedInstr, dart::CalculateElementAddressInstr, dart::LoadClassIdInstr, dart::LoadFieldInstr, dart::CheckEitherNonSmiInstr, dart::BoxInstr, dart::UnboxInstr, dart::UnboxIntegerInstr, dart::CaseInsensitiveCompareInstr, dart::MathMinMaxInstr, dart::BinaryDoubleOpInstr, dart::DoubleTestOpInstr, dart::HashDoubleOpInstr, dart::HashIntegerOpInstr, dart::UnaryIntegerOpInstr, dart::UnaryInt64OpInstr, dart::BinaryIntegerOpInstr, dart::BinaryInt64OpInstr, dart::UnaryDoubleOpInstr, dart::SmiToDoubleInstr, dart::Int32ToDoubleInstr, dart::Int64ToDoubleInstr, dart::DoubleToIntegerInstr, dart::DoubleToSmiInstr, dart::DoubleToFloatInstr, dart::FloatToDoubleInstr, dart::FloatCompareInstr, dart::InvokeMathCFunctionInstr, dart::ExtractNthOutputInstr, dart::MakePairInstr, dart::UnboxLaneInstr, dart::BoxLanesInstr, dart::TruncDivModInstr, dart::CheckClassInstr, dart::CheckSmiInstr, dart::CheckNullInstr, dart::CheckClassIdInstr, dart::CheckArrayBoundInstr, dart::GenericCheckBoundInstr, dart::CheckWritableInstr, dart::CheckConditionInstr, dart::IntConverterInstr, dart::BitCastInstr, dart::LoadThreadInstr, and dart::SimdOpInstr.

Definition at line 1331 of file il.h.

1331 {
1332 UNREACHABLE();
1333 return false;
1334 }
#define UNREACHABLE()
Definition: assert.h:248

◆ CanBecomeDeoptimizationTarget()

virtual bool dart::Instruction::CanBecomeDeoptimizationTarget ( ) const
inlinevirtual

◆ CanCallDart()

virtual bool dart::Instruction::CanCallDart ( ) const
inlinevirtual

◆ CanDeoptimize()

bool dart::Instruction::CanDeoptimize ( ) const
inline

Definition at line 1079 of file il.h.

1079 {
1080 return env() != nullptr &&
1082 }
virtual bool ComputeCanDeoptimizeAfterCall() const
Definition: il.h:1070
virtual bool ComputeCanDeoptimize() const =0
Environment * env() const
Definition: il.h:1215

◆ CanEliminate() [1/2]

bool dart::Instruction::CanEliminate ( )
inline

Definition at line 1360 of file il.h.

1360{ return CanEliminate(GetBlock()); }
virtual BlockEntryInstr * GetBlock()
Definition: il.cc:1352
bool CanEliminate()
Definition: il.h:1360

◆ CanEliminate() [2/2]

bool dart::Instruction::CanEliminate ( const BlockEntryInstr block) const
virtual

Reimplemented in dart::Definition, dart::ReachabilityFenceInstr, and dart::CheckStackOverflowInstr.

Definition at line 1575 of file il.cc.

1575 {
1576 ASSERT(const_cast<Instruction*>(this)->GetBlock() == block);
1577 return !MayHaveVisibleEffect() && !CanDeoptimize() &&
1578 this != block->last_instruction();
1579}
virtual bool MayHaveVisibleEffect() const
Definition: il.h:1352
bool CanDeoptimize() const
Definition: il.h:1079
#define ASSERT(E)

◆ Canonicalize()

Instruction * dart::Instruction::Canonicalize ( FlowGraph flow_graph)
virtual

Reimplemented in dart::Definition, dart::PhiInstr, dart::MemoryCopyInstr, dart::BranchInstr, dart::RedefinitionInstr, dart::ConstantInstr, dart::AssertSubtypeInstr, dart::AssertAssignableInstr, dart::AssertBooleanInstr, dart::InstanceCallInstr, dart::DispatchTableCallInstr, dart::StrictCompareInstr, dart::TestCidsInstr, dart::TestRangeInstr, dart::EqualityCompareInstr, dart::StaticCallInstr, dart::CachableIdempotentCallInstr, dart::DebugStepCheckInstr, dart::StoreFieldInstr, dart::GuardFieldClassInstr, dart::GuardFieldLengthInstr, dart::GuardFieldTypeInstr, dart::LoadIndexedInstr, dart::StoreIndexedInstr, dart::RecordCoverageInstr, dart::BooleanNegateInstr, dart::AllocateClosureInstr, dart::CalculateElementAddressInstr, dart::LoadClassIdInstr, dart::LoadFieldInstr, dart::InstantiateTypeArgumentsInstr, dart::AllocateContextInstr, dart::CheckEitherNonSmiInstr, dart::BoxInstr, dart::BoxIntegerInstr, dart::BoxInt64Instr, dart::UnboxInstr, dart::UnboxIntegerInstr, dart::BinaryDoubleOpInstr, dart::DoubleTestOpInstr, dart::UnaryIntegerOpInstr, dart::BinaryIntegerOpInstr, dart::CheckStackOverflowInstr, dart::DoubleToIntegerInstr, dart::DoubleToFloatInstr, dart::FloatToDoubleInstr, dart::InvokeMathCFunctionInstr, dart::UnboxLaneInstr, dart::BoxLanesInstr, dart::CheckClassInstr, dart::CheckSmiInstr, dart::CheckNullInstr, dart::CheckClassIdInstr, dart::CheckBoundBaseInstr, dart::CheckWritableInstr, dart::CheckConditionInstr, dart::IntConverterInstr, dart::SimdOpInstr, dart::SuspendInstr, and dart::PolymorphicInstanceCallInstr.

Definition at line 2629 of file il.cc.

2629 {
2630 return this;
2631}

◆ CanTriggerGC()

bool dart::Instruction::CanTriggerGC ( ) const
virtual

Reimplemented in dart::StoreFieldInstr, dart::TemplateLoadField< N >, dart::TemplateLoadField< 1 >, dart::TemplateLoadField< 0 >, dart::LoadCodeUnitsInstr, dart::LoadFieldInstr, and dart::BoxIntegerInstr.

Definition at line 1628 of file il.cc.

1628 {
1629 return (kInstructionAttrs[tag()] & InstrAttrs::kNoGC) == 0;
1630}
static const intptr_t kInstructionAttrs[kNumInstructions]
Definition: il.h:968
virtual Tag tag() const =0

◆ Cast()

template<typename T >
const T * dart::Instruction::Cast ( ) const
inline

Definition at line 1186 of file il.h.

1186 {
1187 return static_cast<const T*>(this);
1188 }
#define T
Definition: precompiler.cc:65

◆ CheckField()

void dart::Instruction::CheckField ( const Field field) const
inline

Definition at line 1153 of file il.h.

1153{}

◆ ClearEnv()

void dart::Instruction::ClearEnv ( )
inline

Definition at line 1364 of file il.h.

1364{ env_ = nullptr; }

◆ ComputeCanDeoptimize()

virtual bool dart::Instruction::ComputeCanDeoptimize ( ) const
pure virtual

Implemented in dart::ParallelMoveInstr, dart::BlockEntryInstr, dart::PhiInstr, dart::ParameterInstr, dart::NativeParameterInstr, dart::StoreIndexedUnsafeInstr, dart::LoadIndexedUnsafeInstr, dart::MemoryCopyInstr, dart::TailCallInstr, dart::MoveArgumentInstr, dart::ReturnBaseInstr, dart::ThrowInstr, dart::ReThrowInstr, dart::StopInstr, dart::GotoInstr, dart::IndirectGotoInstr, dart::BranchInstr, dart::DeoptimizeInstr, dart::RedefinitionInstr, dart::ReachabilityFenceInstr, dart::ConstraintInstr, dart::ConstantInstr, dart::AssertSubtypeInstr, dart::AssertAssignableInstr, dart::AssertBooleanInstr, dart::TemplateDartCall< kExtraInputs >, dart::TemplateDartCall< 0 >, dart::TemplateDartCall< 1 >, dart::StrictCompareInstr, dart::TestIntInstr, dart::TestCidsInstr, dart::TestRangeInstr, dart::EqualityCompareInstr, dart::RelationalOpInstr, dart::IfThenElseInstr, dart::StaticCallInstr, dart::CachableIdempotentCallInstr, dart::LoadLocalInstr, dart::DropTempsInstr, dart::MakeTempInstr, dart::StoreLocalInstr, dart::NativeCallInstr, dart::FfiCallInstr, dart::LeafRuntimeCallInstr, dart::DebugStepCheckInstr, dart::StoreFieldInstr, dart::GuardFieldInstr, dart::TemplateLoadField< N >, dart::TemplateLoadField< 1 >, dart::TemplateLoadField< 0 >, dart::StoreStaticFieldInstr, dart::LoadIndexedInstr, dart::LoadCodeUnitsInstr, dart::OneByteStringFromCharCodeInstr, dart::StringToCharCodeInstr, dart::Utf8ScanInstr, dart::StoreIndexedInstr, dart::RecordCoverageInstr, dart::BooleanNegateInstr, dart::BoolToIntInstr, dart::IntToBoolInstr, dart::InstanceOfInstr, dart::AllocationInstr, dart::MaterializeObjectInstr, dart::LoadUntaggedInstr, dart::CalculateElementAddressInstr, dart::LoadClassIdInstr, dart::InstantiateTypeInstr, dart::InstantiateTypeArgumentsInstr, dart::AllocateContextInstr, dart::CloneContextInstr, dart::CheckEitherNonSmiInstr, dart::BoxInstr, dart::UnboxInstr, dart::UnboxIntegerInstr, dart::CaseInsensitiveCompareInstr, dart::MathMinMaxInstr, dart::BinaryDoubleOpInstr, dart::DoubleTestOpInstr, dart::HashDoubleOpInstr, dart::HashIntegerOpInstr, dart::UnarySmiOpInstr, dart::UnaryUint32OpInstr, dart::UnaryInt64OpInstr, dart::BinarySmiOpInstr, dart::BinaryInt32OpInstr, dart::BinaryUint32OpInstr, dart::BinaryInt64OpInstr, dart::ShiftInt64OpInstr, dart::SpeculativeShiftInt64OpInstr, dart::ShiftUint32OpInstr, dart::SpeculativeShiftUint32OpInstr, dart::UnaryDoubleOpInstr, dart::CheckStackOverflowInstr, dart::SmiToDoubleInstr, dart::Int32ToDoubleInstr, dart::Int64ToDoubleInstr, dart::DoubleToIntegerInstr, dart::DoubleToSmiInstr, dart::DoubleToFloatInstr, dart::FloatToDoubleInstr, dart::FloatCompareInstr, dart::InvokeMathCFunctionInstr, dart::ExtractNthOutputInstr, dart::MakePairInstr, dart::UnboxLaneInstr, dart::BoxLanesInstr, dart::TruncDivModInstr, dart::CheckClassInstr, dart::CheckSmiInstr, dart::CheckNullInstr, dart::CheckClassIdInstr, dart::CheckArrayBoundInstr, dart::GenericCheckBoundInstr, dart::CheckWritableInstr, dart::CheckConditionInstr, dart::IntConverterInstr, dart::BitCastInstr, dart::LoadThreadInstr, dart::SimdOpInstr, dart::Call1ArgStubInstr, and dart::SuspendInstr.

◆ ComputeCanDeoptimizeAfterCall()

virtual bool dart::Instruction::ComputeCanDeoptimizeAfterCall ( ) const
inlinevirtual

◆ CopyDeoptIdFrom()

virtual void dart::Instruction::CopyDeoptIdFrom ( const Instruction instr)
inlineprotectedvirtual

Reimplemented in dart::BranchInstr, dart::IfThenElseInstr, and dart::CheckConditionInstr.

Definition at line 1411 of file il.h.

1411 {
1412 deopt_id_ = instr.deopt_id_;
1413 }

◆ DebugName()

virtual const char * dart::Instruction::DebugName ( ) const
pure virtual

◆ DECLARE_INSTRUCTION_TYPE_CHECK()

dart::Instruction::DECLARE_INSTRUCTION_TYPE_CHECK ( BlockEntryWithInitialDefs  ,
BlockEntryWithInitialDefs   
)
inline

Definition at line 1172 of file il.h.

1181 {
1182 return static_cast<T*>(this);
1183 }

◆ deopt_id()

intptr_t dart::Instruction::deopt_id ( ) const
inline

Definition at line 993 of file il.h.

993 {
996 CompilerState::Current().is_aot());
997 return GetDeoptId();
998 }
static CompilerState & Current()
intptr_t GetDeoptId() const
Definition: il.h:1409
virtual bool MayThrow() const =0
virtual bool CanBecomeDeoptimizationTarget() const
Definition: il.h:1343

◆ DeoptimizationTarget()

virtual intptr_t dart::Instruction::DeoptimizationTarget ( ) const
inlinevirtual

◆ EmitNativeCode()

virtual void dart::Instruction::EmitNativeCode ( FlowGraphCompiler compiler)
inlinevirtual

Reimplemented in dart::ComparisonInstr.

Definition at line 1213 of file il.h.

1213{ UNIMPLEMENTED(); }
#define UNIMPLEMENTED

◆ env()

Environment * dart::Instruction::env ( ) const
inline

Definition at line 1215 of file il.h.

1215{ return env_; }

◆ Equals()

bool dart::Instruction::Equals ( const Instruction other) const

Definition at line 619 of file il.cc.

619 {
620 if (tag() != other.tag()) return false;
621 if (InputCount() != other.InputCount()) return false;
622 for (intptr_t i = 0; i < InputCount(); ++i) {
623 if (!InputAt(i)->Equals(*other.InputAt(i))) return false;
624 }
625 return AttributesEqual(other);
626}
virtual bool AttributesEqual(const Instruction &other) const
Definition: il.h:1331
virtual intptr_t InputCount() const =0
bool Equals(const Value &other) const
Definition: il.cc:633

◆ GetBlock()

BlockEntryInstr * dart::Instruction::GetBlock ( )
virtual

Reimplemented in dart::BlockEntryInstr, dart::PhiInstr, and dart::ParameterInstr.

Definition at line 1352 of file il.cc.

1352 {
1353 // TODO(fschneider): Implement a faster way to get the block of an
1354 // instruction.
1356 while ((result != nullptr) && !result->IsBlockEntry()) {
1357 result = result->previous();
1358 }
1359 // InlineExitCollector::RemoveUnreachableExits may call
1360 // Instruction::GetBlock on instructions which are not properly linked
1361 // to the flow graph (as collected exits may belong to unreachable
1362 // fragments), so this code should gracefully handle the absence of
1363 // BlockEntry.
1364 return (result != nullptr) ? result->AsBlockEntry() : nullptr;
1365}
Instruction * previous() const
Definition: il.h:1087
GAsyncResult * result

◆ GetDeoptId()

intptr_t dart::Instruction::GetDeoptId ( ) const
inlineprotected

Definition at line 1409 of file il.h.

1409{ return deopt_id_; }

◆ GetICData()

const ICData * dart::Instruction::GetICData ( const ZoneGrowableArray< const ICData * > &  ic_data_array,
intptr_t  deopt_id,
bool  is_static_call 
)
static

Definition at line 595 of file il.cc.

598 {
599 // The deopt_id can be outside the range of the IC data array for
600 // computations added in the optimizing compiler.
602 if (deopt_id >= ic_data_array.length()) {
603 return nullptr;
604 }
605 const ICData* result = ic_data_array[deopt_id];
606 ASSERT(result == nullptr || is_static_call == result->is_static_call());
607 return result;
608}

◆ GetMoveArguments()

virtual MoveArgumentsArray * dart::Instruction::GetMoveArguments ( ) const
inlinevirtual

Reimplemented in dart::BranchInstr, dart::TemplateDartCall< kExtraInputs >, dart::TemplateDartCall< 0 >, and dart::TemplateDartCall< 1 >.

Definition at line 1050 of file il.h.

1050 {
1051 UNREACHABLE();
1052 return nullptr;
1053 }

◆ GetPassSpecificId()

intptr_t dart::Instruction::GetPassSpecificId ( CompilerPass::Id  pass) const
inline

Definition at line 1224 of file il.h.

1224 {
1225 return (PassSpecificId::DecodePass(pass_specific_id_) == pass)
1226 ? PassSpecificId::DecodeId(pass_specific_id_)
1227 : PassSpecificId::kNoId;
1228 }

◆ Goto()

void dart::Instruction::Goto ( JoinEntryInstr entry)

Definition at line 2030 of file il.cc.

2030 {
2031 LinkTo(new GotoInstr(entry, CompilerState::Current().GetNextDeoptId()));
2032}

◆ has_inlining_id()

virtual bool dart::Instruction::has_inlining_id ( ) const
inlinevirtual

Reimplemented in dart::BranchInstr.

Definition at line 1317 of file il.h.

1317{ return inlining_id_ >= 0; }

◆ Hash()

uword dart::Instruction::Hash ( ) const
virtual

Reimplemented in dart::PhiInstr, and dart::ParameterInstr.

Definition at line 610 of file il.cc.

610 {
611 uword result = tag();
612 for (intptr_t i = 0; i < InputCount(); ++i) {
613 Value* value = InputAt(i);
614 result = CombineHashes(result, value->definition()->ssa_temp_index());
615 }
616 return FinalizeHash(result, kBitsPerInt32 - 1);
617}
uint8_t value
uint32_t CombineHashes(uint32_t hash, uint32_t other_hash)
Definition: hash.h:12
uintptr_t uword
Definition: globals.h:501
constexpr intptr_t kBitsPerInt32
Definition: globals.h:466
uint32_t FinalizeHash(uint32_t hash, intptr_t hashbits=kBitsPerInt32)
Definition: hash.h:20

◆ HasLocs()

bool dart::Instruction::HasLocs ( ) const
inline

Definition at line 1197 of file il.h.

1197{ return locs_ != nullptr; }

◆ HasMoveArguments()

bool dart::Instruction::HasMoveArguments ( ) const
inline

Definition at line 1059 of file il.h.

1059{ return GetMoveArguments() != nullptr; }

◆ HasPassSpecificId()

bool dart::Instruction::HasPassSpecificId ( CompilerPass::Id  pass) const
inline

Definition at line 1232 of file il.h.

1232 {
1233 return (PassSpecificId::DecodePass(pass_specific_id_) == pass) &&
1234 (PassSpecificId::DecodeId(pass_specific_id_) !=
1235 PassSpecificId::kNoId);
1236 }

◆ HasUnknownSideEffects()

virtual bool dart::Instruction::HasUnknownSideEffects ( ) const
pure virtual

Implemented in dart::PureInstruction, dart::ParallelMoveInstr, dart::BlockEntryInstr, dart::JoinEntryInstr, dart::PureDefinition, dart::PhiInstr, dart::ParameterInstr, dart::NativeParameterInstr, dart::StoreIndexedUnsafeInstr, dart::LoadIndexedUnsafeInstr, dart::MemoryCopyInstr, dart::TailCallInstr, dart::MoveArgumentInstr, dart::ReturnBaseInstr, dart::ThrowInstr, dart::ReThrowInstr, dart::StopInstr, dart::GotoInstr, dart::IndirectGotoInstr, dart::PureComparison, dart::BranchInstr, dart::RedefinitionInstr, dart::ReachabilityFenceInstr, dart::ConstraintInstr, dart::ClosureCallInstr, dart::InstanceCallBaseInstr, dart::DispatchTableCallInstr, dart::IfThenElseInstr, dart::StaticCallInstr, dart::CachableIdempotentCallInstr, dart::LoadLocalInstr, dart::DropTempsInstr, dart::MakeTempInstr, dart::StoreLocalInstr, dart::NativeCallInstr, dart::FfiCallInstr, dart::LeafRuntimeCallInstr, dart::DebugStepCheckInstr, dart::StoreFieldInstr, dart::TemplateLoadField< N >, dart::TemplateLoadField< 1 >, dart::TemplateLoadField< 0 >, dart::StoreStaticFieldInstr, dart::LoadIndexedInstr, dart::LoadCodeUnitsInstr, dart::Utf8ScanInstr, dart::StoreIndexedInstr, dart::RecordCoverageInstr, dart::BooleanNegateInstr, dart::BoolToIntInstr, dart::IntToBoolInstr, dart::InstanceOfInstr, dart::AllocateObjectInstr, dart::AllocateClosureInstr, dart::AllocateUninitializedContextInstr, dart::AllocateRecordInstr, dart::AllocateSmallRecordInstr, dart::MaterializeObjectInstr, dart::CreateArrayInstr, dart::AllocateTypedDataInstr, dart::LoadUntaggedInstr, dart::CalculateElementAddressInstr, dart::InstantiateTypeInstr, dart::InstantiateTypeArgumentsInstr, dart::AllocateContextInstr, dart::CloneContextInstr, dart::CheckStackOverflowInstr, dart::DoubleToIntegerInstr, dart::InvokeMathCFunctionInstr, dart::CheckClassInstr, dart::CheckClassIdInstr, dart::CheckConditionInstr, dart::SimdOpInstr, dart::Call1ArgStubInstr, and dart::SuspendInstr.

◆ HasUnmatchedInputRepresentations()

bool dart::Instruction::HasUnmatchedInputRepresentations ( ) const

Definition at line 1609 of file il.cc.

1609 {
1610 for (intptr_t i = 0; i < InputCount(); i++) {
1611 Definition* input = InputAt(i)->definition();
1612 const Representation input_representation = RequiredInputRepresentation(i);
1613 if (input_representation != kNoRepresentation &&
1614 input_representation != input->representation()) {
1615 return true;
1616 }
1617 }
1618
1619 return false;
1620}
virtual Representation RequiredInputRepresentation(intptr_t idx) const
Definition: il.h:1241
Representation
Definition: locations.h:66

◆ InheritDeoptTarget()

void dart::Instruction::InheritDeoptTarget ( Zone zone,
Instruction other 
)

Definition at line 1569 of file il.cc.

1569 {
1570 ASSERT(other->env() != nullptr);
1571 CopyDeoptIdFrom(*other);
1572 other->env()->DeepCopyTo(zone, this);
1573}
virtual void CopyDeoptIdFrom(const Instruction &instr)
Definition: il.h:1411

◆ InheritDeoptTargetAfter()

void dart::Instruction::InheritDeoptTargetAfter ( FlowGraph flow_graph,
Definition call,
Definition result 
)

Definition at line 1558 of file il.cc.

1560 {
1561 ASSERT(call->env() != nullptr);
1562 deopt_id_ = DeoptId::ToDeoptAfter(call->deopt_id_);
1563 call->env()->DeepCopyAfterTo(
1564 flow_graph->zone(), this, call->ArgumentCount(),
1565 flow_graph->constant_dead(),
1566 result != nullptr ? result : flow_graph->constant_dead());
1567}
static intptr_t ToDeoptAfter(intptr_t deopt_id)
Definition: deopt_id.h:31
def call(args)
Definition: dom.py:159

◆ InitializeLocationSummary()

void dart::Instruction::InitializeLocationSummary ( Zone zone,
bool  optimizing 
)
inline

Definition at line 1202 of file il.h.

1202 {
1203 ASSERT(locs_ == nullptr);
1204 locs_ = MakeLocationSummary(zone, optimizing);
1205 }
virtual LocationSummary * MakeLocationSummary(Zone *zone, bool is_optimizing) const =0

◆ inlining_id()

virtual intptr_t dart::Instruction::inlining_id ( ) const
inlinevirtual

Reimplemented in dart::BranchInstr.

Definition at line 1311 of file il.h.

1311{ return inlining_id_; }

◆ InputAt()

virtual Value * dart::Instruction::InputAt ( intptr_t  i) const
pure virtual

Implemented in dart::TemplateInstruction< N, ThrowsTrait, CSETrait >, dart::TemplateInstruction< 5, Throws, Pure >, dart::TemplateInstruction< 0, NoThrow >, dart::TemplateInstruction< 1, NoThrow >, dart::TemplateInstruction< 2, NoThrow, Pure >, dart::TemplateInstruction< 1, NoThrow, Pure >, dart::TemplateInstruction< 0, NoThrow, Pure >, dart::TemplateInstruction< 5, NoThrow >, dart::TemplateInstruction< 2, Throws >, dart::TemplateInstruction< 2, NoThrow >, dart::TemplateInstruction< 3, NoThrow >, dart::TemplateInstruction< 1, Throws, Pure >, dart::TemplateInstruction< 1, Throws >, dart::TemplateDefinition< N, ThrowsTrait, CSETrait >, dart::TemplateDefinition< 4, Throws, Pure >, dart::TemplateDefinition< 1, Throws, Pure >, dart::TemplateDefinition< 2, NoThrow, Pure >, dart::TemplateDefinition< 1, NoThrow, Pure >, dart::TemplateDefinition< 1, NoThrow >, dart::TemplateDefinition< 4, NoThrow, Pure >, dart::TemplateDefinition< 3, NoThrow >, dart::TemplateDefinition< 1, Throws >, dart::TemplateDefinition< 0, NoThrow, Pure >, dart::TemplateDefinition< 3, Throws >, dart::TemplateDefinition< 2, Throws >, dart::TemplateDefinition< 2, NoThrow >, dart::TemplateDefinition< N, Throws >, dart::TemplateDefinition< 0, NoThrow >, dart::TemplateDefinition< 5, NoThrow >, dart::VariadicDefinition, dart::DartReturnInstr, dart::NativeReturnInstr, dart::TemplateComparison< N, ThrowsTrait, CSETrait >, dart::TemplateComparison< 1, NoThrow, Pure >, dart::TemplateComparison< 2, NoThrow, Pure >, dart::BranchInstr, dart::IfThenElseInstr, dart::DropTempsInstr, dart::TemplateAllocation< N >, dart::TemplateAllocation< 3 >, dart::TemplateAllocation< 0 >, dart::AllocateObjectInstr, dart::TemplateArrayAllocation< N >, dart::TemplateArrayAllocation< 1 >, dart::TemplateArrayAllocation< 2 >, dart::CheckConditionInstr, and dart::SimdOpInstr.

◆ InputCount()

virtual intptr_t dart::Instruction::InputCount ( ) const
pure virtual

Implemented in dart::TemplateInstruction< N, ThrowsTrait, CSETrait >, dart::TemplateInstruction< 5, Throws, Pure >, dart::TemplateInstruction< 0, NoThrow >, dart::TemplateInstruction< 1, NoThrow >, dart::TemplateInstruction< 2, NoThrow, Pure >, dart::TemplateInstruction< 1, NoThrow, Pure >, dart::TemplateInstruction< 0, NoThrow, Pure >, dart::TemplateInstruction< 5, NoThrow >, dart::TemplateInstruction< 2, Throws >, dart::TemplateInstruction< 2, NoThrow >, dart::TemplateInstruction< 3, NoThrow >, dart::TemplateInstruction< 1, Throws, Pure >, dart::TemplateInstruction< 1, Throws >, dart::TemplateDefinition< N, ThrowsTrait, CSETrait >, dart::TemplateDefinition< 4, Throws, Pure >, dart::TemplateDefinition< 1, Throws, Pure >, dart::TemplateDefinition< 2, NoThrow, Pure >, dart::TemplateDefinition< 1, NoThrow, Pure >, dart::TemplateDefinition< 1, NoThrow >, dart::TemplateDefinition< 4, NoThrow, Pure >, dart::TemplateDefinition< 3, NoThrow >, dart::TemplateDefinition< 1, Throws >, dart::TemplateDefinition< 0, NoThrow, Pure >, dart::TemplateDefinition< 3, Throws >, dart::TemplateDefinition< 2, Throws >, dart::TemplateDefinition< 2, NoThrow >, dart::TemplateDefinition< N, Throws >, dart::TemplateDefinition< 0, NoThrow >, dart::TemplateDefinition< 5, NoThrow >, dart::VariadicDefinition, dart::DartReturnInstr, dart::NativeReturnInstr, dart::TemplateComparison< N, ThrowsTrait, CSETrait >, dart::TemplateComparison< 1, NoThrow, Pure >, dart::TemplateComparison< 2, NoThrow, Pure >, dart::BranchInstr, dart::IfThenElseInstr, dart::DropTempsInstr, dart::TemplateAllocation< N >, dart::TemplateAllocation< 3 >, dart::TemplateAllocation< 0 >, dart::AllocateObjectInstr, dart::AllocateClosureInstr, dart::AllocateSmallRecordInstr, dart::TemplateArrayAllocation< N >, dart::TemplateArrayAllocation< 1 >, dart::TemplateArrayAllocation< 2 >, dart::BoxLanesInstr, dart::CheckConditionInstr, dart::SimdOpInstr, and dart::SuspendInstr.

◆ inputs()

InputsIterable dart::Instruction::inputs ( )
inline

Definition at line 1033 of file il.h.

1033{ return InputsIterable(this); }
InstructionIndexedPropertyIterable< InputsTrait > InputsIterable
Definition: il.h:1031

◆ InsertAfter()

void dart::Instruction::InsertAfter ( Instruction prev)

Definition at line 1325 of file il.cc.

1325 {
1326 ASSERT(previous_ == nullptr);
1327 ASSERT(next_ == nullptr);
1328 previous_ = prev;
1329 next_ = prev->next_;
1330 next_->previous_ = this;
1331 previous_->next_ = this;
1332
1333 // Update def-use chains whenever instructions are added to the graph
1334 // after initial graph construction.
1335 for (intptr_t i = InputCount() - 1; i >= 0; --i) {
1336 Value* input = InputAt(i);
1337 input->definition()->AddInputUse(input);
1338 }
1339}
static float prev(float f)

◆ InsertBefore()

void dart::Instruction::InsertBefore ( Instruction next)
inline

Definition at line 1280 of file il.h.

1280{ InsertAfter(next->previous()); }
Instruction * next() const
Definition: il.h:1093
void InsertAfter(Instruction *prev)
Definition: il.cc:1325

◆ IsDominatedBy()

bool dart::Instruction::IsDominatedBy ( Instruction dom)

Definition at line 1581 of file il.cc.

1581 {
1582 BlockEntryInstr* block = GetBlock();
1583 BlockEntryInstr* dom_block = dom->GetBlock();
1584
1585 if (dom->IsPhi()) {
1586 dom = dom_block;
1587 }
1588
1589 if (block == dom_block) {
1590 if ((block == dom) || (this == block->last_instruction())) {
1591 return true;
1592 }
1593
1594 if (IsPhi()) {
1595 return false;
1596 }
1597
1598 for (Instruction* curr = dom->next(); curr != nullptr;
1599 curr = curr->next()) {
1600 if (curr == this) return true;
1601 }
1602
1603 return false;
1604 }
1605
1606 return dom_block->Dominates(block);
1607}
friend class BlockEntryInstr
Definition: il.h:1403
Definition: dom.py:1

◆ LinkTo()

void dart::Instruction::LinkTo ( Instruction next)
inline

Definition at line 1108 of file il.h.

1108 {
1109 ASSERT(this != next);
1110 this->set_next(next);
1111 next->set_previous(this);
1112 }
void set_previous(Instruction *instr)
Definition: il.h:1088
void set_next(Instruction *instr)
Definition: il.h:1094

◆ locs()

LocationSummary * dart::Instruction::locs ( )
inline

Definition at line 1192 of file il.h.

1192 {
1193 ASSERT(locs_ != nullptr);
1194 return locs_;
1195 }

◆ MakeCallSummary()

static LocationSummary * dart::Instruction::MakeCallSummary ( Zone zone,
const Instruction instr,
LocationSummary locs = nullptr 
)
static

◆ MakeLocationSummary()

virtual LocationSummary * dart::Instruction::MakeLocationSummary ( Zone zone,
bool  is_optimizing 
) const
pure virtual

◆ MayHaveVisibleEffect()

virtual bool dart::Instruction::MayHaveVisibleEffect ( ) const
inlinevirtual

◆ MayThrow()

virtual bool dart::Instruction::MayThrow ( ) const
pure virtual

Implemented in dart::TemplateInstruction< N, ThrowsTrait, CSETrait >, dart::TemplateInstruction< 5, Throws, Pure >, dart::TemplateInstruction< 0, NoThrow >, dart::TemplateInstruction< 1, NoThrow >, dart::TemplateInstruction< 2, NoThrow, Pure >, dart::TemplateInstruction< 1, NoThrow, Pure >, dart::TemplateInstruction< 0, NoThrow, Pure >, dart::TemplateInstruction< 5, NoThrow >, dart::TemplateInstruction< 2, Throws >, dart::TemplateInstruction< 2, NoThrow >, dart::TemplateInstruction< 3, NoThrow >, dart::TemplateInstruction< 1, Throws, Pure >, dart::TemplateInstruction< 1, Throws >, dart::TemplateDefinition< N, ThrowsTrait, CSETrait >, dart::TemplateDefinition< 4, Throws, Pure >, dart::TemplateDefinition< 1, Throws, Pure >, dart::TemplateDefinition< 2, NoThrow, Pure >, dart::TemplateDefinition< 1, NoThrow, Pure >, dart::TemplateDefinition< 1, NoThrow >, dart::TemplateDefinition< 4, NoThrow, Pure >, dart::TemplateDefinition< 3, NoThrow >, dart::TemplateDefinition< 1, Throws >, dart::TemplateDefinition< 0, NoThrow, Pure >, dart::TemplateDefinition< 3, Throws >, dart::TemplateDefinition< 2, Throws >, dart::TemplateDefinition< 2, NoThrow >, dart::TemplateDefinition< N, Throws >, dart::TemplateDefinition< 0, NoThrow >, dart::TemplateDefinition< 5, NoThrow >, dart::PhiInstr, dart::ReturnBaseInstr, dart::TemplateComparison< N, ThrowsTrait, CSETrait >, dart::TemplateComparison< 1, NoThrow, Pure >, dart::TemplateComparison< 2, NoThrow, Pure >, dart::BranchInstr, dart::TemplateDartCall< kExtraInputs >, dart::TemplateDartCall< 0 >, dart::TemplateDartCall< 1 >, dart::IfThenElseInstr, dart::DropTempsInstr, dart::MakeTempInstr, dart::FfiCallInstr, dart::LeafRuntimeCallInstr, dart::TemplateLoadField< N >, dart::TemplateLoadField< 1 >, dart::TemplateLoadField< 0 >, dart::AllocationInstr, dart::MaterializeObjectInstr, dart::BinaryInt64OpInstr, dart::ShiftInt64OpInstr, dart::ShiftUint32OpInstr, dart::InvokeMathCFunctionInstr, dart::GenericCheckBoundInstr, dart::CheckConditionInstr, and dart::SimdOpInstr.

◆ NeedsEnvironment()

bool dart::Instruction::NeedsEnvironment ( ) const
inline

Definition at line 1338 of file il.h.

◆ next()

Instruction * dart::Instruction::next ( ) const
inline

Definition at line 1093 of file il.h.

1093{ return next_; }

◆ NumberOfInputsConsumedBeforeCall()

virtual intptr_t dart::Instruction::NumberOfInputsConsumedBeforeCall ( ) const
inlinevirtual

◆ previous()

Instruction * dart::Instruction::previous ( ) const
inline

Definition at line 1087 of file il.h.

1087{ return previous_; }

◆ RawSetInputAt()

virtual void dart::Instruction::RawSetInputAt ( intptr_t  i,
Value value 
)
privatepure virtual

Implemented in dart::TemplateInstruction< N, ThrowsTrait, CSETrait >, dart::TemplateInstruction< 5, Throws, Pure >, dart::TemplateInstruction< 0, NoThrow >, dart::TemplateInstruction< 1, NoThrow >, dart::TemplateInstruction< 2, NoThrow, Pure >, dart::TemplateInstruction< 1, NoThrow, Pure >, dart::TemplateInstruction< 0, NoThrow, Pure >, dart::TemplateInstruction< 5, NoThrow >, dart::TemplateInstruction< 2, Throws >, dart::TemplateInstruction< 2, NoThrow >, dart::TemplateInstruction< 3, NoThrow >, dart::TemplateInstruction< 1, Throws, Pure >, dart::TemplateInstruction< 1, Throws >, dart::TemplateDefinition< N, ThrowsTrait, CSETrait >, dart::TemplateDefinition< 4, Throws, Pure >, dart::TemplateDefinition< 1, Throws, Pure >, dart::TemplateDefinition< 2, NoThrow, Pure >, dart::TemplateDefinition< 1, NoThrow, Pure >, dart::TemplateDefinition< 1, NoThrow >, dart::TemplateDefinition< 4, NoThrow, Pure >, dart::TemplateDefinition< 3, NoThrow >, dart::TemplateDefinition< 1, Throws >, dart::TemplateDefinition< 0, NoThrow, Pure >, dart::TemplateDefinition< 3, Throws >, dart::TemplateDefinition< 2, Throws >, dart::TemplateDefinition< 2, NoThrow >, dart::TemplateDefinition< N, Throws >, dart::TemplateDefinition< 0, NoThrow >, dart::TemplateDefinition< 5, NoThrow >, dart::DartReturnInstr, dart::NativeReturnInstr, dart::TemplateComparison< N, ThrowsTrait, CSETrait >, dart::TemplateComparison< 1, NoThrow, Pure >, dart::TemplateComparison< 2, NoThrow, Pure >, dart::BranchInstr, dart::TemplateAllocation< N >, dart::TemplateAllocation< 3 >, dart::TemplateAllocation< 0 >, dart::TemplateArrayAllocation< N >, dart::TemplateArrayAllocation< 1 >, dart::TemplateArrayAllocation< 2 >, and dart::SimdOpInstr.

◆ ReadExtraWithoutInputs()

void dart::Instruction::ReadExtraWithoutInputs ( FlowGraphDeserializer d)
protected

Definition at line 1117 of file il_serializer.cc.

1117 {
1118 Environment* env = d->Read<Environment*>();
1120 locs_ = d->Read<LocationSummary*>();
1121}
void SetEnvironment(Environment *deopt_env)
Definition: il.cc:1272
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
Definition: __init__.py:1

◆ RegisterKindForResult()

Location::Kind dart::Instruction::RegisterKindForResult ( ) const
inline

Definition at line 1384 of file il.h.

1384 {
1385 const Representation rep = representation();
1386 if ((rep == kUnboxedFloat) || (rep == kUnboxedDouble) ||
1387 (rep == kUnboxedFloat32x4) || (rep == kUnboxedInt32x4) ||
1388 (rep == kUnboxedFloat64x2)) {
1390 }
1391 return Location::kRegister;
1392 }
virtual Representation representation() const
Definition: il.h:1260

◆ RemoveEnvironment()

void dart::Instruction::RemoveEnvironment ( )

Definition at line 1282 of file il.cc.

1282 {
1283 for (Environment::DeepIterator it(env()); !it.Done(); it.Advance()) {
1284 it.CurrentValue()->RemoveFromUseList();
1285 }
1286 env_ = nullptr;
1287}

◆ RemoveFromGraph()

Instruction * dart::Instruction::RemoveFromGraph ( bool  return_previous = true)

Definition at line 1301 of file il.cc.

1301 {
1302 ASSERT(!IsBlockEntry());
1303 ASSERT(!IsBranch());
1304 ASSERT(!IsThrow());
1305 ASSERT(!IsReturnBase());
1306 ASSERT(!IsReThrow());
1307 ASSERT(!IsGoto());
1308 ASSERT(previous() != nullptr);
1309 // We cannot assert that the instruction, if it is a definition, has no
1310 // uses. This function is used to remove instructions from the graph and
1311 // reinsert them elsewhere (e.g., hoisting).
1312 Instruction* prev_instr = previous();
1313 Instruction* next_instr = next();
1314 ASSERT(next_instr != nullptr);
1315 ASSERT(!next_instr->IsBlockEntry());
1316 prev_instr->LinkTo(next_instr);
1318 // Reset the successor and previous instruction to indicate that the
1319 // instruction is removed from the graph.
1320 set_previous(nullptr);
1321 set_next(nullptr);
1322 return return_previous ? prev_instr : next_instr;
1323}
void UnuseAllInputs()
Definition: il.cc:1534

◆ RepairArgumentUsesInEnvironment()

void dart::Instruction::RepairArgumentUsesInEnvironment ( ) const

Definition at line 1543 of file il.cc.

1543 {
1544 // Some calls (e.g. closure calls) have more inputs than actual arguments.
1545 // Those extra inputs will be consumed from the stack before the call.
1546 const intptr_t after_args_input_count = env()->LazyDeoptPruneCount();
1547 MoveArgumentsArray* move_arguments = GetMoveArguments();
1548 ASSERT(move_arguments != nullptr);
1549 const intptr_t arg_count = ArgumentCount();
1550 ASSERT((arg_count + after_args_input_count) <= env()->Length());
1551 const intptr_t env_base =
1552 env()->Length() - arg_count - after_args_input_count;
1553 for (intptr_t i = 0; i < arg_count; ++i) {
1554 env()->ValueAt(env_base + i)->BindToEnvironment(move_arguments->At(i));
1555 }
1556}
intptr_t Length() const
Definition: il.h:11712
intptr_t LazyDeoptPruneCount() const
Definition: il.h:11670
Value * ValueAt(intptr_t ix) const
Definition: il.h:11708
virtual intptr_t ArgumentCount() const
Definition: il.h:1041
void BindToEnvironment(Definition *definition)
Definition: il.h:2724

◆ ReplaceInEnvironment()

void dart::Instruction::ReplaceInEnvironment ( Definition current,
Definition replacement 
)

Definition at line 1289 of file il.cc.

1290 {
1291 for (Environment::DeepIterator it(env()); !it.Done(); it.Advance()) {
1292 Value* use = it.CurrentValue();
1293 if (use->definition() == current) {
1294 use->RemoveFromUseList();
1295 use->set_definition(replacement);
1296 replacement->AddEnvUse(use);
1297 }
1298 }
1299}

◆ ReplaceInputsWithMoveArguments()

virtual void dart::Instruction::ReplaceInputsWithMoveArguments ( MoveArgumentsArray move_arguments)
inlinevirtual

Reimplemented in dart::TemplateDartCall< kExtraInputs >, dart::TemplateDartCall< 0 >, and dart::TemplateDartCall< 1 >.

Definition at line 1055 of file il.h.

1056 {
1057 UNREACHABLE();
1058 }

◆ representation()

virtual Representation dart::Instruction::representation ( ) const
inlinevirtual

◆ RequiredInputRepresentation()

virtual Representation dart::Instruction::RequiredInputRepresentation ( intptr_t  idx) const
inlinevirtual

Reimplemented in dart::PhiInstr, dart::BranchInstr, dart::IfThenElseInstr, dart::NativeReturnInstr, dart::IndirectGotoInstr, dart::ReachabilityFenceInstr, dart::InstanceCallBaseInstr, dart::DispatchTableCallInstr, dart::TestIntInstr, dart::TestCidsInstr, dart::TestRangeInstr, dart::EqualityCompareInstr, dart::RelationalOpInstr, dart::StaticCallInstr, dart::CachableIdempotentCallInstr, dart::FfiCallInstr, dart::LeafRuntimeCallInstr, dart::LoadIndexedInstr, dart::LoadCodeUnitsInstr, dart::Utf8ScanInstr, dart::StoreIndexedInstr, dart::BoolToIntInstr, dart::IntToBoolInstr, dart::MaterializeObjectInstr, dart::LoadUntaggedInstr, dart::CalculateElementAddressInstr, dart::LoadFieldInstr, dart::BoxInstr, dart::MathMinMaxInstr, dart::BinaryDoubleOpInstr, dart::DoubleTestOpInstr, dart::HashDoubleOpInstr, dart::HashIntegerOpInstr, dart::UnaryUint32OpInstr, dart::UnaryInt64OpInstr, dart::BinaryInt32OpInstr, dart::BinaryUint32OpInstr, dart::BinaryInt64OpInstr, dart::ShiftInt64OpInstr, dart::SpeculativeShiftInt64OpInstr, dart::ShiftUint32OpInstr, dart::SpeculativeShiftUint32OpInstr, dart::UnaryDoubleOpInstr, dart::DoubleToIntegerInstr, dart::DoubleToSmiInstr, dart::DoubleToFloatInstr, dart::FloatToDoubleInstr, dart::FloatCompareInstr, dart::InvokeMathCFunctionInstr, dart::ExtractNthOutputInstr, dart::MakePairInstr, dart::UnboxLaneInstr, dart::BoxLanesInstr, dart::TruncDivModInstr, dart::GenericCheckBoundInstr, dart::IntConverterInstr, dart::BitCastInstr, dart::LoadThreadInstr, dart::SimdOpInstr, dart::ParameterInstr, dart::StoreIndexedUnsafeInstr, dart::LoadIndexedUnsafeInstr, dart::MemoryCopyInstr, dart::MoveArgumentInstr, dart::DartReturnInstr, dart::StoreFieldInstr, dart::Int32ToDoubleInstr, and dart::Int64ToDoubleInstr.

Definition at line 1241 of file il.h.

1241 {
1242 return kTagged;
1243 }

◆ set_inlining_id()

virtual void dart::Instruction::set_inlining_id ( intptr_t  value)
inlinevirtual

Reimplemented in dart::BranchInstr.

Definition at line 1312 of file il.h.

1312 {
1313 ASSERT(value >= 0);
1314 ASSERT(!has_inlining_id() || inlining_id_ == value);
1315 inlining_id_ = value;
1316 }
virtual bool has_inlining_id() const
Definition: il.h:1317

◆ set_next()

void dart::Instruction::set_next ( Instruction instr)
inline

Definition at line 1094 of file il.h.

1094 {
1095 ASSERT(!IsGraphEntry());
1096 ASSERT(!IsReturnBase());
1097 ASSERT(!IsBranch() || (instr == nullptr));
1098 ASSERT(!IsPhi());
1099 ASSERT(instr == nullptr || !instr->IsBlockEntry());
1100 // TODO(fschneider): Also add Throw and ReThrow to the list of instructions
1101 // that do not have a successor. Currently, the graph builder will continue
1102 // to append instruction in case of a Throw inside an expression. This
1103 // condition should be handled in the graph builder
1104 next_ = instr;
1105 }

◆ set_previous()

void dart::Instruction::set_previous ( Instruction instr)
inline

Definition at line 1088 of file il.h.

1088 {
1089 ASSERT(!IsBlockEntry());
1090 previous_ = instr;
1091 }

◆ SetEnvironment()

void dart::Instruction::SetEnvironment ( Environment deopt_env)

Definition at line 1272 of file il.cc.

1272 {
1273 intptr_t use_index = 0;
1274 for (Environment::DeepIterator it(deopt_env); !it.Done(); it.Advance()) {
1275 Value* use = it.CurrentValue();
1276 use->set_instruction(this);
1277 use->set_use_index(use_index++);
1278 }
1279 env_ = deopt_env;
1280}

◆ SetInputAt()

void dart::Instruction::SetInputAt ( intptr_t  i,
Value value 
)
inline

Definition at line 1014 of file il.h.

1014 {
1015 ASSERT(value != nullptr);
1016 value->set_instruction(this);
1017 value->set_use_index(i);
1019 }
virtual void RawSetInputAt(intptr_t i, Value *value)=0

◆ SetMoveArguments()

virtual void dart::Instruction::SetMoveArguments ( MoveArgumentsArray move_arguments)
inlinevirtual

◆ SetPassSpecificId()

void dart::Instruction::SetPassSpecificId ( CompilerPass::Id  pass,
intptr_t  id 
)
inline

Definition at line 1229 of file il.h.

1229 {
1230 pass_specific_id_ = PassSpecificId::Encode(pass, id);
1231 }
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)

◆ SlowPathSharingSupported()

static bool dart::Instruction::SlowPathSharingSupported ( bool  is_optimizing)
inlinestatic

Definition at line 1368 of file il.h.

1368 {
1369#if defined(TARGET_ARCH_IA32)
1370 return false;
1371#else
1372 return FLAG_enable_slow_path_sharing && FLAG_precompiled_mode &&
1373 is_optimizing;
1374#endif
1375 }

◆ source()

InstructionSource dart::Instruction::source ( ) const
inline

Definition at line 1008 of file il.h.

1008 {
1009 return InstructionSource(token_pos(), inlining_id());
1010 }
virtual TokenPosition token_pos() const
Definition: il.h:1005
virtual intptr_t inlining_id() const
Definition: il.h:1311

◆ SpeculativeModeOfInput()

virtual SpeculativeMode dart::Instruction::SpeculativeModeOfInput ( intptr_t  index) const
inlinevirtual

◆ SpeculativeModeOfInputs()

SpeculativeMode dart::Instruction::SpeculativeModeOfInputs ( ) const
inline

Definition at line 1245 of file il.h.

1245 {
1246 for (intptr_t i = 0; i < InputCount(); i++) {
1248 return kGuardInputs;
1249 }
1250 }
1251 return kNotSpeculative;
1252 }
virtual SpeculativeMode SpeculativeModeOfInput(intptr_t index) const
Definition: il.h:1255

◆ statistics_tag()

virtual intptr_t dart::Instruction::statistics_tag ( ) const
inlinevirtual

Reimplemented in dart::AssertAssignableInstr.

Definition at line 991 of file il.h.

991{ return tag(); }

◆ SuccessorAt()

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

Reimplemented in dart::GraphEntryInstr, dart::GotoInstr, dart::IndirectGotoInstr, and dart::BranchInstr.

Definition at line 1981 of file il.cc.

1981 {
1982 // Called only if index is in range. Only control-transfer instructions
1983 // can have non-zero successor counts and they override this function.
1984 UNREACHABLE();
1985 return nullptr;
1986}

◆ SuccessorCount()

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

Reimplemented in dart::GraphEntryInstr, dart::GotoInstr, dart::IndirectGotoInstr, and dart::BranchInstr.

Definition at line 1977 of file il.cc.

1977 {
1978 return 0;
1979}

◆ successors()

SuccessorsIterable dart::Instruction::successors ( ) const
inline

Definition at line 1138 of file il.h.

1138 {
1139 return SuccessorsIterable(this);
1140 }
InstructionIndexedPropertyIterable< SuccessorsTrait > SuccessorsIterable
Definition: il.h:1136

◆ tag()

virtual Tag dart::Instruction::tag ( ) const
pure virtual

◆ ToCString()

const char * dart::Instruction::ToCString ( ) const

Definition at line 1683 of file il_printer.cc.

1683 {
1684 return DebugName();
1685}
virtual const char * DebugName() const =0

◆ token_pos()

virtual TokenPosition dart::Instruction::token_pos ( ) const
inlinevirtual

◆ Unsupported()

void dart::Instruction::Unsupported ( FlowGraphCompiler compiler)

Definition at line 628 of file il.cc.

628 {
629 compiler->Bailout(ToCString());
630 UNREACHABLE();
631}
const char * ToCString() const
Definition: il_printer.cc:1683

◆ UnuseAllInputs()

void dart::Instruction::UnuseAllInputs ( )

Definition at line 1534 of file il.cc.

1534 {
1535 for (intptr_t i = InputCount() - 1; i >= 0; --i) {
1537 }
1538 for (Environment::DeepIterator it(env()); !it.Done(); it.Advance()) {
1539 it.CurrentValue()->RemoveFromUseList();
1540 }
1541}
void RemoveFromUseList()
Definition: il.cc:1457

◆ UseSharedSlowPathStub()

virtual bool dart::Instruction::UseSharedSlowPathStub ( bool  is_optimizing) const
inlinevirtual

◆ WasEliminated()

bool dart::Instruction::WasEliminated ( ) const
inline

Definition at line 1262 of file il.h.

1262{ return next() == nullptr; }

◆ WriteExtraWithoutInputs()

void dart::Instruction::WriteExtraWithoutInputs ( FlowGraphSerializer s)
protected

Definition at line 1112 of file il_serializer.cc.

1112 {
1113 s->Write<Environment*>(env_);
1114 s->Write<LocationSummary*>(locs_);
1115}
struct MyStruct s

Friends And Related Function Documentation

◆ BlockEntryInstr

friend class BlockEntryInstr
friend

Definition at line 1403 of file il.h.

◆ BranchInstr

friend class BranchInstr
friend

Definition at line 1422 of file il.h.

◆ CallSiteInliner

friend class CallSiteInliner
friend

Definition at line 1399 of file il.h.

◆ CatchBlockEntryInstr

friend class CatchBlockEntryInstr
friend

Definition at line 1404 of file il.h.

◆ CheckConditionInstr

friend class CheckConditionInstr
friend

Definition at line 1424 of file il.h.

◆ ComparisonInstr

friend class ComparisonInstr
friend

Definition at line 1401 of file il.h.

◆ DebugStepCheckInstr

friend class DebugStepCheckInstr
friend

Definition at line 1405 of file il.h.

◆ IfThenElseInstr

friend class IfThenElseInstr
friend

Definition at line 1423 of file il.h.

◆ LICM

friend class LICM
friend

Definition at line 1400 of file il.h.

◆ Scheduler

friend class Scheduler
friend

Definition at line 1402 of file il.h.

◆ StrictCompareInstr

friend class StrictCompareInstr
friend

Definition at line 1406 of file il.h.

Member Data Documentation

◆ kInstructionAttrs

const intptr_t dart::Instruction::kInstructionAttrs
static
Initial value:
= {
#define INSTR_ATTRS(type, attrs)
}

Definition at line 968 of file il.h.


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