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

#include <il.h>

Inheritance diagram for dart::InstanceCallInstr:
dart::InstanceCallBaseInstr dart::TemplateDartCall< 0 > dart::VariadicDefinition dart::Definition dart::Instruction dart::ZoneAllocated

Public Member Functions

 InstanceCallInstr (const InstructionSource &source, const String &function_name, Token::Kind token_kind, InputsArray &&arguments, intptr_t type_args_len, const Array &argument_names, intptr_t checked_argument_count, const ZoneGrowableArray< const ICData * > &ic_data_array, intptr_t deopt_id, const Function &interface_target=Function::null_function(), const Function &tearoff_interface_target=Function::null_function())
 
 InstanceCallInstr (const InstructionSource &source, const String &function_name, Token::Kind token_kind, InputsArray &&arguments, intptr_t type_args_len, const Array &argument_names, intptr_t checked_argument_count, intptr_t deopt_id, const Function &interface_target=Function::null_function(), const Function &tearoff_interface_target=Function::null_function())
 
intptr_t checked_argument_count () const
 
virtual intptr_t CallCount () const
 
void set_receivers_static_type (const AbstractType *receiver_type)
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
PRINT_OPERANDS_TO_SUPPORT bool MatchesCoreName (const String &name)
 
const class BinaryFeedbackBinaryFeedback ()
 
void SetBinaryFeedback (const class BinaryFeedback *binary)
 
const CallTargetsTargets ()
 
void SetTargets (const CallTargets *targets)
 
void EnsureICData (FlowGraph *graph)
 
 DISALLOW_COPY_AND_ASSIGN (InstanceCallInstr)
 
- Public Member Functions inherited from dart::InstanceCallBaseInstr
 InstanceCallBaseInstr (const InstructionSource &source, const String &function_name, Token::Kind token_kind, InputsArray &&arguments, intptr_t type_args_len, const Array &argument_names, const ICData *ic_data, intptr_t deopt_id, const Function &interface_target, const Function &tearoff_interface_target)
 
const ICDataic_data () const
 
bool HasICData () const
 
void set_ic_data (const ICData *value)
 
const Stringfunction_name () const
 
Token::Kind token_kind () const
 
const Functioninterface_target () const
 
const Functiontearoff_interface_target () const
 
bool has_unique_selector () const
 
void set_has_unique_selector (bool b)
 
virtual CompileType ComputeType () const
 
virtual bool CanBecomeDeoptimizationTarget () const
 
virtual bool HasUnknownSideEffects () const
 
void SetResultType (Zone *zone, CompileType new_type)
 
CompileTyperesult_type () const
 
intptr_t result_cid () const
 
FunctionPtr ResolveForReceiverClass (const Class &cls, bool allow_add=true)
 
Code::EntryKind entry_kind () const
 
void set_entry_kind (Code::EntryKind value)
 
void mark_as_call_on_this ()
 
bool is_call_on_this () const
 
 DECLARE_ABSTRACT_INSTRUCTION (InstanceCallBase)
 
bool receiver_is_not_smi () const
 
void set_receiver_is_not_smi (bool value)
 
void UpdateReceiverSminess (Zone *zone)
 
bool CanReceiverBeSmiBasedOnInterfaceTarget (Zone *zone) const
 
virtual SpeculativeMode SpeculativeModeOfInput (intptr_t idx) const
 
virtual intptr_t ArgumentsSize () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
virtual intptr_t DeoptimizationTarget () const
 
virtual Representation representation () const
 
DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(InstanceCallBaseInstr, TemplateDartCall, FIELD_LIST) protected void set_ic_data (ICData *value)
 
void set_result_type (CompileType *result_type)
 
- Public Member Functions inherited from dart::TemplateDartCall< 0 >
 TemplateDartCall (intptr_t deopt_id, intptr_t type_args_len, const Array &argument_names, InputsArray &&inputs, const InstructionSource &source)
 
StringPtr Selector ()
 
virtual bool MayThrow () const
 
virtual bool CanCallDart () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool ComputeCanDeoptimizeAfterCall () const
 
virtual intptr_t NumberOfInputsConsumedBeforeCall () const
 
intptr_t FirstArgIndex () const
 
ValueReceiver () const
 
intptr_t ArgumentCountWithoutTypeArgs () const
 
intptr_t ArgumentsSizeWithoutTypeArgs () const
 
intptr_t ArgumentCount () const
 
virtual intptr_t ArgumentsSize () const
 
virtual void SetMoveArguments (MoveArgumentsArray *move_arguments)
 
virtual MoveArgumentsArrayGetMoveArguments () const
 
virtual void ReplaceInputsWithMoveArguments (MoveArgumentsArray *move_arguments)
 
intptr_t type_args_len () const
 
const Arrayargument_names () const
 
virtual TokenPosition token_pos () const
 
ArrayPtr GetArgumentsDescriptor () const
 
- Public Member Functions inherited from dart::VariadicDefinition
 VariadicDefinition (InputsArray &&inputs, intptr_t deopt_id=DeoptId::kNone)
 
 VariadicDefinition (InputsArray &&inputs, const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
 VariadicDefinition (const intptr_t num_inputs, intptr_t deopt_id=DeoptId::kNone)
 
intptr_t InputCount () const
 
ValueInputAt (intptr_t i) const
 
- 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)
 

Public Attributes

DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(InstanceCallInstr, InstanceCallBaseInstr, FIELD_LIST) private const class BinaryFeedbackbinary_ = nullptr
 

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::VariadicDefinition
InputsArray inputs_
 
- Protected Attributes inherited from dart::Definition
Rangerange_ = nullptr
 

Detailed Description

Definition at line 4824 of file il.h.

Constructor & Destructor Documentation

◆ InstanceCallInstr() [1/2]

dart::InstanceCallInstr::InstanceCallInstr ( const InstructionSource source,
const String function_name,
Token::Kind  token_kind,
InputsArray &&  arguments,
intptr_t  type_args_len,
const Array argument_names,
intptr_t  checked_argument_count,
const ZoneGrowableArray< const ICData * > &  ic_data_array,
intptr_t  deopt_id,
const Function interface_target = Function::null_function(),
const Function tearoff_interface_target = Function::null_function() 
)
inline

Definition at line 4826 of file il.h.

4839 source,
4841 token_kind,
4842 std::move(arguments),
4845 GetICData(ic_data_array, deopt_id, /*is_static_call=*/false),
4846 deopt_id,
4849 checked_argument_count_(checked_argument_count),
4850 receivers_static_type_(nullptr) {}
const Function & tearoff_interface_target() const
Definition: il.h:4727
InstanceCallBaseInstr(const InstructionSource &source, const String &function_name, Token::Kind token_kind, InputsArray &&arguments, intptr_t type_args_len, const Array &argument_names, const ICData *ic_data, intptr_t deopt_id, const Function &interface_target, const Function &tearoff_interface_target)
Definition: il.h:4677
const Function & interface_target() const
Definition: il.h:4726
Token::Kind token_kind() const
Definition: il.h:4725
const String & function_name() const
Definition: il.h:4724
intptr_t checked_argument_count() const
Definition: il.h:4878
static const ICData * GetICData(const ZoneGrowableArray< const ICData * > &ic_data_array, intptr_t deopt_id, bool is_static_call)
Definition: il.cc:595
InstructionSource source() const
Definition: il.h:1008
intptr_t deopt_id() const
Definition: il.h:993
intptr_t type_args_len() const
Definition: il.h:4614
const Array & argument_names() const
Definition: il.h:4615

◆ InstanceCallInstr() [2/2]

dart::InstanceCallInstr::InstanceCallInstr ( const InstructionSource source,
const String function_name,
Token::Kind  token_kind,
InputsArray &&  arguments,
intptr_t  type_args_len,
const Array argument_names,
intptr_t  checked_argument_count,
intptr_t  deopt_id,
const Function interface_target = Function::null_function(),
const Function tearoff_interface_target = Function::null_function() 
)
inline

Definition at line 4852 of file il.h.

4865 token_kind,
4866 std::move(arguments),
4869 /*ic_data=*/nullptr,
4870 deopt_id,
4873 checked_argument_count_(checked_argument_count),
4874 receivers_static_type_(nullptr) {}

Member Function Documentation

◆ BinaryFeedback()

const BinaryFeedback & dart::InstanceCallInstr::BinaryFeedback ( )

Definition at line 5358 of file il.cc.

5358 {
5359 if (binary_ == nullptr) {
5360 Zone* zone = Thread::Current()->zone();
5361 if (HasICData()) {
5363 } else {
5364 binary_ = new (zone) class BinaryFeedback(zone);
5365 }
5366 }
5367 return *binary_;
5368}
static const BinaryFeedback * Create(Zone *zone, const ICData &ic_data)
Definition: il.cc:4094
const ICData * ic_data() const
Definition: il.h:4716
bool HasICData() const
Definition: il.h:4717
DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(InstanceCallInstr, InstanceCallBaseInstr, FIELD_LIST) private const class BinaryFeedback * binary_
Definition: il.h:4916
const class BinaryFeedback & BinaryFeedback()
Definition: il.cc:5358
Zone * zone() const
Definition: thread_state.h:37
static Thread * Current()
Definition: thread.h:362

◆ CallCount()

virtual intptr_t dart::InstanceCallInstr::CallCount ( ) const
inlinevirtual

Reimplemented from dart::Definition.

Definition at line 4880 of file il.h.

4880 {
4881 return ic_data() == nullptr ? 0 : ic_data()->AggregateCount();
4882 }
intptr_t AggregateCount() const
Definition: object.cc:17084

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Definition at line 5608 of file il.cc.

5608 {
5609 const intptr_t receiver_cid = Receiver()->Type()->ToCid();
5610
5611 // We could turn cold call sites for known receiver cids into a StaticCall.
5612 // However, that keeps the ICData of the InstanceCall from being updated.
5613 //
5614 // This is fine if there is no later deoptimization, but if there is, then
5615 // the InstanceCall with the updated ICData for this receiver may then be
5616 // better optimized by the compiler.
5617 //
5618 // This optimization is safe to apply in AOT mode because deoptimization is
5619 // not a concern there.
5620 //
5621 // TODO(dartbug.com/37291): Allow this optimization, but accumulate affected
5622 // InstanceCallInstrs and the corresponding receiver cids during compilation.
5623 // After compilation, add receiver checks to the ICData for those call sites.
5624 if (!CompilerState::Current().is_aot() && Targets().is_empty()) {
5625 return this;
5626 }
5627
5628 const CallTargets* new_target =
5630 receiver_cid,
5631 String::Handle(flow_graph->zone(), ic_data()->target_name()),
5632 Array::Handle(flow_graph->zone(), ic_data()->arguments_descriptor()));
5633 if (new_target == nullptr) {
5634 // No specialization.
5635 return this;
5636 }
5637
5638 ASSERT(new_target->HasSingleTarget());
5639 const Function& target = new_target->FirstTarget();
5640 StaticCallInstr* specialized = StaticCallInstr::FromCall(
5641 flow_graph->zone(), this, target, new_target->AggregateCallCount());
5642 flow_graph->InsertBefore(this, specialized, env(), FlowGraph::kValue);
5643 return specialized;
5644}
static void is_empty(skiatest::Reporter *reporter, const SkPath &p)
static CompilerState & Current()
static const CallTargets * ResolveCallTargetsForReceiverCid(intptr_t cid, const String &selector, const Array &args_desc_array)
const CallTargets & Targets()
Definition: il.cc:5345
Environment * env() const
Definition: il.h:1215
static Object & Handle()
Definition: object.h:407
static StaticCallInstr * FromCall(Zone *zone, const C *call, const Function &target, intptr_t call_count)
Definition: il.h:5584
Value * Receiver() const
Definition: il.h:4577
CompileType * Type()
#define ASSERT(E)
uint32_t * target

◆ checked_argument_count()

intptr_t dart::InstanceCallInstr::checked_argument_count ( ) const
inline

Definition at line 4878 of file il.h.

4878{ return checked_argument_count_; }

◆ DISALLOW_COPY_AND_ASSIGN()

dart::InstanceCallInstr::DISALLOW_COPY_AND_ASSIGN ( InstanceCallInstr  )

◆ EnsureICData()

void dart::InstanceCallInstr::EnsureICData ( FlowGraph graph)

Definition at line 5240 of file il.cc.

5240 {
5241 if (HasICData()) {
5242 return;
5243 }
5244
5245 const Array& arguments_descriptor =
5246 Array::Handle(graph->zone(), GetArgumentsDescriptor());
5247 const ICData& ic_data = ICData::ZoneHandle(
5248 graph->zone(),
5249 ICData::New(graph->function(), function_name(), arguments_descriptor,
5250 deopt_id(), checked_argument_count(), ICData::kInstance));
5252}
void set_ic_data(const ICData *value)
Definition: il.h:4722
static Object & ZoneHandle()
Definition: object.h:419
ArrayPtr GetArgumentsDescriptor() const
Definition: il.h:4617

◆ MatchesCoreName()

bool dart::InstanceCallInstr::MatchesCoreName ( const String name)

Definition at line 5332 of file il.cc.

5332 {
5334}
static bool IsPrivateCoreLibName(const String &name, const String &member)
Definition: object.cc:14680
const char *const name

◆ set_receivers_static_type()

void dart::InstanceCallInstr::set_receivers_static_type ( const AbstractType receiver_type)
inline

Definition at line 4884 of file il.h.

4884 {
4885 ASSERT(receiver_type != nullptr);
4886 receivers_static_type_ = receiver_type;
4887 }

◆ SetBinaryFeedback()

void dart::InstanceCallInstr::SetBinaryFeedback ( const class BinaryFeedback binary)
inline

Definition at line 4896 of file il.h.

◆ SetTargets()

void dart::InstanceCallInstr::SetTargets ( const CallTargets targets)
inline

Definition at line 4901 of file il.h.

4901{ targets_ = targets; }

◆ Targets()

const CallTargets & dart::InstanceCallInstr::Targets ( )

Definition at line 5345 of file il.cc.

5345 {
5346 if (targets_ == nullptr) {
5347 Zone* zone = Thread::Current()->zone();
5348 if (HasICData()) {
5349 targets_ = CallTargets::CreateAndExpand(zone, *ic_data());
5350 } else {
5351 targets_ = new (zone) CallTargets(zone);
5352 ASSERT(targets_->is_empty());
5353 }
5354 }
5355 return *targets_;
5356}
static const CallTargets * CreateAndExpand(Zone *zone, const ICData &ic_data)
Definition: il.cc:4137

Member Data Documentation

◆ binary_

DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS (InstanceCallInstr, InstanceCallBaseInstr, FIELD_LIST) private const class BinaryFeedback* dart::InstanceCallInstr::binary_ = nullptr

Definition at line 4916 of file il.h.


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