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

#include <il.h>

Inheritance diagram for dart::LoadStaticFieldInstr:
dart::TemplateLoadField< 0 > dart::TemplateDefinition< N, Throws > dart::Instruction dart::ZoneAllocated

Public Member Functions

 LoadStaticFieldInstr (const Field &field, const InstructionSource &source, bool calls_initializer=false, intptr_t deopt_id=DeoptId::kNone)
 
virtual CompileType ComputeType () const
 
const Fieldfield () const
 
virtual bool AllowsCSE () const
 
virtual bool AttributesEqual (const Instruction &other) const
 
- Public Member Functions inherited from dart::TemplateLoadField< 0 >
 TemplateLoadField (const InstructionSource &source, bool calls_initializer=false, intptr_t deopt_id=DeoptId::kNone, const Field *field=nullptr)
 
virtual TokenPosition token_pos () const
 
bool calls_initializer () const
 
void set_calls_initializer (bool value)
 
bool throw_exception_on_initialization () const
 
virtual bool UseSharedSlowPathStub (bool is_optimizing) const
 
virtual intptr_t DeoptimizationTarget () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool ComputeCanDeoptimizeAfterCall () const
 
virtual intptr_t NumberOfInputsConsumedBeforeCall () const
 
virtual bool HasUnknownSideEffects () const
 
virtual bool CanCallDart () const
 
virtual bool CanTriggerGC () const
 
virtual bool MayThrow () const
 
- Public Member Functions inherited from dart::TemplateDefinition< N, Throws >
 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< N, Throws >
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< N, Throws >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 6670 of file il.h.

Constructor & Destructor Documentation

◆ LoadStaticFieldInstr()

dart::LoadStaticFieldInstr::LoadStaticFieldInstr ( const Field field,
const InstructionSource source,
bool  calls_initializer = false,
intptr_t  deopt_id = DeoptId::kNone 
)
inline

Definition at line 6672 of file il.h.

6676 : TemplateLoadField<0>(source, calls_initializer, deopt_id, &field),
6677 field_(field) {}
InstructionSource source() const
Definition: il.h:1008
intptr_t deopt_id() const
Definition: il.h:993
const Field & field() const
Definition: il.h:6683
bool calls_initializer() const
Definition: il.h:6623

Member Function Documentation

◆ AllowsCSE()

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

Reimplemented from dart::Instruction.

Definition at line 6685 of file il.h.

6685 {
6686 // If two loads of a static-final-late field call the initializer and one
6687 // dominates another, we can remove the dominated load with the result of
6688 // the dominating load.
6689 //
6690 // Though if the field is final-late there can be stores into it via
6691 // load/compare-with-sentinel/store. Those loads have
6692 // `!field().has_initializer()` and we won't allow CSE for them.
6693 return field().is_final() &&
6694 (!field().is_late() || field().has_initializer());
6695 }
bool is_final() const
Definition: object.h:4442
bool has_initializer() const
Definition: object.h:4613
bool is_late() const
Definition: object.h:4444

◆ AttributesEqual()

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

Reimplemented from dart::Instruction.

Definition at line 1127 of file il.cc.

1127 {
1128 ASSERT(AllowsCSE());
1129 return field().ptr() == other.AsLoadStaticField()->field().ptr();
1130}
virtual bool AllowsCSE() const
Definition: il.h:6685
ObjectPtr ptr() const
Definition: object.h:332
#define ASSERT(E)

◆ ComputeType()

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

Definition at line 1633 of file type_propagator.cc.

1633 {
1634 const Field& field = this->field();
1635 ASSERT(field.is_static());
1636 bool is_nullable = true;
1637 intptr_t cid = kIllegalCid; // Abstract type is known, calculate cid lazily.
1638
1639 AbstractType* abstract_type = &AbstractType::ZoneHandle(field.type());
1640 TraceStrongModeType(this, *abstract_type);
1641 if (abstract_type->IsStrictlyNonNullable()) {
1642 is_nullable = false;
1643 }
1644
1645 if ((field.guarded_cid() != kIllegalCid) &&
1646 (field.guarded_cid() != kDynamicCid)) {
1647 cid = field.guarded_cid();
1648 if (!field.is_nullable()) {
1649 is_nullable = false;
1650 }
1651 abstract_type = nullptr; // Cid is known, calculate abstract type lazily.
1652 }
1653
1654 if (field.needs_load_guard()) {
1655 // Should be kept in sync with Slot::Get.
1656 DEBUG_ASSERT(IsolateGroup::Current()->HasAttemptedReload());
1657 return CompileType::Dynamic();
1658 }
1659
1660 const bool can_be_sentinel = !calls_initializer() && field.is_late() &&
1662 return CompileType(is_nullable, can_be_sentinel, cid, abstract_type);
1663}
#define DEBUG_ASSERT(cond)
Definition: assert.h:321
static CompileType Dynamic()
bool is_nullable() const
Definition: object.cc:11770
bool needs_load_guard() const
Definition: object.h:4451
intptr_t guarded_cid() const
Definition: object.cc:11749
AbstractTypePtr type() const
Definition: object.h:4550
static IsolateGroup * Current()
Definition: isolate.h:539
static Object & ZoneHandle()
Definition: object.h:419
@ kIllegalCid
Definition: class_id.h:214
@ kDynamicCid
Definition: class_id.h:253
const intptr_t cid
static void TraceStrongModeType(const Instruction *instr, const AbstractType &type)

◆ field()

const Field & dart::LoadStaticFieldInstr::field ( ) const
inline

Definition at line 6683 of file il.h.

6683{ return field_; }

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