Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 intptr_t NumberOfInputsConsumedBeforeCall () const
 
intptr_t FirstArgIndex () const
 
ValueReceiver () const
 
intptr_t ArgumentCountWithoutTypeArgs () const
 
intptr_t ArgumentsSizeWithoutTypeArgs () const
 
intptr_t ArgumentCount () 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)
 
intptr_t temp_index () const
 
void set_temp_index (intptr_t index)
 
void ClearTempIndex ()
 
bool HasTemp () const
 
intptr_t ssa_temp_index () const
 
void set_ssa_temp_index (intptr_t index)
 
bool HasSSATemp () const
 
void ClearSSATempIndex ()
 
intptr_t vreg (intptr_t index) const
 
intptr_t location_count () const
 
bool HasPairRepresentation () const
 
CompileTypeType ()
 
bool HasType () const
 
bool IsInt64Definition ()
 
bool IsInt32Definition ()
 
virtual bool RecomputeType ()
 
PRINT_OPERANDS_TO_SUPPORT PRINT_TO_SUPPORT bool UpdateType (CompileType new_type)
 
bool HasUses () const
 
bool HasOnlyUse (Value *use) const
 
bool HasOnlyInputUse (Value *use) const
 
Valueinput_use_list () const
 
void set_input_use_list (Value *head)
 
Valueenv_use_list () const
 
void set_env_use_list (Value *head)
 
ValueListIterable input_uses () const
 
void AddInputUse (Value *value)
 
void AddEnvUse (Value *value)
 
virtual bool MayCreateUnsafeUntaggedPointer () const
 
virtual bool CanReplaceWithConstant () const
 
virtual bool CanEliminate (const BlockEntryInstr *block) const
 
void ReplaceUsesWith (Definition *other)
 
void ReplaceWithResult (Instruction *replacement, Definition *replacement_for_uses, ForwardInstructionIterator *iterator)
 
void ReplaceWith (Definition *other, ForwardInstructionIterator *iterator)
 
Objectconstant_value ()
 
virtual void InferRange (RangeAnalysis *analysis, Range *range)
 
Rangerange () const
 
void set_range (const Range &)
 
DefinitionReplacement ()
 
void SetReplacement (Definition *other)
 
DefinitionOriginalDefinition ()
 
virtual ValueRedefinedValue () const
 
DefinitionOriginalDefinitionIgnoreBoxingAndConstraints ()
 
virtual DefinitionAsDefinition ()
 
virtual const DefinitionAsDefinition () const
 
- Public Member Functions inherited from dart::Instruction
 Instruction (const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
 Instruction (intptr_t deopt_id=DeoptId::kNone)
 
virtual ~Instruction ()
 
virtual Tag tag () const =0
 
virtual intptr_t statistics_tag () const
 
intptr_t deopt_id () const
 
InstructionSource source () const
 
void SetInputAt (intptr_t i, Value *value)
 
InputsIterable inputs ()
 
void UnuseAllInputs ()
 
ValueArgumentValueAt (intptr_t index) const
 
DefinitionArgumentAt (intptr_t index) const
 
bool HasMoveArguments () const
 
void RepairArgumentUsesInEnvironment () const
 
bool CanDeoptimize () const
 
virtual void Accept (InstructionVisitor *visitor)=0
 
Instructionprevious () const
 
void set_previous (Instruction *instr)
 
Instructionnext () const
 
void set_next (Instruction *instr)
 
void LinkTo (Instruction *next)
 
InstructionRemoveFromGraph (bool return_previous=true)
 
virtual intptr_t SuccessorCount () const
 
virtual BlockEntryInstrSuccessorAt (intptr_t index) const
 
SuccessorsIterable successors () const
 
void Goto (JoinEntryInstr *entry)
 
virtual const char * DebugName () const =0
 
void CheckField (const Field &field) const
 
const char * ToCString () const
 
 DECLARE_INSTRUCTION_TYPE_CHECK (BlockEntryWithInitialDefs, BlockEntryWithInitialDefs) template< typename T > T *Cast()
 
template<typename T >
const TCast () const
 
LocationSummarylocs ()
 
bool HasLocs () const
 
virtual LocationSummaryMakeLocationSummary (Zone *zone, bool is_optimizing) const =0
 
void InitializeLocationSummary (Zone *zone, bool optimizing)
 
virtual void EmitNativeCode (FlowGraphCompiler *compiler)
 
Environmentenv () const
 
void SetEnvironment (Environment *deopt_env)
 
void RemoveEnvironment ()
 
void ReplaceInEnvironment (Definition *current, Definition *replacement)
 
intptr_t GetPassSpecificId (CompilerPass::Id pass) const
 
void SetPassSpecificId (CompilerPass::Id pass, intptr_t id)
 
bool HasPassSpecificId (CompilerPass::Id pass) const
 
bool HasUnmatchedInputRepresentations () const
 
SpeculativeMode SpeculativeModeOfInputs () const
 
bool WasEliminated () const
 
void InsertBefore (Instruction *next)
 
void InsertAfter (Instruction *prev)
 
InstructionAppendInstruction (Instruction *tail)
 
virtual bool AllowsCSE () 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
 
void InheritDeoptTargetAfter (FlowGraph *flow_graph, Definition *call, Definition *result)
 
virtual bool MayHaveVisibleEffect () 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 5480 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 5482 of file il.h.

5493 std::move(arguments),
5494 source),
5495 ic_data_(GetICData(ic_data_array, deopt_id, /*is_static_call=*/true)),
5496 call_count_(0),
5497 function_(function),
5498 rebind_rule_(rebind_rule),
5499 result_type_(nullptr),
5500 is_known_list_constructor_(false),
5501 entry_kind_(Code::EntryKind::kNormal),
5502 identity_(AliasIdentity::Unknown()) {
5503 DEBUG_ASSERT(function.IsNotTemporaryScopedHandle());
5505 }
#define DEBUG_ASSERT(cond)
Definition assert.h:321
static AliasIdentity Unknown()
Definition il.h:2399
static const ICData * GetICData(const ZoneGrowableArray< const ICData * > &ic_data_array, intptr_t deopt_id, bool is_static_call)
Definition il.cc:593
intptr_t deopt_id() const
Definition il.h:987
bool IsNull() const
Definition object.h:363
const Function & function() const
Definition il.h:5574
intptr_t type_args_len() const
Definition il.h:4596
const Array & argument_names() const
Definition il.h:4597
TemplateDartCall(intptr_t deopt_id, intptr_t type_args_len, const Array &argument_names, InputsArray &&inputs, const InstructionSource &source)
Definition il.h:4532
#define ASSERT(E)
SkBitmap source
Definition examples.cpp:28

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

5518 std::move(arguments),
5519 source),
5520 ic_data_(nullptr),
5521 call_count_(call_count),
5522 function_(function),
5523 rebind_rule_(rebind_rule),
5524 result_type_(nullptr),
5525 is_known_list_constructor_(false),
5526 entry_kind_(Code::EntryKind::kNormal),
5527 identity_(AliasIdentity::Unknown()) {
5528 DEBUG_ASSERT(function.IsNotTemporaryScopedHandle());
5530 }

Member Function Documentation

◆ ArgumentsSize()

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

Reimplemented from dart::TemplateDartCall< 0 >.

Definition at line 5467 of file il.cc.

5467 {
5470 ((type_args_len() > 0) ? 1 : 0);
5471}
static intptr_t ComputeArgumentsSizeInWords(const Function &function, intptr_t arguments_count)
intptr_t ArgumentCountWithoutTypeArgs() const
Definition il.h:4560

◆ BinaryFeedback()

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

Definition at line 5490 of file il.cc.

5490 {
5491 if (binary_ == nullptr) {
5492 Zone* zone = Thread::Current()->zone();
5493 if (HasICData()) {
5495 } else {
5496 binary_ = new (zone) class BinaryFeedback(zone);
5497 }
5498 }
5499 return *binary_;
5500}
static const BinaryFeedback * Create(Zone *zone, const ICData &ic_data)
Definition il.cc:4097
const ICData * ic_data() const
Definition il.h:5555
DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(StaticCallInstr, TemplateDartCall, FIELD_LIST) private const class BinaryFeedback * binary_
Definition il.h:5669
const class BinaryFeedback & BinaryFeedback()
Definition il.cc:5490
bool HasICData() const
Definition il.h:5556
Zone * zone() const
static Thread * Current()
Definition thread.h:361

◆ CallCount()

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

Reimplemented from dart::Definition.

Definition at line 5576 of file il.h.

5576 {
5577 return ic_data() == nullptr ? call_count_ : ic_data()->AggregateCount();
5578 }
intptr_t AggregateCount() const
Definition object.cc:17131

◆ CanBecomeDeoptimizationTarget()

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

Reimplemented from dart::Instruction.

Definition at line 5585 of file il.h.

5585 {
5586 // Static calls that are specialized by the optimizer (e.g. sqrt) need a
5587 // deoptimization descriptor before the call.
5588 return true;
5589 }

◆ CanCallDart()

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

Reimplemented from dart::TemplateDartCall< 0 >.

Definition at line 5592 of file il.h.

5592{ return true; }

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Definition at line 5773 of file il.cc.

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

◆ ComputeCanDeoptimize()

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

Reimplemented from dart::TemplateDartCall< 0 >.

Definition at line 5580 of file il.h.

5580{ return false; }

◆ ComputeCanDeoptimizeAfterCall()

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

Reimplemented from dart::TemplateDartCall< 0 >.

Definition at line 5581 of file il.h.

5581 {
5582 return !CompilerState::Current().is_aot();
5583 }

◆ ComputeType()

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

Reimplemented from dart::Definition.

Definition at line 1575 of file type_propagator.cc.

1575 {
1576 // TODO(alexmarkov): calculate type of StaticCallInstr eagerly
1577 // (in optimized mode) and avoid keeping separate result_type.
1578 CompileType* const inferred_type = result_type();
1580 return ComputeListFactoryType(inferred_type, ArgumentValueAt(0));
1581 }
1582
1583 intptr_t inferred_cid = kDynamicCid;
1584 bool is_nullable = CompileType::kCanBeNull;
1585 if (inferred_type != nullptr) {
1586 if (inferred_type->IsNullableInt()) {
1587 TraceStrongModeType(this, inferred_type);
1588 return *inferred_type;
1589 }
1590 inferred_cid = inferred_type->ToNullableCid();
1591 is_nullable = inferred_type->is_nullable();
1592 }
1593
1594 if (function_.has_pragma()) {
1595 const intptr_t cid = MethodRecognizer::ResultCidFromPragma(function_);
1596 if (cid != kDynamicCid) {
1597 return CompileType::FromCid(cid);
1598 }
1600 is_nullable = CompileType::kCannotBeNull;
1601 }
1602 }
1603
1604 const AbstractType& result_type =
1606 CompileType result(is_nullable && !result_type.IsStrictlyNonNullable(),
1608 inferred_cid == kDynamicCid ? kIllegalCid : inferred_cid,
1609 &result_type);
1611 return result;
1612}
static CompileType FromCid(intptr_t cid)
static constexpr bool kCannotBeSentinel
static constexpr bool kCannotBeNull
static constexpr bool kCanBeNull
static intptr_t ResultCidFromPragma(const Object &function_or_field)
static bool HasNonNullableResultTypeFromPragma(const Object &function_or_field)
static Object & ZoneHandle()
Definition object.h:419
CompileType * result_type() const
Definition il.h:5603
bool is_known_list_constructor() const
Definition il.h:5612
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 5638 of file il.h.

5638{ 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 5617 of file il.h.

5617{ return entry_kind_; }

◆ Evaluate() [1/2]

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

Definition at line 5822 of file il.cc.

5824 {
5825 const auto kind = function().recognized_kind();
5826 switch (kind) {
5827 case MethodRecognizer::kSmi_bitLength: {
5828 ASSERT(FirstArgIndex() == 0);
5829 if (argument.IsInteger()) {
5830 const Integer& value = Integer::Handle(
5831 flow_graph->zone(),
5833 flow_graph->thread()));
5834 if (!value.IsNull()) {
5835 *result = value.ptr();
5836 return true;
5837 }
5838 }
5839 break;
5840 }
5841 case MethodRecognizer::kStringBaseLength:
5842 case MethodRecognizer::kStringBaseIsEmpty: {
5843 ASSERT(FirstArgIndex() == 0);
5844 if (argument.IsString()) {
5845 const auto& str = String::Cast(argument);
5846 if (kind == MethodRecognizer::kStringBaseLength) {
5847 *result = Integer::New(str.Length());
5848 } else {
5849 *result = Bool::Get(str.Length() == 0).ptr();
5850 break;
5851 }
5852 return true;
5853 }
5854 break;
5855 }
5856 default:
5857 break;
5858 }
5859 return false;
5860}
static const Bool & Get(bool value)
Definition object.h:10780
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:23063
virtual Representation representation() const
Definition il.cc:5473
intptr_t FirstArgIndex() const
Definition il.h:4558
uint8_t value

◆ Evaluate() [2/2]

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

Definition at line 5862 of file il.cc.

5865 {
5866 const auto kind = function().recognized_kind();
5867 switch (kind) {
5868 case MethodRecognizer::kOneByteString_equality:
5869 case MethodRecognizer::kTwoByteString_equality: {
5870 if (argument1.IsString() && argument2.IsString()) {
5871 *result =
5872 Bool::Get(String::Cast(argument1).Equals(String::Cast(argument2)))
5873 .ptr();
5874 return true;
5875 }
5876 break;
5877 }
5878 default:
5879 break;
5880 }
5881 return false;
5882}
static bool Equals(const Object &expected, const Object &actual)

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

5538 {
5539 ASSERT(!call->HasMoveArguments());
5540 InputsArray args(zone, call->ArgumentCount());
5541 for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
5542 args.Add(call->ArgumentValueAt(i)->CopyWithType());
5543 }
5544 StaticCallInstr* new_call = new (zone) StaticCallInstr(
5545 call->source(), target, call->type_args_len(), call->argument_names(),
5546 std::move(args), call->deopt_id(), call_count, ICData::kNoRebind);
5547 if (call->result_type() != nullptr) {
5548 new_call->result_type_ = call->result_type();
5549 }
5550 new_call->set_entry_kind(call->entry_kind());
5551 return new_call;
5552 }
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:5482
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t * target
GrowableArray< Value * > InputsArray
Definition il.h:895
call(args)
Definition dom.py:159

◆ function()

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

Definition at line 5574 of file il.h.

5574{ return function_; }

◆ HasICData()

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

Definition at line 5556 of file il.h.

5556 {
5557 return (ic_data() != nullptr) && !ic_data()->IsNull();
5558 }

◆ HasUnknownSideEffects()

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

Implements dart::Instruction.

Definition at line 5591 of file il.h.

5591{ return true; }

◆ ic_data()

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

Definition at line 5555 of file il.h.

5555{ return ic_data_; }

◆ Identity()

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

Reimplemented from dart::Definition.

Definition at line 5642 of file il.h.

5642{ return identity_; }

◆ InitResultType()

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

Definition at line 5676 of file il.cc.

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

◆ is_known_list_constructor()

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

Definition at line 5612 of file il.h.

5612{ return is_known_list_constructor_; }

◆ IsRecognizedFactory()

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

Definition at line 5621 of file il.h.

5621{ return is_known_list_constructor(); }

◆ representation()

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

Reimplemented from dart::Instruction.

Definition at line 5473 of file il.cc.

5473 {
5475}
static Representation ReturnRepresentationOf(const Function &function)

◆ RequiredInputRepresentation()

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

Reimplemented from dart::Instruction.

Definition at line 5454 of file il.cc.

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

◆ result_cid()

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

Definition at line 5605 of file il.h.

5605 {
5606 if (result_type_ == nullptr) {
5607 return kDynamicCid;
5608 }
5609 return result_type_->ToCid();
5610 }

◆ result_type()

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

Definition at line 5603 of file il.h.

5603{ return result_type_; }

◆ set_entry_kind()

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

Definition at line 5619 of file il.h.

5619{ entry_kind_ = value; }

◆ set_ic_data()

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

Definition at line 5560 of file il.h.

5560{ ic_data_ = value; }

◆ set_is_known_list_constructor()

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

Definition at line 5613 of file il.h.

5613 {
5614 is_known_list_constructor_ = value;
5615 }

◆ SetIdentity()

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

Reimplemented from dart::Definition.

Definition at line 5643 of file il.h.

5643{ identity_ = identity; }

◆ SetResultType()

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

Definition at line 5599 of file il.h.

5599 {
5600 result_type_ = new (zone) CompileType(new_type);
5601 }

◆ SpeculativeModeOfInput()

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

Reimplemented from dart::Instruction.

Definition at line 5623 of file il.h.

5623 {
5624 if (type_args_len() > 0 || function().IsFactory()) {
5625 if (idx == 0) {
5626 return kGuardInputs;
5627 }
5628 idx--;
5629 }
5630 return function_.is_unboxed_parameter_at(idx) ? kNotSpeculative
5631 : kGuardInputs;
5632 }
@ kNotSpeculative
Definition il.h:969

◆ Targets()

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

Definition at line 5477 of file il.cc.

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

Member Data Documentation

◆ binary_

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

Definition at line 5669 of file il.h.


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