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

#include <il.h>

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

Public Member Functions

 StaticCallInstr (const InstructionSource &source, const Function &function, intptr_t type_args_len, const Array &argument_names, InputsArray &&arguments, const ZoneGrowableArray< const ICData * > &ic_data_array, intptr_t deopt_id, ICData::RebindRule rebind_rule)
 
 StaticCallInstr (const InstructionSource &source, const Function &function, intptr_t type_args_len, const Array &argument_names, InputsArray &&arguments, intptr_t deopt_id, intptr_t call_count, ICData::RebindRule rebind_rule)
 
const ICDataic_data () const
 
bool HasICData () const
 
void set_ic_data (const ICData *value)
 
virtual CompileType ComputeType () const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
bool Evaluate (FlowGraph *flow_graph, const Object &argument, Object *result)
 
bool Evaluate (FlowGraph *flow_graph, const Object &argument1, const Object &argument2, Object *result)
 
const Functionfunction () const
 
virtual intptr_t CallCount () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool ComputeCanDeoptimizeAfterCall () const
 
virtual bool CanBecomeDeoptimizationTarget () const
 
virtual bool HasUnknownSideEffects () const
 
virtual bool CanCallDart () const
 
bool InitResultType (Zone *zone)
 
void SetResultType (Zone *zone, CompileType new_type)
 
CompileTyperesult_type () const
 
intptr_t result_cid () const
 
bool is_known_list_constructor () const
 
void set_is_known_list_constructor (bool value)
 
Code::EntryKind entry_kind () const
 
void set_entry_kind (Code::EntryKind value)
 
bool IsRecognizedFactory () 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
 
virtual AliasIdentity Identity () const
 
virtual void SetIdentity (AliasIdentity identity)
 
const CallTargetsTargets ()
 
const class BinaryFeedbackBinaryFeedback ()
 
 DISALLOW_COPY_AND_ASSIGN (StaticCallInstr)
 
- 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

template<class C >
static StaticCallInstrFromCall (Zone *zone, const C *call, const Function &target, intptr_t call_count)
 
- 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)
 

Public Attributes

DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(StaticCallInstr, TemplateDartCall, 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 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 5529 of file il.h.

Constructor & Destructor Documentation

◆ StaticCallInstr() [1/2]

dart::StaticCallInstr::StaticCallInstr ( const InstructionSource source,
const Function function,
intptr_t  type_args_len,
const Array argument_names,
InputsArray &&  arguments,
const ZoneGrowableArray< const ICData * > &  ic_data_array,
intptr_t  deopt_id,
ICData::RebindRule  rebind_rule 
)
inline

Definition at line 5531 of file il.h.

5542 std::move(arguments),
5543 source),
5544 ic_data_(GetICData(ic_data_array, deopt_id, /*is_static_call=*/true)),
5545 call_count_(0),
5546 function_(function),
5547 rebind_rule_(rebind_rule),
5548 result_type_(nullptr),
5549 is_known_list_constructor_(false),
5550 entry_kind_(Code::EntryKind::kNormal),
5551 identity_(AliasIdentity::Unknown()) {
5552 DEBUG_ASSERT(function.IsNotTemporaryScopedHandle());
5554 }
#define DEBUG_ASSERT(cond)
Definition: assert.h:321
static AliasIdentity Unknown()
Definition: il.h:2417
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
bool IsNull() const
Definition: object.h:363
const Function & function() const
Definition: il.h:5623
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
#define ASSERT(E)

◆ StaticCallInstr() [2/2]

dart::StaticCallInstr::StaticCallInstr ( const InstructionSource source,
const Function function,
intptr_t  type_args_len,
const Array argument_names,
InputsArray &&  arguments,
intptr_t  deopt_id,
intptr_t  call_count,
ICData::RebindRule  rebind_rule 
)
inline

Definition at line 5556 of file il.h.

5567 std::move(arguments),
5568 source),
5569 ic_data_(nullptr),
5570 call_count_(call_count),
5571 function_(function),
5572 rebind_rule_(rebind_rule),
5573 result_type_(nullptr),
5574 is_known_list_constructor_(false),
5575 entry_kind_(Code::EntryKind::kNormal),
5576 identity_(AliasIdentity::Unknown()) {
5577 DEBUG_ASSERT(function.IsNotTemporaryScopedHandle());
5579 }

Member Function Documentation

◆ ArgumentsSize()

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

Reimplemented from dart::TemplateDartCall< 0 >.

Definition at line 5465 of file il.cc.

5465 {
5468 ((type_args_len() > 0) ? 1 : 0);
5469}
static intptr_t ComputeArgumentsSizeInWords(const Function &function, intptr_t arguments_count)
Definition: flow_graph.cc:96
intptr_t ArgumentCountWithoutTypeArgs() const
Definition: il.h:4578

◆ BinaryFeedback()

const BinaryFeedback & dart::StaticCallInstr::BinaryFeedback ( )

Definition at line 5488 of file il.cc.

5488 {
5489 if (binary_ == nullptr) {
5490 Zone* zone = Thread::Current()->zone();
5491 if (HasICData()) {
5493 } else {
5494 binary_ = new (zone) class BinaryFeedback(zone);
5495 }
5496 }
5497 return *binary_;
5498}
static const BinaryFeedback * Create(Zone *zone, const ICData &ic_data)
Definition: il.cc:4094
const ICData * ic_data() const
Definition: il.h:5604
DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(StaticCallInstr, TemplateDartCall, FIELD_LIST) private const class BinaryFeedback * binary_
Definition: il.h:5718
const class BinaryFeedback & BinaryFeedback()
Definition: il.cc:5488
bool HasICData() const
Definition: il.h:5605
Zone * zone() const
Definition: thread_state.h:37
static Thread * Current()
Definition: thread.h:362

◆ CallCount()

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

Reimplemented from dart::Definition.

Definition at line 5625 of file il.h.

5625 {
5626 return ic_data() == nullptr ? call_count_ : ic_data()->AggregateCount();
5627 }
intptr_t AggregateCount() const
Definition: object.cc:17084

◆ CanBecomeDeoptimizationTarget()

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

Reimplemented from dart::Instruction.

Definition at line 5634 of file il.h.

5634 {
5635 // Static calls that are specialized by the optimizer (e.g. sqrt) need a
5636 // deoptimization descriptor before the call.
5637 return true;
5638 }

◆ CanCallDart()

virtual bool dart::StaticCallInstr::CanCallDart ( ) const
inlinevirtual

Reimplemented from dart::TemplateDartCall< 0 >.

Definition at line 5641 of file il.h.

5641{ return true; }

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Definition at line 5771 of file il.cc.

5771 {
5772 auto& compiler_state = CompilerState::Current();
5773
5774 if (function().ptr() == compiler_state.StringBaseInterpolate().ptr()) {
5775 return CanonicalizeStringInterpolate(this, flow_graph);
5776 } else if (function().ptr() ==
5777 compiler_state.StringBaseInterpolateSingle().ptr()) {
5778 return CanonicalizeStringInterpolateSingle(this, flow_graph);
5779 }
5780
5781 const auto kind = function().recognized_kind();
5782
5783 if (kind != MethodRecognizer::kUnknown) {
5784 if (ArgumentCount() == 1) {
5785 const auto argument = ArgumentValueAt(0);
5786 if (argument->BindsToConstant()) {
5787 Object& result = Object::Handle();
5788 if (Evaluate(flow_graph, argument->BoundConstant(), &result)) {
5789 return flow_graph->TryCreateConstantReplacementFor(this, result);
5790 }
5791 }
5792 } else if (ArgumentCount() == 2) {
5793 const auto argument1 = ArgumentValueAt(0);
5794 const auto argument2 = ArgumentValueAt(1);
5795 if (argument1->BindsToConstant() && argument2->BindsToConstant()) {
5796 Object& result = Object::Handle();
5797 if (Evaluate(flow_graph, argument1->BoundConstant(),
5798 argument2->BoundConstant(), &result)) {
5799 return flow_graph->TryCreateConstantReplacementFor(this, result);
5800 }
5801 }
5802 }
5803 }
5804
5805 if (!compiler_state.is_aot()) {
5806 return this;
5807 }
5808
5809 if (kind == MethodRecognizer::kObjectRuntimeType) {
5810 if (input_use_list() == nullptr) {
5811 // This function has only environment uses. In precompiled mode it is
5812 // fine to remove it - because we will never deoptimize.
5813 return flow_graph->constant_dead();
5814 }
5815 }
5816
5817 return this;
5818}
static CompilerState & Current()
Value * input_use_list() const
Definition: il.h:2575
MethodRecognizer::Kind recognized_kind() const
Definition: object.h:3619
Value * ArgumentValueAt(intptr_t index) const
Definition: il.h:3435
ObjectPtr ptr() const
Definition: object.h:332
static Object & Handle()
Definition: object.h:407
bool Evaluate(FlowGraph *flow_graph, const Object &argument, Object *result)
Definition: il.cc:5820
intptr_t ArgumentCount() const
Definition: il.h:4586
GAsyncResult * result
static Definition * CanonicalizeStringInterpolate(StaticCallInstr *call, FlowGraph *flow_graph)
Definition: il.cc:5709
static Definition * CanonicalizeStringInterpolateSingle(StaticCallInstr *call, FlowGraph *flow_graph)
Definition: il.cc:5760

◆ ComputeCanDeoptimize()

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

Reimplemented from dart::TemplateDartCall< 0 >.

Definition at line 5629 of file il.h.

5629{ return false; }

◆ ComputeCanDeoptimizeAfterCall()

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

Reimplemented from dart::TemplateDartCall< 0 >.

Definition at line 5630 of file il.h.

5630 {
5631 return !CompilerState::Current().is_aot();
5632 }
bool is_aot() const

◆ ComputeType()

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

Reimplemented from dart::Definition.

Definition at line 1570 of file type_propagator.cc.

1570 {
1571 // TODO(alexmarkov): calculate type of StaticCallInstr eagerly
1572 // (in optimized mode) and avoid keeping separate result_type.
1573 CompileType* const inferred_type = result_type();
1575 return ComputeListFactoryType(inferred_type, ArgumentValueAt(0));
1576 }
1577
1578 intptr_t inferred_cid = kDynamicCid;
1579 bool is_nullable = CompileType::kCanBeNull;
1580 if (inferred_type != nullptr) {
1581 if (inferred_type->IsNullableInt()) {
1582 TraceStrongModeType(this, inferred_type);
1583 return *inferred_type;
1584 }
1585 inferred_cid = inferred_type->ToNullableCid();
1586 is_nullable = inferred_type->is_nullable();
1587 }
1588
1589 if (function_.has_pragma()) {
1590 const intptr_t cid = MethodRecognizer::ResultCidFromPragma(function_);
1591 if (cid != kDynamicCid) {
1592 return CompileType::FromCid(cid);
1593 }
1594 }
1595
1596 const AbstractType& result_type =
1598 CompileType result(is_nullable && !result_type.IsStrictlyNonNullable(),
1600 inferred_cid == kDynamicCid ? kIllegalCid : inferred_cid,
1601 &result_type);
1603 return result;
1604}
static CompileType FromCid(intptr_t cid)
static constexpr bool kCannotBeSentinel
Definition: compile_type.h:49
static constexpr bool kCanBeNull
Definition: compile_type.h:45
static intptr_t ResultCidFromPragma(const Object &function_or_field)
static Object & ZoneHandle()
Definition: object.h:419
CompileType * result_type() const
Definition: il.h:5652
bool is_known_list_constructor() const
Definition: il.h:5661
static CompileType ComputeListFactoryType(CompileType *inferred_type, Value *type_args_value)
@ kIllegalCid
Definition: class_id.h:214
@ kDynamicCid
Definition: class_id.h:253
const intptr_t cid
static void TraceStrongModeType(const Instruction *instr, const AbstractType &type)

◆ DeoptimizationTarget()

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

Reimplemented from dart::Instruction.

Definition at line 5687 of file il.h.

5687{ return DeoptId::kNone; }
static constexpr intptr_t kNone
Definition: deopt_id.h:27

◆ DISALLOW_COPY_AND_ASSIGN()

dart::StaticCallInstr::DISALLOW_COPY_AND_ASSIGN ( StaticCallInstr  )

◆ entry_kind()

Code::EntryKind dart::StaticCallInstr::entry_kind ( ) const
inline

Definition at line 5666 of file il.h.

5666{ return entry_kind_; }

◆ Evaluate() [1/2]

bool dart::StaticCallInstr::Evaluate ( FlowGraph flow_graph,
const Object argument,
Object result 
)

Definition at line 5820 of file il.cc.

5822 {
5823 const auto kind = function().recognized_kind();
5824 switch (kind) {
5825 case MethodRecognizer::kSmi_bitLength: {
5826 ASSERT(FirstArgIndex() == 0);
5827 if (argument.IsInteger()) {
5828 const Integer& value = Integer::Handle(
5829 flow_graph->zone(),
5831 flow_graph->thread()));
5832 if (!value.IsNull()) {
5833 *result = value.ptr();
5834 return true;
5835 }
5836 }
5837 break;
5838 }
5839 case MethodRecognizer::kStringBaseLength:
5840 case MethodRecognizer::kStringBaseIsEmpty: {
5841 ASSERT(FirstArgIndex() == 0);
5842 if (argument.IsString()) {
5843 const auto& str = String::Cast(argument);
5844 if (kind == MethodRecognizer::kStringBaseLength) {
5845 *result = Integer::New(str.Length());
5846 } else {
5847 *result = Bool::Get(str.Length() == 0).ptr();
5848 break;
5849 }
5850 return true;
5851 }
5852 break;
5853 }
5854 default:
5855 break;
5856 }
5857 return false;
5858}
static const Bool & Get(bool value)
Definition: object.h:10801
static IntegerPtr BitLengthEvaluate(const Object &value, Representation representation, Thread *thread)
Definition: evaluator.cc:164
static IntegerPtr New(const String &str, Heap::Space space=Heap::kNew)
Definition: object.cc:22984
virtual Representation representation() const
Definition: il.cc:5471
intptr_t FirstArgIndex() const
Definition: il.h:4576
uint8_t value

◆ Evaluate() [2/2]

bool dart::StaticCallInstr::Evaluate ( FlowGraph flow_graph,
const Object argument1,
const Object argument2,
Object result 
)

Definition at line 5860 of file il.cc.

5863 {
5864 const auto kind = function().recognized_kind();
5865 switch (kind) {
5866 case MethodRecognizer::kOneByteString_equality:
5867 case MethodRecognizer::kTwoByteString_equality: {
5868 if (argument1.IsString() && argument2.IsString()) {
5869 *result =
5870 Bool::Get(String::Cast(argument1).Equals(String::Cast(argument2)))
5871 .ptr();
5872 return true;
5873 }
5874 break;
5875 }
5876 default:
5877 break;
5878 }
5879 return false;
5880}
bool Equals(const Instruction &other) const
Definition: il.cc:619

◆ FromCall()

template<class C >
static StaticCallInstr * dart::StaticCallInstr::FromCall ( Zone zone,
const C call,
const Function target,
intptr_t  call_count 
)
inlinestatic

Definition at line 5584 of file il.h.

5587 {
5588 ASSERT(!call->HasMoveArguments());
5589 InputsArray args(zone, call->ArgumentCount());
5590 for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
5591 args.Add(call->ArgumentValueAt(i)->CopyWithType());
5592 }
5593 StaticCallInstr* new_call = new (zone) StaticCallInstr(
5594 call->source(), target, call->type_args_len(), call->argument_names(),
5595 std::move(args), call->deopt_id(), call_count, ICData::kNoRebind);
5596 if (call->result_type() != nullptr) {
5597 new_call->result_type_ = call->result_type();
5598 }
5599 new_call->set_entry_kind(call->entry_kind());
5600 return new_call;
5601 }
StaticCallInstr(const InstructionSource &source, const Function &function, intptr_t type_args_len, const Array &argument_names, InputsArray &&arguments, const ZoneGrowableArray< const ICData * > &ic_data_array, intptr_t deopt_id, ICData::RebindRule rebind_rule)
Definition: il.h:5531
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t * target
GrowableArray< Value * > InputsArray
Definition: il.h:901
def call(args)
Definition: dom.py:159

◆ function()

const Function & dart::StaticCallInstr::function ( ) const
inline

Definition at line 5623 of file il.h.

5623{ return function_; }

◆ HasICData()

bool dart::StaticCallInstr::HasICData ( ) const
inline

Definition at line 5605 of file il.h.

5605 {
5606 return (ic_data() != nullptr) && !ic_data()->IsNull();
5607 }

◆ HasUnknownSideEffects()

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

Implements dart::Instruction.

Definition at line 5640 of file il.h.

5640{ return true; }

◆ ic_data()

const ICData * dart::StaticCallInstr::ic_data ( ) const
inline

Definition at line 5604 of file il.h.

5604{ return ic_data_; }

◆ Identity()

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

Reimplemented from dart::Definition.

Definition at line 5691 of file il.h.

5691{ return identity_; }

◆ InitResultType()

bool dart::StaticCallInstr::InitResultType ( Zone zone)

Definition at line 5674 of file il.cc.

5674 {
5675 const intptr_t list_cid = FactoryRecognizer::GetResultCidOfListFactory(
5676 zone, function(), ArgumentCount());
5677 if (list_cid != kDynamicCid) {
5678 SetResultType(zone, CompileType::FromCid(list_cid));
5680 return true;
5681 } else if (function().has_pragma()) {
5682 const intptr_t recognized_cid =
5684 if (recognized_cid != kDynamicCid) {
5685 SetResultType(zone, CompileType::FromCid(recognized_cid));
5686 return true;
5687 }
5688 }
5689 return false;
5690}
static intptr_t GetResultCidOfListFactory(Zone *zone, const Function &function, intptr_t argument_count)
void SetResultType(Zone *zone, CompileType new_type)
Definition: il.h:5648
void set_is_known_list_constructor(bool value)
Definition: il.h:5662

◆ is_known_list_constructor()

bool dart::StaticCallInstr::is_known_list_constructor ( ) const
inline

Definition at line 5661 of file il.h.

5661{ return is_known_list_constructor_; }

◆ IsRecognizedFactory()

bool dart::StaticCallInstr::IsRecognizedFactory ( ) const
inline

Definition at line 5670 of file il.h.

5670{ return is_known_list_constructor(); }

◆ representation()

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

Reimplemented from dart::Instruction.

Definition at line 5471 of file il.cc.

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

◆ RequiredInputRepresentation()

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

Reimplemented from dart::Instruction.

Definition at line 5452 of file il.cc.

5453 {
5454 // The first input is the array of types
5455 // for generic functions
5456 if (type_args_len() > 0 || function().IsFactory()) {
5457 if (idx == 0) {
5458 return kTagged;
5459 }
5460 idx--;
5461 }
5463}
static Representation ParameterRepresentationAt(const Function &function, intptr_t index)
Definition: flow_graph.cc:109

◆ result_cid()

intptr_t dart::StaticCallInstr::result_cid ( ) const
inline

Definition at line 5654 of file il.h.

5654 {
5655 if (result_type_ == nullptr) {
5656 return kDynamicCid;
5657 }
5658 return result_type_->ToCid();
5659 }

◆ result_type()

CompileType * dart::StaticCallInstr::result_type ( ) const
inline

Definition at line 5652 of file il.h.

5652{ return result_type_; }

◆ set_entry_kind()

void dart::StaticCallInstr::set_entry_kind ( Code::EntryKind  value)
inline

Definition at line 5668 of file il.h.

5668{ entry_kind_ = value; }

◆ set_ic_data()

void dart::StaticCallInstr::set_ic_data ( const ICData value)
inline

Definition at line 5609 of file il.h.

5609{ ic_data_ = value; }

◆ set_is_known_list_constructor()

void dart::StaticCallInstr::set_is_known_list_constructor ( bool  value)
inline

Definition at line 5662 of file il.h.

5662 {
5663 is_known_list_constructor_ = value;
5664 }

◆ SetIdentity()

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

Reimplemented from dart::Definition.

Definition at line 5692 of file il.h.

5692{ identity_ = identity; }

◆ SetResultType()

void dart::StaticCallInstr::SetResultType ( Zone zone,
CompileType  new_type 
)
inline

Definition at line 5648 of file il.h.

5648 {
5649 result_type_ = new (zone) CompileType(new_type);
5650 }

◆ SpeculativeModeOfInput()

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

Reimplemented from dart::Instruction.

Definition at line 5672 of file il.h.

5672 {
5673 if (type_args_len() > 0 || function().IsFactory()) {
5674 if (idx == 0) {
5675 return kGuardInputs;
5676 }
5677 idx--;
5678 }
5679 return function_.is_unboxed_parameter_at(idx) ? kNotSpeculative
5680 : kGuardInputs;
5681 }
@ kGuardInputs
Definition: il.h:972
@ kNotSpeculative
Definition: il.h:975

◆ Targets()

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

Definition at line 5475 of file il.cc.

5475 {
5476 if (targets_ == nullptr) {
5477 Zone* zone = Thread::Current()->zone();
5478 if (HasICData()) {
5479 targets_ = CallTargets::CreateAndExpand(zone, *ic_data());
5480 } else {
5481 targets_ = new (zone) CallTargets(zone);
5482 ASSERT(targets_->is_empty());
5483 }
5484 }
5485 return *targets_;
5486}
static const CallTargets * CreateAndExpand(Zone *zone, const ICData &ic_data)
Definition: il.cc:4137

Member Data Documentation

◆ binary_

DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS (StaticCallInstr, TemplateDartCall, FIELD_LIST) private const class BinaryFeedback* dart::StaticCallInstr::binary_ = nullptr

Definition at line 5718 of file il.h.


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