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

#include <il.h>

Inheritance diagram for dart::RedefinitionInstr:
dart::TemplateDefinition< 1, NoThrow > dart::Instruction dart::ZoneAllocated

Public Member Functions

 RedefinitionInstr (Value *value, bool inserted_by_constant_propagation=false)
 
Valuevalue () const
 
virtual CompileType ComputeType () const
 
virtual bool RecomputeType ()
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
void set_constrained_type (CompileType *type)
 
CompileTypeconstrained_type () const
 
bool inserted_by_constant_propagation () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool HasUnknownSideEffects () const
 
virtual ValueRedefinedValue () const
 
- Public Member Functions inherited from dart::TemplateDefinition< 1, NoThrow >
 TemplateDefinition (intptr_t deopt_id=DeoptId::kNone)
 
 TemplateDefinition (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)
 

Additional Inherited Members

- Public Types inherited from dart::TemplateDefinition< 1, NoThrow >
using BaseClass = typename NoCSE< Definition, PureDefinition >::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::Instruction
intptr_t GetDeoptId () const
 
virtual void CopyDeoptIdFrom (const Instruction &instr)
 
void WriteExtraWithoutInputs (FlowGraphSerializer *s)
 
void ReadExtraWithoutInputs (FlowGraphDeserializer *d)
 
- Protected Attributes inherited from dart::TemplateDefinition< 1, NoThrow >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 4098 of file il.h.

Constructor & Destructor Documentation

◆ RedefinitionInstr()

dart::RedefinitionInstr::RedefinitionInstr ( Value value,
bool  inserted_by_constant_propagation = false 
)
inlineexplicit

Definition at line 4100 of file il.h.

4102 : constrained_type_(nullptr),
4103 inserted_by_constant_propagation_(inserted_by_constant_propagation) {
4104 SetInputAt(0, value);
4105 }
void SetInputAt(intptr_t i, Value *value)
Definition: il.h:1014
bool inserted_by_constant_propagation() const
Definition: il.h:4119
Value * value() const
Definition: il.h:4109

Member Function Documentation

◆ Canonicalize()

Definition * dart::RedefinitionInstr::Canonicalize ( FlowGraph flow_graph)
virtual

Reimplemented from dart::Instruction.

Definition at line 2637 of file il.cc.

2637 {
2638 // Must not remove Redefinitions without uses until LICM, even though
2639 // Redefinition might not have any uses itself it can still be dominating
2640 // uses of the value it redefines and must serve as a barrier for those
2641 // uses. RenameUsesDominatedByRedefinitions would normalize the graph and
2642 // route those uses through this redefinition.
2643 if (!HasUses() && !flow_graph->is_licm_allowed()) {
2644 return nullptr;
2645 }
2646 if (constrained_type() != nullptr &&
2647 constrained_type()->IsEqualTo(value()->Type())) {
2648 return value()->definition();
2649 }
2650 return this;
2651}
Type
Definition: SortBench.cpp:56
CompileType * constrained_type() const
Definition: il.h:4117
Definition * definition() const
Definition: il.h:103

◆ ComputeCanDeoptimize()

virtual bool dart::RedefinitionInstr::ComputeCanDeoptimize ( ) const
inlinevirtual

Implements dart::Instruction.

Definition at line 4123 of file il.h.

4123{ return false; }

◆ ComputeType()

CompileType dart::RedefinitionInstr::ComputeType ( ) const
virtual

Definition at line 1117 of file type_propagator.cc.

1117 {
1118 if (constrained_type_ != nullptr) {
1119 // Check if the type associated with this redefinition is more specific
1120 // than the type of its input. If yes, return it. Otherwise, fall back
1121 // to the input's type.
1122
1123 // If either type is non-nullable, the resulting type is non-nullable.
1124 const bool is_nullable =
1125 value()->Type()->is_nullable() && constrained_type_->is_nullable();
1126 // The resulting type can be the sentinel value only if both types can be.
1127 const bool can_be_sentinel = value()->Type()->can_be_sentinel() &&
1128 constrained_type_->can_be_sentinel();
1129
1130 // If either type has a concrete cid, stick with it.
1131 if (value()->Type()->ToNullableCid() != kDynamicCid) {
1132 return CompileType(is_nullable, can_be_sentinel,
1133 value()->Type()->ToNullableCid(), nullptr);
1134 }
1135 if (constrained_type_->ToNullableCid() != kDynamicCid) {
1136 return CompileType(is_nullable, can_be_sentinel,
1137 constrained_type_->ToNullableCid(), nullptr);
1138 }
1139
1140 CompileType result(
1141 value()->Type()->IsSubtypeOf(*constrained_type_->ToAbstractType())
1142 ? *value()->Type()
1143 : *constrained_type_);
1144 if (!is_nullable) {
1145 result = result.CopyNonNullable();
1146 }
1147 if (!can_be_sentinel) {
1148 result = result.CopyNonSentinel();
1149 }
1150 return result;
1151 }
1152 return *value()->Type();
1153}
bool can_be_sentinel() const
Definition: compile_type.h:80
bool is_nullable() const
Definition: compile_type.h:76
CompileType * Type()
GAsyncResult * result
@ kDynamicCid
Definition: class_id.h:253

◆ constrained_type()

CompileType * dart::RedefinitionInstr::constrained_type ( ) const
inline

Definition at line 4117 of file il.h.

4117{ return constrained_type_; }

◆ HasUnknownSideEffects()

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

Implements dart::Instruction.

Definition at line 4124 of file il.h.

4124{ return false; }

◆ inserted_by_constant_propagation()

bool dart::RedefinitionInstr::inserted_by_constant_propagation ( ) const
inline

Definition at line 4119 of file il.h.

4119 {
4120 return inserted_by_constant_propagation_;
4121 }

◆ RecomputeType()

bool dart::RedefinitionInstr::RecomputeType ( )
virtual

Definition at line 1155 of file type_propagator.cc.

1155 {
1156 return UpdateType(ComputeType());
1157}
virtual CompileType ComputeType() const

◆ RedefinedValue()

Value * dart::RedefinitionInstr::RedefinedValue ( ) const
virtual

Definition at line 545 of file il.cc.

545 {
546 return value();
547}

◆ set_constrained_type()

void dart::RedefinitionInstr::set_constrained_type ( CompileType type)
inline

Definition at line 4116 of file il.h.

4116{ constrained_type_ = type; }
GLenum type

◆ value()

Value * dart::RedefinitionInstr::value ( ) const
inline

Definition at line 4109 of file il.h.

4109{ return inputs_[0]; }
EmbeddedArray< Value *, N > inputs_
Definition: il.h:2762

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