Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
dart::AllocateClosureInstr Class Reference

#include <il.h>

Inheritance diagram for dart::AllocateClosureInstr:
dart::TemplateAllocation< 3 > dart::AllocationInstr dart::Definition dart::Instruction dart::ZoneAllocated

Public Types

enum  Inputs { kFunctionPos = 0 , kContextPos = 1 , kInstantiatorTypeArgsPos = 2 }
 
- 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 >
 

Public Member Functions

 AllocateClosureInstr (const InstructionSource &source, Value *closure_function, Value *context, Value *instantiator_type_args, bool is_generic, bool is_tear_off, intptr_t deopt_id)
 
virtual CompileType ComputeType () const
 
virtual intptr_t InputCount () const
 
Valueclosure_function () const
 
Valuecontext () const
 
bool has_instantiator_type_args () const
 
bool is_generic () const
 
bool is_tear_off () const
 
const Functionknown_function () const
 
virtual const SlotSlotForInput (intptr_t pos)
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
virtual bool AllowsCSE () const
 
virtual bool HasUnknownSideEffects () const
 
virtual bool AttributesEqual (const Instruction &other) const
 
virtual bool WillAllocateNewOrRemembered () const
 
- Public Member Functions inherited from dart::TemplateAllocation< 3 >
 TemplateAllocation (const InstructionSource &source, intptr_t deopt_id)
 
virtual ValueInputAt (intptr_t i) const
 
virtual bool MayHaveVisibleEffect () const
 
- Public Member Functions inherited from dart::AllocationInstr
 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 MayThrow () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool ComputeCanDeoptimizeAfterCall () const
 
virtual intptr_t NumberOfInputsConsumedBeforeCall () const
 
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 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 &)
 
DefinitionReplacement ()
 
void SetReplacement (Definition *other)
 
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
 
InstructionSource source () const
 
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
 
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)
 
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
 
void InsertBefore (Instruction *next)
 
void InsertAfter (Instruction *prev)
 
InstructionAppendInstruction (Instruction *tail)
 
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
 
void InheritDeoptTarget (Zone *zone, Instruction *other)
 
bool NeedsEnvironment () const
 
virtual bool CanBecomeDeoptimizationTarget () const
 
void InheritDeoptTargetAfter (FlowGraph *flow_graph, Definition *call, Definition *result)
 
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

- 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::TemplateAllocation< 3 >
EmbeddedArray< Value *, Ninputs_
 
- Protected Attributes inherited from dart::Definition
Rangerange_ = nullptr
 

Detailed Description

Definition at line 7449 of file il.h.

Member Enumeration Documentation

◆ Inputs

Enumerator
kFunctionPos 
kContextPos 
kInstantiatorTypeArgsPos 

Definition at line 7451 of file il.h.

7451 {
7452 kFunctionPos = 0,
7453 kContextPos = 1,
7455 };

Constructor & Destructor Documentation

◆ AllocateClosureInstr()

dart::AllocateClosureInstr::AllocateClosureInstr ( const InstructionSource source,
Value closure_function,
Value context,
Value instantiator_type_args,
bool  is_generic,
bool  is_tear_off,
intptr_t  deopt_id 
)
inline

Definition at line 7456 of file il.h.

7464 has_instantiator_type_args_(instantiator_type_args != nullptr),
7465 is_generic_(is_generic),
7466 is_tear_off_(is_tear_off) {
7469 if (has_instantiator_type_args_) {
7470 SetInputAt(kInstantiatorTypeArgsPos, instantiator_type_args);
7471 }
7472 }
bool is_generic() const
Definition il.h:7487
Value * context() const
Definition il.h:7482
Value * closure_function() const
Definition il.h:7481
bool is_tear_off() const
Definition il.h:7488
void SetInputAt(intptr_t i, Value *value)
Definition il.h:1008
intptr_t deopt_id() const
Definition il.h:987
TemplateAllocation(const InstructionSource &source, intptr_t deopt_id)
Definition il.h:7346
SkBitmap source
Definition examples.cpp:28

Member Function Documentation

◆ AllowsCSE()

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

Reimplemented from dart::Instruction.

Definition at line 7516 of file il.h.

7516{ return is_tear_off(); }

◆ AttributesEqual()

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

Reimplemented from dart::Instruction.

Definition at line 7520 of file il.h.

7520 {
7521 const auto other_ac = other.AsAllocateClosure();
7522 return (other_ac->has_instantiator_type_args() ==
7524 (other_ac->is_generic() == is_generic()) &&
7525 (other_ac->is_tear_off() == is_tear_off());
7526 }
bool has_instantiator_type_args() const
Definition il.h:7484

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Definition at line 952 of file il.cc.

952 {
953 if (!HasUses()) return nullptr;
954 return this;
955}
bool HasUses() const
Definition il.h:2551

◆ closure_function()

Value * dart::AllocateClosureInstr::closure_function ( ) const
inline

Definition at line 7481 of file il.h.

7481{ return inputs_[kFunctionPos]; }
EmbeddedArray< Value *, N > inputs_
Definition il.h:7361

◆ ComputeType()

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

Reimplemented from dart::Definition.

Definition at line 1687 of file type_propagator.cc.

1687 {
1688 const auto& func = known_function();
1689 if (!func.IsNull()) {
1690 const auto& sig = FunctionType::ZoneHandle(func.signature());
1691 return CompileType(CompileType::kCannotBeNull,
1692 CompileType::kCannotBeSentinel, kClosureCid, &sig);
1693 }
1694 return CompileType::FromCid(kClosureCid);
1695}
const Function & known_function() const
Definition il.h:7490
static CompileType FromCid(intptr_t cid)
static constexpr bool kCannotBeSentinel
static constexpr bool kCannotBeNull
static Object & ZoneHandle()
Definition object.h:419

◆ context()

Value * dart::AllocateClosureInstr::context ( ) const
inline

Definition at line 7482 of file il.h.

7482{ return inputs_[kContextPos]; }

◆ has_instantiator_type_args()

bool dart::AllocateClosureInstr::has_instantiator_type_args ( ) const
inline

Definition at line 7484 of file il.h.

7484 {
7485 return has_instantiator_type_args_;
7486 }

◆ HasUnknownSideEffects()

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

Implements dart::Instruction.

Definition at line 7518 of file il.h.

7518{ return false; }

◆ InputCount()

virtual intptr_t dart::AllocateClosureInstr::InputCount ( ) const
inlinevirtual

Reimplemented from dart::TemplateAllocation< 3 >.

Definition at line 7477 of file il.h.

7477 {
7478 return has_instantiator_type_args() ? 3 : 2;
7479 }

◆ is_generic()

bool dart::AllocateClosureInstr::is_generic ( ) const
inline

Definition at line 7487 of file il.h.

7487{ return is_generic_; }

◆ is_tear_off()

bool dart::AllocateClosureInstr::is_tear_off ( ) const
inline

Definition at line 7488 of file il.h.

7488{ return is_tear_off_; }

◆ known_function()

const Function & dart::AllocateClosureInstr::known_function ( ) const
inline

Definition at line 7490 of file il.h.

7490 {
7491 Value* const value = closure_function();
7492 if (value->BindsToConstant()) {
7493 ASSERT(value->BoundConstant().IsFunction());
7494 return Function::Cast(value->BoundConstant());
7495 }
7496 return Object::null_function();
7497 }
#define ASSERT(E)
uint8_t value

◆ SlotForInput()

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

Reimplemented from dart::AllocationInstr.

Definition at line 7499 of file il.h.

7499 {
7500 switch (pos) {
7501 case kFunctionPos:
7502 return &Slot::Closure_function();
7503 case kContextPos:
7504 return &Slot::Closure_context();
7507 ? &Slot::Closure_instantiator_type_arguments()
7508 : nullptr;
7509 default:
7511 }
7512 }
SkPoint pos
virtual const Slot * SlotForInput(intptr_t pos)
Definition il.h:7308

◆ WillAllocateNewOrRemembered()

virtual bool dart::AllocateClosureInstr::WillAllocateNewOrRemembered ( ) const
inlinevirtual

Implements dart::AllocationInstr.

Definition at line 7528 of file il.h.

7528 {
7529 return IsAllocatableInNewSpace(compiler::target::Closure::InstanceSize());
7530 }
bool IsAllocatableInNewSpace(intptr_t size)
Definition spaces.h:57

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