Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::AllocationInstr Class Referenceabstract

#include <il.h>

Inheritance diagram for dart::AllocationInstr:
dart::Definition dart::Instruction dart::ZoneAllocated dart::TemplateAllocation< 3 > dart::TemplateAllocation< 0 > dart::AllocateObjectInstr dart::ArrayAllocationInstr dart::TemplateAllocation< N > dart::AllocateClosureInstr dart::AllocateSmallRecordInstr dart::AllocateContextInstr dart::AllocateRecordInstr dart::AllocateUninitializedContextInstr dart::TemplateArrayAllocation< 1 > dart::TemplateArrayAllocation< 2 > dart::TemplateArrayAllocation< N >

Public Member Functions

 AllocationInstr (const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
virtual TokenPosition token_pos () const
 
virtual AliasIdentity Identity () const
 
virtual void SetIdentity (AliasIdentity identity)
 
virtual bool WillAllocateNewOrRemembered () const =0
 
virtual bool MayThrow () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool ComputeCanDeoptimizeAfterCall () const
 
virtual intptr_t NumberOfInputsConsumedBeforeCall () const
 
virtual const SlotSlotForInput (intptr_t pos)
 
intptr_t InputForSlot (const Slot &slot)
 
virtual bool ObjectIsInitialized ()
 
PRINT_OPERANDS_TO_SUPPORT DECLARE_ABSTRACT_INSTRUCTION (Allocation)
 
- Public Member Functions inherited from dart::Definition
 Definition (intptr_t deopt_id=DeoptId::kNone)
 
 Definition (const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
virtual intptr_t CallCount () const
 
intptr_t temp_index () const
 
void set_temp_index (intptr_t index)
 
void ClearTempIndex ()
 
bool HasTemp () const
 
intptr_t ssa_temp_index () const
 
void set_ssa_temp_index (intptr_t index)
 
bool HasSSATemp () const
 
void ClearSSATempIndex ()
 
intptr_t vreg (intptr_t index) const
 
intptr_t location_count () const
 
bool HasPairRepresentation () const
 
CompileTypeType ()
 
bool HasType () const
 
bool IsInt64Definition ()
 
bool IsInt32Definition ()
 
virtual CompileType ComputeType () const
 
virtual bool RecomputeType ()
 
PRINT_OPERANDS_TO_SUPPORT PRINT_TO_SUPPORT bool UpdateType (CompileType new_type)
 
bool HasUses () const
 
bool HasOnlyUse (Value *use) const
 
bool HasOnlyInputUse (Value *use) const
 
Valueinput_use_list () const
 
void set_input_use_list (Value *head)
 
Valueenv_use_list () const
 
void set_env_use_list (Value *head)
 
ValueListIterable input_uses () const
 
void AddInputUse (Value *value)
 
void AddEnvUse (Value *value)
 
virtual bool MayCreateUnsafeUntaggedPointer () const
 
virtual bool CanReplaceWithConstant () const
 
virtual bool CanEliminate (const BlockEntryInstr *block) const
 
void ReplaceUsesWith (Definition *other)
 
void ReplaceWithResult (Instruction *replacement, Definition *replacement_for_uses, ForwardInstructionIterator *iterator)
 
void ReplaceWith (Definition *other, ForwardInstructionIterator *iterator)
 
Objectconstant_value ()
 
virtual void InferRange (RangeAnalysis *analysis, Range *range)
 
Rangerange () const
 
void set_range (const Range &)
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
DefinitionReplacement ()
 
void SetReplacement (Definition *other)
 
virtual AliasIdentity Identity () const
 
virtual void SetIdentity (AliasIdentity identity)
 
DefinitionOriginalDefinition ()
 
virtual ValueRedefinedValue () const
 
DefinitionOriginalDefinitionIgnoreBoxingAndConstraints ()
 
virtual DefinitionAsDefinition ()
 
virtual const DefinitionAsDefinition () 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::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::Definition
static bool IsArrayLength (Definition *def)
 
- 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::Definition
static constexpr intptr_t kReplacementMarker = -2
 
- Static Public Attributes inherited from dart::Instruction
static const intptr_t kInstructionAttrs [kNumInstructions]
 
- Protected Member Functions inherited from dart::Definition
void set_type (CompileType *type)
 
- 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::Definition
Rangerange_ = nullptr
 

Detailed Description

Definition at line 7312 of file il.h.

Constructor & Destructor Documentation

◆ AllocationInstr()

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

Definition at line 7314 of file il.h.

7317 token_pos_(source.token_pos),
7318 identity_(AliasIdentity::Unknown()) {}
static AliasIdentity Unknown()
Definition: il.h:2417
Definition(intptr_t deopt_id=DeoptId::kNone)
Definition: il.h:2488
InstructionSource source() const
Definition: il.h:1008
intptr_t deopt_id() const
Definition: il.h:993
const TokenPosition token_pos

Member Function Documentation

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Reimplemented in dart::AllocateContextInstr.

Definition at line 7333 of file il.h.

7333{ return false; }

◆ ComputeCanDeoptimizeAfterCall()

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

Reimplemented from dart::Instruction.

Definition at line 7334 of file il.h.

7334 {
7335 // We test that allocation instructions have correct deopt environment
7336 // (which is needed in case OOM is thrown) by actually deoptimizing
7337 // optimized code in allocation slow paths.
7338 return !CompilerState::Current().is_aot();
7339 }
bool is_aot() const
static CompilerState & Current()

◆ DECLARE_ABSTRACT_INSTRUCTION()

PRINT_OPERANDS_TO_SUPPORT dart::AllocationInstr::DECLARE_ABSTRACT_INSTRUCTION ( Allocation  )

◆ Identity()

virtual AliasIdentity dart::AllocationInstr::Identity ( ) const
inlinevirtual

Reimplemented from dart::Definition.

Definition at line 7322 of file il.h.

7322{ return identity_; }

◆ InputForSlot()

intptr_t dart::AllocationInstr::InputForSlot ( const Slot slot)
inline

Definition at line 7351 of file il.h.

7351 {
7352 for (intptr_t i = 0; i < InputCount(); i++) {
7353 auto* const input_slot = SlotForInput(i);
7354 if (input_slot != nullptr && input_slot->IsIdentical(slot)) {
7355 return i;
7356 }
7357 }
7358 return -1;
7359 }
virtual const Slot * SlotForInput(intptr_t pos)
Definition: il.h:7347
virtual intptr_t InputCount() const =0

◆ MayThrow()

virtual bool dart::AllocationInstr::MayThrow ( ) const
inlinevirtual

Implements dart::Instruction.

Definition at line 7329 of file il.h.

7329 {
7330 // Any allocation instruction may throw an OutOfMemory error.
7331 return true;
7332 }

◆ NumberOfInputsConsumedBeforeCall()

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

Reimplemented from dart::Instruction.

Definition at line 7340 of file il.h.

7340 {
7341 return InputCount();
7342 }

◆ ObjectIsInitialized()

virtual bool dart::AllocationInstr::ObjectIsInitialized ( )
inlinevirtual

Reimplemented in dart::AllocateUninitializedContextInstr.

Definition at line 7363 of file il.h.

7363{ return true; }

◆ SetIdentity()

virtual void dart::AllocationInstr::SetIdentity ( AliasIdentity  identity)
inlinevirtual

Reimplemented from dart::Definition.

Definition at line 7323 of file il.h.

7323{ identity_ = identity; }

◆ SlotForInput()

virtual const Slot * dart::AllocationInstr::SlotForInput ( intptr_t  pos)
inlinevirtual

◆ token_pos()

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

Reimplemented from dart::Instruction.

Definition at line 7320 of file il.h.

7320{ return token_pos_; }

◆ WillAllocateNewOrRemembered()

virtual bool dart::AllocationInstr::WillAllocateNewOrRemembered ( ) const
pure virtual

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