Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Friends | List of all members
dart::PolymorphicInstanceCallInstr Class Reference

#include <il.h>

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

Public Member Functions

bool complete () const
 
virtual CompileType ComputeType () const
 
bool HasOnlyDispatcherOrImplicitAccessorTargets () const
 
const CallTargetstargets () const
 
intptr_t NumberOfChecks () const
 
bool IsSureToCallSingleRecognizedTarget () const
 
virtual intptr_t CallCount () const
 
intptr_t total_call_count ()
 
void set_total_call_count (intptr_t count)
 
virtual DefinitionCanonicalize (FlowGraph *graph)
 
 DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS (PolymorphicInstanceCallInstr, InstanceCallBaseInstr, FIELD_LIST) private
 
 DISALLOW_COPY_AND_ASSIGN (PolymorphicInstanceCallInstr)
 
- 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)
 

Static Public Member Functions

static PolymorphicInstanceCallInstrFromCall (Zone *zone, InstanceCallBaseInstr *call, const CallTargets &targets, bool complete)
 
static TypePtr ComputeRuntimeType (const CallTargets &targets)
 
- 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)
 

Friends

class PolymorphicInliner
 

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 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 4921 of file il.h.

Member Function Documentation

◆ CallCount()

intptr_t dart::PolymorphicInstanceCallInstr::CallCount ( ) const
virtual

Reimplemented from dart::Definition.

Definition at line 5549 of file il.cc.

5549 {
5550 return targets().AggregateCallCount();
5551}
intptr_t AggregateCallCount() const
Definition: il.cc:5528
const CallTargets & targets() const
Definition: il.h:4953

◆ Canonicalize()

Definition * dart::PolymorphicInstanceCallInstr::Canonicalize ( FlowGraph graph)
virtual

Reimplemented from dart::Definition.

Definition at line 5652 of file il.cc.

5652 {
5654 return this;
5655 }
5656
5657 const Function& target = targets().FirstTarget();
5658 if (target.recognized_kind() == MethodRecognizer::kObjectRuntimeType) {
5659 const AbstractType& type =
5661 if (!type.IsNull()) {
5662 return flow_graph->GetConstant(type);
5663 }
5664 }
5665
5666 return this;
5667}
GLenum type
const Function & FirstTarget() const
Definition: il.cc:5513
static Object & Handle()
Definition: object.h:407
bool IsSureToCallSingleRecognizedTarget() const
Definition: il.cc:5669
static TypePtr ComputeRuntimeType(const CallTargets &targets)
Definition: il.cc:5568
uint32_t * target

◆ complete()

bool dart::PolymorphicInstanceCallInstr::complete ( ) const
inline

Definition at line 4947 of file il.h.

4947{ return complete_; }

◆ ComputeRuntimeType()

TypePtr dart::PolymorphicInstanceCallInstr::ComputeRuntimeType ( const CallTargets targets)
static

Definition at line 5568 of file il.cc.

5569 {
5570 bool is_string = true;
5571 bool is_integer = true;
5572 bool is_double = true;
5573 bool is_type = true;
5574
5575 const intptr_t num_checks = targets.length();
5576 for (intptr_t i = 0; i < num_checks; i++) {
5578 targets.TargetAt(0)->target->ptr());
5579 const intptr_t start = targets[i].cid_start;
5580 const intptr_t end = targets[i].cid_end;
5581 for (intptr_t cid = start; cid <= end; cid++) {
5582 is_string = is_string && IsStringClassId(cid);
5584 is_double = is_double && (cid == kDoubleCid);
5585 is_type = is_type && IsTypeClassId(cid);
5586 }
5587 }
5588
5589 if (is_string) {
5591 ASSERT(!is_double);
5592 ASSERT(!is_type);
5593 return Type::StringType();
5594 } else if (is_integer) {
5595 ASSERT(!is_double);
5596 ASSERT(!is_type);
5597 return Type::IntType();
5598 } else if (is_double) {
5599 ASSERT(!is_type);
5600 return Type::Double();
5601 } else if (is_type) {
5602 return Type::DartTypeType();
5603 }
5604
5605 return Type::null();
5606}
static bool is_integer(SkScalar x)
TargetInfo * TargetAt(int i) const
Definition: il.h:796
intptr_t length() const
Definition: il.h:758
static ObjectPtr null()
Definition: object.h:433
ObjectPtr ptr() const
Definition: object.h:332
static TypePtr IntType()
static TypePtr Double()
static TypePtr StringType()
static TypePtr DartTypeType()
#define ASSERT(E)
glong glong end
bool IsTypeClassId(intptr_t index)
Definition: class_id.h:370
const intptr_t cid
bool IsIntegerClassId(intptr_t index)
Definition: class_id.h:340
bool IsStringClassId(intptr_t index)
Definition: class_id.h:350
const Function * target
Definition: il.h:727

◆ ComputeType()

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

Reimplemented from dart::InstanceCallBaseInstr.

Definition at line 1528 of file type_propagator.cc.

1528 {
1530 const Function& target = *targets_.TargetAt(0)->target;
1531 if (target.has_pragma()) {
1533 if (cid != kDynamicCid) {
1534 return CompileType::FromCid(cid);
1535 }
1536 }
1537 }
1538
1540}
static CompileType FromCid(intptr_t cid)
virtual CompileType ComputeType() const
static intptr_t ResultCidFromPragma(const Object &function_or_field)
@ kDynamicCid
Definition: class_id.h:253

◆ DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS()

dart::PolymorphicInstanceCallInstr::DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS ( PolymorphicInstanceCallInstr  ,
InstanceCallBaseInstr  ,
FIELD_LIST   
)
inline

Definition at line 4984 of file il.h.

4989 :
4990 PolymorphicInstanceCallInstr(const InstructionSource& source,
4991 const String& function_name,
4993 InputsArray&& arguments,
4994 intptr_t type_args_len,
4995 const Array& argument_names,
4996 const ICData* ic_data,
4997 intptr_t deopt_id,
4998 const Function& interface_target,
4999 const Function& tearoff_interface_target,
5000 const CallTargets& targets,
5001 bool complete)
5004 token_kind,
5005 std::move(arguments),
5008 ic_data,
5009 deopt_id,
5012 targets_(targets),
5013 complete_(complete) {
5014 ASSERT(targets.length() != 0);
5015 total_call_count_ = CallCount();
5016 }
const ICData * ic_data() const
Definition: il.h:4716
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
InstructionSource source() const
Definition: il.h:1008
intptr_t deopt_id() const
Definition: il.h:993
virtual intptr_t CallCount() const
Definition: il.cc:5549
intptr_t type_args_len() const
Definition: il.h:4614
const Array & argument_names() const
Definition: il.h:4615
GrowableArray< Value * > InputsArray
Definition: il.h:901
Definition: ref_ptr.h:256

◆ DISALLOW_COPY_AND_ASSIGN()

dart::PolymorphicInstanceCallInstr::DISALLOW_COPY_AND_ASSIGN ( PolymorphicInstanceCallInstr  )

◆ FromCall()

static PolymorphicInstanceCallInstr * dart::PolymorphicInstanceCallInstr::FromCall ( Zone zone,
InstanceCallBaseInstr call,
const CallTargets targets,
bool  complete 
)
inlinestatic

Definition at line 4924 of file il.h.

4927 {
4928 ASSERT(!call->HasMoveArguments());
4929 InputsArray args(zone, call->ArgumentCount());
4930 for (intptr_t i = 0, n = call->ArgumentCount(); i < n; ++i) {
4931 args.Add(call->ArgumentValueAt(i)->CopyWithType(zone));
4932 }
4933 auto new_call = new (zone) PolymorphicInstanceCallInstr(
4934 call->source(), call->function_name(), call->token_kind(),
4935 std::move(args), call->type_args_len(), call->argument_names(),
4936 call->ic_data(), call->deopt_id(), call->interface_target(),
4937 call->tearoff_interface_target(), targets, complete);
4938 new_call->set_result_type(call->result_type());
4939 new_call->set_entry_kind(call->entry_kind());
4940 new_call->set_has_unique_selector(call->has_unique_selector());
4941 if (call->is_call_on_this()) {
4942 new_call->mark_as_call_on_this();
4943 }
4944 return new_call;
4945 }
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
def call(args)
Definition: dom.py:159

◆ HasOnlyDispatcherOrImplicitAccessorTargets()

bool dart::PolymorphicInstanceCallInstr::HasOnlyDispatcherOrImplicitAccessorTargets ( ) const

Definition at line 5536 of file il.cc.

5537 {
5538 const intptr_t len = targets_.length();
5539 Function& target = Function::Handle();
5540 for (intptr_t i = 0; i < len; i++) {
5541 target = targets_.TargetAt(i)->target->ptr();
5542 if (!target.IsDispatcherOrImplicitAccessor()) {
5543 return false;
5544 }
5545 }
5546 return true;
5547}

◆ IsSureToCallSingleRecognizedTarget()

bool dart::PolymorphicInstanceCallInstr::IsSureToCallSingleRecognizedTarget ( ) const

Definition at line 5669 of file il.cc.

5669 {
5670 if (CompilerState::Current().is_aot() && !complete()) return false;
5671 return targets_.HasSingleRecognizedTarget();
5672}
static CompilerState & Current()

◆ NumberOfChecks()

intptr_t dart::PolymorphicInstanceCallInstr::NumberOfChecks ( ) const
inline

Definition at line 4954 of file il.h.

4954{ return targets_.length(); }

◆ set_total_call_count()

void dart::PolymorphicInstanceCallInstr::set_total_call_count ( intptr_t  count)
inline

Definition at line 4969 of file il.h.

4969{ total_call_count_ = count; }
int count
Definition: FontMgrTest.cpp:50

◆ targets()

const CallTargets & dart::PolymorphicInstanceCallInstr::targets ( ) const
inline

Definition at line 4953 of file il.h.

4953{ return targets_; }

◆ total_call_count()

intptr_t dart::PolymorphicInstanceCallInstr::total_call_count ( )
inline

Definition at line 4967 of file il.h.

4967{ return total_call_count_; }

Friends And Related Function Documentation

◆ PolymorphicInliner

friend class PolymorphicInliner
friend

Definition at line 5018 of file il.h.


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