Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::LoadClassIdInstr Class Reference

#include <il.h>

Inheritance diagram for dart::LoadClassIdInstr:
dart::TemplateDefinition< 1, NoThrow, Pure >

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
 

Additional Inherited Members

- Public Types inherited from dart::TemplateDefinition< 1, NoThrow, Pure >
using BaseClass = typename Pure< Definition, PureDefinition >::Base
 
- Protected Attributes inherited from dart::TemplateDefinition< 1, NoThrow, Pure >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 8002 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 8004 of file il.h.

8007 : representation_(representation), input_can_be_smi_(input_can_be_smi) {
8009 SetInputAt(0, object);
8010 }
virtual Representation representation() const
Definition il.h:8012
#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

Definition at line 8022 of file il.h.

8022 {
8023 auto const other_load = other.AsLoadClassId();
8024 return other_load->representation_ == representation_ &&
8025 other_load->input_can_be_smi_ == input_can_be_smi_;
8026 }

◆ Canonicalize()

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

Definition at line 3811 of file il.cc.

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

◆ ComputeCanDeoptimize()

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

Definition at line 8020 of file il.h.

8020{ return false; }

◆ ComputeType()

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

Definition at line 1705 of file type_propagator.cc.

1705 {
1706 return CompileType::FromCid(kSmiCid);
1707}
static CompileType FromCid(intptr_t cid)

◆ InferRange() [1/2]

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

Definition at line 2950 of file range_analysis.cc.

2950 {
2951 uword lower, upper;
2952 InferRange(&lower, &upper);
2953 *range = Range(RangeBoundary::FromConstant(lower),
2955}
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 *upper = IsolateGroup::Current()->class_table()->NumCids();
2931
2932 HierarchyInfo* hi = Thread::Current()->hierarchy_info();
2933 if (hi != nullptr) {
2934 const auto& type = *ctype->ToAbstractType();
2935 if (type.IsType() && !type.IsFutureOrType() &&
2937 const auto& type_class = Class::Handle(type.type_class());
2938 const auto& ranges =
2939 hi->SubtypeRangesForClass(type_class, /*include_abstract=*/false,
2940 /*exclude_null=*/true);
2941 if (ranges.length() > 0) {
2942 *lower = ranges[0].cid_start;
2943 *upper = ranges[ranges.length() - 1].cid_end;
2944 }
2945 }
2946 }
2947 }
2948}
intptr_t NumCids() const
static CompilerState & Current()
static bool NullIsAssignableTo(const AbstractType &other)
Definition object.cc:20715
static IsolateGroup * Current()
Definition isolate.h:534
ClassTable * class_table() const
Definition isolate.h:491
static Object & Handle()
Definition object.h:407
HierarchyInfo * hierarchy_info() const
Definition thread.h:588
static Thread * Current()
Definition thread.h:361
@ 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 8018 of file il.h.

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

◆ representation()

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

Definition at line 8012 of file il.h.

8012{ return representation_; }

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