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

#include <il.h>

Inheritance diagram for dart::LoadClassIdInstr:
dart::TemplateDefinition< 1, NoThrow, Pure > dart::PureDefinition dart::Definition dart::Instruction dart::ZoneAllocated

Public Member Functions

 LoadClassIdInstr (Value *object, Representation representation=kTagged, bool input_can_be_smi=true)
 
virtual Representation representation () const
 
virtual CompileType ComputeType () const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
Valueobject () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool AttributesEqual (const Instruction &other) const
 
void InferRange (uword *lower, uword *upper)
 
virtual void InferRange (RangeAnalysis *analysis, Range *range)
 
- Public Member Functions inherited from dart::TemplateDefinition< 1, NoThrow, Pure >
 TemplateDefinition (intptr_t deopt_id=DeoptId::kNone)
 
 TemplateDefinition (const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
virtual intptr_t InputCount () const
 
virtual ValueInputAt (intptr_t i) const
 
virtual bool MayThrow () const
 
- Public Member Functions inherited from dart::PureDefinition
 PureDefinition (intptr_t deopt_id)
 
 PureDefinition (const InstructionSource &source, intptr_t deopt_id)
 
virtual bool AllowsCSE () const
 
virtual bool HasUnknownSideEffects () 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)
 

Additional Inherited Members

- Public Types inherited from dart::TemplateDefinition< 1, NoThrow, Pure >
using BaseClass = typename Pure< Definition, PureDefinition >::Base
 
- Public Types inherited from dart::Instruction
enum  Tag { FOR_EACH_INSTRUCTION =(DECLARE_TAG) kNumInstructions }
 
enum  SpeculativeMode { kGuardInputs , kNotSpeculative }
 
using InputsIterable = InstructionIndexedPropertyIterable< InputsTrait >
 
using SuccessorsIterable = InstructionIndexedPropertyIterable< SuccessorsTrait >
 
- Static Public Member Functions inherited from dart::Definition
static bool IsArrayLength (Definition *def)
 
- Static Public Member Functions inherited from dart::Instruction
static const ICDataGetICData (const ZoneGrowableArray< const ICData * > &ic_data_array, intptr_t deopt_id, bool is_static_call)
 
static LocationSummaryMakeCallSummary (Zone *zone, const Instruction *instr, LocationSummary *locs=nullptr)
 
static bool SlowPathSharingSupported (bool is_optimizing)
 
- Static Public Attributes inherited from dart::Definition
static constexpr intptr_t kReplacementMarker = -2
 
- Static Public Attributes inherited from dart::Instruction
static const intptr_t kInstructionAttrs [kNumInstructions]
 
- Protected Member Functions inherited from dart::Definition
void set_type (CompileType *type)
 
- Protected Member Functions inherited from dart::Instruction
intptr_t GetDeoptId () const
 
virtual void CopyDeoptIdFrom (const Instruction &instr)
 
void WriteExtraWithoutInputs (FlowGraphSerializer *s)
 
void ReadExtraWithoutInputs (FlowGraphDeserializer *d)
 
- Protected Attributes inherited from dart::TemplateDefinition< 1, NoThrow, Pure >
EmbeddedArray< Value *, Ninputs_
 
- Protected Attributes inherited from dart::Definition
Rangerange_ = nullptr
 

Detailed Description

Definition at line 8050 of file il.h.

Constructor & Destructor Documentation

◆ LoadClassIdInstr()

dart::LoadClassIdInstr::LoadClassIdInstr ( Value object,
Representation  representation = kTagged,
bool  input_can_be_smi = true 
)
inlineexplicit

Definition at line 8052 of file il.h.

8055 : representation_(representation), input_can_be_smi_(input_can_be_smi) {
8057 SetInputAt(0, object);
8058 }
void SetInputAt(intptr_t i, Value *value)
Definition: il.h:1014
virtual Representation representation() const
Definition: il.h:8060
#define ASSERT(E)
static constexpr Representation kUnboxedUword
Definition: locations.h:171

Member Function Documentation

◆ AttributesEqual()

virtual bool dart::LoadClassIdInstr::AttributesEqual ( const Instruction other) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 8070 of file il.h.

8070 {
8071 auto const other_load = other.AsLoadClassId();
8072 return other_load->representation_ == representation_ &&
8073 other_load->input_can_be_smi_ == input_can_be_smi_;
8074 }

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Definition at line 3809 of file il.cc.

3809 {
3810 if (!HasUses()) return nullptr;
3811
3812 const intptr_t cid = object()->Type()->ToCid();
3813 if (cid != kDynamicCid) {
3814 const auto& smi = Smi::ZoneHandle(flow_graph->zone(), Smi::New(cid));
3815 return flow_graph->GetConstant(smi, representation());
3816 }
3817 return this;
3818}
bool HasUses() const
Definition: il.h:2569
Value * object() const
Definition: il.h:8066
static Object & ZoneHandle()
Definition: object.h:419
static SmiPtr New(intptr_t value)
Definition: object.h:10006
CompileType * Type()
@ kDynamicCid
Definition: class_id.h:253
const intptr_t cid

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Definition at line 8068 of file il.h.

8068{ return false; }

◆ ComputeType()

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

Reimplemented from dart::Definition.

Definition at line 1697 of file type_propagator.cc.

1697 {
1698 return CompileType::FromCid(kSmiCid);
1699}
static CompileType FromCid(intptr_t cid)

◆ InferRange() [1/2]

void dart::LoadClassIdInstr::InferRange ( RangeAnalysis analysis,
Range range 
)
virtual

Reimplemented from dart::Definition.

Definition at line 2955 of file range_analysis.cc.

2955 {
2956 uword lower, upper;
2957 InferRange(&lower, &upper);
2960}
Range * range() const
Definition: il.h:2636
void InferRange(uword *lower, uword *upper)
static RangeBoundary FromConstant(int64_t val)
uintptr_t uword
Definition: globals.h:501

◆ InferRange() [2/2]

void dart::LoadClassIdInstr::InferRange ( uword lower,
uword upper 
)

Definition at line 2920 of file range_analysis.cc.

2920 {
2921 ASSERT(kIllegalCid == 0);
2922 *lower = 1;
2923 *upper = kClassIdTagMax;
2924
2925 CompileType* ctype = object()->Type();
2926 intptr_t cid = ctype->ToCid();
2927 if (cid != kDynamicCid) {
2928 *lower = *upper = cid;
2929 } else if (CompilerState::Current().is_aot()) {
2930 IsolateGroup* isolate_group = IsolateGroup::Current();
2931 *upper = isolate_group->has_dynamically_extendable_classes()
2933 : isolate_group->class_table()->NumCids();
2934
2935 HierarchyInfo* hi = Thread::Current()->hierarchy_info();
2936 if (hi != nullptr) {
2937 const auto& type = *ctype->ToAbstractType();
2938 if (type.IsType() && !type.IsFutureOrType() &&
2940 const auto& type_class = Class::Handle(type.type_class());
2941 if (!type_class.has_dynamically_extendable_subtypes()) {
2942 const auto& ranges =
2943 hi->SubtypeRangesForClass(type_class, /*include_abstract=*/false,
2944 /*exclude_null=*/true);
2945 if (ranges.length() > 0) {
2946 *lower = ranges[0].cid_start;
2947 *upper = ranges[ranges.length() - 1].cid_end;
2948 }
2949 }
2950 }
2951 }
2952 }
2953}
GLenum type
static CompilerState & Current()
static bool NullIsAssignableTo(const AbstractType &other)
Definition: object.cc:20674
static IsolateGroup * Current()
Definition: isolate.h:539
static Object & Handle()
Definition: object.h:407
HierarchyInfo * hierarchy_info() const
Definition: thread.h:593
static Thread * Current()
Definition: thread.h:362
@ kIllegalCid
Definition: class_id.h:214
static constexpr intptr_t kClassIdTagMax
Definition: class_id.h:22

◆ object()

Value * dart::LoadClassIdInstr::object ( ) const
inline

Definition at line 8066 of file il.h.

8066{ return inputs_[0]; }
EmbeddedArray< Value *, N > inputs_
Definition: il.h:2762

◆ representation()

virtual Representation dart::LoadClassIdInstr::representation ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 8060 of file il.h.

8060{ return representation_; }

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