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

#include <il.h>

Inheritance diagram for dart::DispatchTableCallInstr:
dart::TemplateDartCall< 1 > dart::VariadicDefinition dart::Definition dart::Instruction dart::ZoneAllocated

Public Member Functions

 DispatchTableCallInstr (const InstructionSource &source, const Function &interface_target, const compiler::TableSelector *selector, InputsArray &&arguments, intptr_t type_args_len, const Array &argument_names)
 
const Functioninterface_target () const
 
const compiler::TableSelectorselector () const
 
const char * selector_name () const
 
Valueclass_id () const
 
virtual CompileType ComputeType () const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
virtual bool CanBecomeDeoptimizationTarget () const
 
virtual intptr_t DeoptimizationTarget () const
 
virtual bool HasUnknownSideEffects () const
 
virtual SpeculativeMode SpeculativeModeOfInput (intptr_t idx) const
 
virtual intptr_t ArgumentsSize () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
virtual Representation representation () const
 
- Public Member Functions inherited from dart::TemplateDartCall< 1 >
 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 DispatchTableCallInstrFromCall (Zone *zone, const InstanceCallBaseInstr *call, Value *cid, const Function &interface_target, const compiler::TableSelector *selector)
 
- 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)
 

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

Constructor & Destructor Documentation

◆ DispatchTableCallInstr()

dart::DispatchTableCallInstr::DispatchTableCallInstr ( const InstructionSource source,
const Function interface_target,
const compiler::TableSelector selector,
InputsArray &&  arguments,
intptr_t  type_args_len,
const Array argument_names 
)
inline

Definition at line 5028 of file il.h.

5037 std::move(arguments),
5038 source),
5039 interface_target_(interface_target),
5040 selector_(selector) {
5041 ASSERT(selector != nullptr);
5042 DEBUG_ASSERT(interface_target_.IsNotTemporaryScopedHandle());
5043 ASSERT(InputCount() > 0);
5044 }
#define DEBUG_ASSERT(cond)
Definition: assert.h:321
static constexpr intptr_t kNone
Definition: deopt_id.h:27
const Function & interface_target() const
Definition: il.h:5056
const compiler::TableSelector * selector() const
Definition: il.h:5057
InstructionSource source() const
Definition: il.h:1008
intptr_t type_args_len() const
Definition: il.h:4614
const Array & argument_names() const
Definition: il.h:4615
TemplateDartCall(intptr_t deopt_id, intptr_t type_args_len, const Array &argument_names, InputsArray &&inputs, const InstructionSource &source)
Definition: il.h:4550
intptr_t InputCount() const
Definition: il.h:2794
#define ASSERT(E)

Member Function Documentation

◆ ArgumentsSize()

intptr_t dart::DispatchTableCallInstr::ArgumentsSize ( ) const
virtual

Reimplemented from dart::TemplateDartCall< 1 >.

Definition at line 5387 of file il.cc.

5387 {
5388 if (interface_target().IsNull()) {
5389 return ArgumentCountWithoutTypeArgs() + ((type_args_len() > 0) ? 1 : 0);
5390 }
5391
5394 ((type_args_len() > 0) ? 1 : 0);
5395}
static intptr_t ComputeArgumentsSizeInWords(const Function &function, intptr_t arguments_count)
Definition: flow_graph.cc:96
intptr_t ArgumentCountWithoutTypeArgs() const
Definition: il.h:4578
DART_EXPORT bool IsNull(Dart_Handle object)

◆ CanBecomeDeoptimizationTarget()

virtual bool dart::DispatchTableCallInstr::CanBecomeDeoptimizationTarget ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 5068 of file il.h.

5068{ return false; }

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Definition at line 5646 of file il.cc.

5646 {
5647 // TODO(dartbug.com/40188): Allow this to canonicalize into a StaticCall when
5648 // when input class id is constant;
5649 return this;
5650}

◆ class_id()

Value * dart::DispatchTableCallInstr::class_id ( ) const
inline

Definition at line 5062 of file il.h.

5062{ return InputAt(InputCount() - 1); }
Value * InputAt(intptr_t i) const
Definition: il.h:2795

◆ ComputeType()

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

Reimplemented from dart::Definition.

Definition at line 1514 of file type_propagator.cc.

1514 {
1515 // TODO(dartbug.com/40188): Share implementation with InstanceCallBaseInstr.
1516 const Function& target = interface_target();
1517 ASSERT(!target.IsNull());
1518 const auto& result_type = AbstractType::ZoneHandle(target.result_type());
1519 if (result_type.IsInstantiated()) {
1520 TraceStrongModeType(this, result_type);
1523 }
1524
1525 return CompileType::Dynamic();
1526}
static constexpr bool kCannotBeSentinel
Definition: compile_type.h:49
static constexpr bool kCanBeNull
Definition: compile_type.h:45
static CompileType Dynamic()
static CompileType FromAbstractType(const AbstractType &type, bool can_be_null, bool can_be_sentinel)
static Object & ZoneHandle()
Definition: object.h:419
uint32_t * target
static void TraceStrongModeType(const Instruction *instr, const AbstractType &type)

◆ DeoptimizationTarget()

virtual intptr_t dart::DispatchTableCallInstr::DeoptimizationTarget ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 5070 of file il.h.

5070{ return DeoptId::kNone; }

◆ FromCall()

DispatchTableCallInstr * dart::DispatchTableCallInstr::FromCall ( Zone zone,
const InstanceCallBaseInstr call,
Value cid,
const Function interface_target,
const compiler::TableSelector selector 
)
static

Definition at line 5401 of file il.cc.

5406 {
5407 InputsArray args(zone, call->ArgumentCount() + 1);
5408 for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
5409 args.Add(call->ArgumentValueAt(i)->CopyWithType());
5410 }
5411 args.Add(cid);
5412 auto dispatch_table_call = new (zone) DispatchTableCallInstr(
5413 call->source(), interface_target, selector, std::move(args),
5414 call->type_args_len(), call->argument_names());
5415 return dispatch_table_call;
5416}
DispatchTableCallInstr(const InstructionSource &source, const Function &interface_target, const compiler::TableSelector *selector, InputsArray &&arguments, intptr_t type_args_len, const Array &argument_names)
Definition: il.h:5028
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
GrowableArray< Value * > InputsArray
Definition: il.h:901
const intptr_t cid
def call(args)
Definition: dom.py:159

◆ HasUnknownSideEffects()

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

Implements dart::Instruction.

Definition at line 5072 of file il.h.

5072{ return true; }

◆ interface_target()

const Function & dart::DispatchTableCallInstr::interface_target ( ) const
inline

Definition at line 5056 of file il.h.

5056{ return interface_target_; }

◆ representation()

Representation dart::DispatchTableCallInstr::representation ( ) const
virtual

Reimplemented from dart::Instruction.

Definition at line 5397 of file il.cc.

5397 {
5399}
static Representation ReturnRepresentationOf(const Function &function)
Definition: flow_graph.cc:125

◆ RequiredInputRepresentation()

Representation dart::DispatchTableCallInstr::RequiredInputRepresentation ( intptr_t  idx) const
virtual

Reimplemented from dart::Instruction.

Definition at line 5370 of file il.cc.

5371 {
5372 if (idx == (InputCount() - 1)) {
5373 return kUnboxedUword; // Receiver's CID.
5374 }
5375
5376 // The first input is the array of types
5377 // for generic functions
5378 if (type_args_len() > 0) {
5379 if (idx == 0) {
5380 return kTagged;
5381 }
5382 idx--;
5383 }
5385}
static Representation ParameterRepresentationAt(const Function &function, intptr_t index)
Definition: flow_graph.cc:109
static constexpr Representation kUnboxedUword
Definition: locations.h:171

◆ selector()

const compiler::TableSelector * dart::DispatchTableCallInstr::selector ( ) const
inline

Definition at line 5057 of file il.h.

5057{ return selector_; }

◆ selector_name()

const char * dart::DispatchTableCallInstr::selector_name ( ) const
inline

Definition at line 5058 of file il.h.

5058 {
5060 }
virtual const char * ToCString() const
Definition: object.h:366
static Object & Handle()
Definition: object.h:407
const char *const name

◆ SpeculativeModeOfInput()

virtual SpeculativeMode dart::DispatchTableCallInstr::SpeculativeModeOfInput ( intptr_t  idx) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 5074 of file il.h.

5074 {
5075 if (type_args_len() > 0) {
5076 if (idx == 0) {
5077 return kGuardInputs;
5078 }
5079 idx--;
5080 }
5081 return interface_target_.is_unboxed_parameter_at(idx) ? kNotSpeculative
5082 : kGuardInputs;
5083 }
@ kGuardInputs
Definition: il.h:972
@ kNotSpeculative
Definition: il.h:975

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