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

#include <il.h>

Inheritance diagram for dart::LoadCodeUnitsInstr:
dart::TemplateDefinition< 2, NoThrow >

Public Member Functions

 LoadCodeUnitsInstr (Value *str, Value *index, intptr_t element_count, intptr_t class_id, const InstructionSource &source)
 
TokenPosition token_pos () const
 
virtual CompileType ComputeType () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
bool IsExternal () const
 
Valuearray () const
 
Valueindex () const
 
intptr_t index_scale () const
 
intptr_t class_id () const
 
intptr_t element_count () const
 
bool can_pack_into_smi () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual Representation representation () const
 
void set_representation (Representation repr)
 
virtual void InferRange (RangeAnalysis *analysis, Range *range)
 
virtual bool HasUnknownSideEffects () const
 
virtual bool CanTriggerGC () const
 
- Public Member Functions inherited from dart::TemplateDefinition< 2, NoThrow >
 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< 2, NoThrow >
using BaseClass = typename NoCSE< Definition, PureDefinition >::Base
 
- Protected Attributes inherited from dart::TemplateDefinition< 2, NoThrow >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 6812 of file il.h.

Constructor & Destructor Documentation

◆ LoadCodeUnitsInstr()

dart::LoadCodeUnitsInstr::LoadCodeUnitsInstr ( Value str,
Value index,
intptr_t  element_count,
intptr_t  class_id,
const InstructionSource source 
)
inline

Definition at line 6814 of file il.h.

6820 class_id_(class_id),
6821 token_pos_(source.token_pos),
6822 element_count_(element_count),
6823 representation_(kTagged) {
6824 ASSERT(element_count == 1 || element_count == 2 || element_count == 4);
6826 SetInputAt(0, str);
6827 SetInputAt(1, index);
6828 }
Value * index() const
Definition il.h:6849
intptr_t element_count() const
Definition il.h:6856
intptr_t class_id() const
Definition il.h:6855
TemplateDefinition(intptr_t deopt_id=DeoptId::kNone)
Definition il.h:2731
#define ASSERT(E)
SkBitmap source
Definition examples.cpp:28
bool IsStringClassId(intptr_t index)
Definition class_id.h:350

Member Function Documentation

◆ array()

Value * dart::LoadCodeUnitsInstr::array ( ) const
inline

Definition at line 6848 of file il.h.

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

◆ can_pack_into_smi()

bool dart::LoadCodeUnitsInstr::can_pack_into_smi ( ) const
inline

Definition at line 6858 of file il.h.

6858 {
6859 return element_count() <=
6860 compiler::target::kSmiBits / (index_scale() * kBitsPerByte);
6861 }
intptr_t index_scale() const
Definition il.h:6851
constexpr intptr_t kBitsPerByte
Definition globals.h:463

◆ CanTriggerGC()

virtual bool dart::LoadCodeUnitsInstr::CanTriggerGC ( ) const
inlinevirtual

Definition at line 6871 of file il.h.

6871 {
6872 return !can_pack_into_smi() && (representation() == kTagged);
6873 }
virtual Representation representation() const
Definition il.h:6865
bool can_pack_into_smi() const
Definition il.h:6858

◆ class_id()

intptr_t dart::LoadCodeUnitsInstr::class_id ( ) const
inline

Definition at line 6855 of file il.h.

6855{ return class_id_; }

◆ ComputeCanDeoptimize()

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

Definition at line 6863 of file il.h.

6863{ return false; }

◆ ComputeType()

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

Definition at line 1738 of file type_propagator.cc.

1738 {
1739 switch (class_id()) {
1740 case kOneByteStringCid:
1741 case kTwoByteStringCid:
1742 return can_pack_into_smi() ? CompileType::FromCid(kSmiCid)
1743 : CompileType::Int();
1744 default:
1745 UNIMPLEMENTED();
1746 return CompileType::Dynamic();
1747 }
1748}
static CompileType FromCid(intptr_t cid)
static CompileType Dynamic()
#define UNIMPLEMENTED

◆ element_count()

intptr_t dart::LoadCodeUnitsInstr::element_count ( ) const
inline

Definition at line 6856 of file il.h.

6856{ return element_count_; }

◆ HasUnknownSideEffects()

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

Definition at line 6869 of file il.h.

6869{ return false; }

◆ index()

Value * dart::LoadCodeUnitsInstr::index ( ) const
inline

Definition at line 6849 of file il.h.

6849{ return inputs_[1]; }

◆ index_scale()

intptr_t dart::LoadCodeUnitsInstr::index_scale ( ) const
inline

Definition at line 6851 of file il.h.

6851 {
6852 return compiler::target::Instance::ElementSizeFor(class_id_);
6853 }

◆ InferRange()

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

Definition at line 2957 of file range_analysis.cc.

2957 {
2959 RangeBoundary zero = RangeBoundary::FromConstant(0);
2960 // Take the number of loaded characters into account when determining the
2961 // range of the result.
2962 ASSERT(element_count_ > 0);
2963 switch (class_id()) {
2964 case kOneByteStringCid:
2965 ASSERT(element_count_ <= 4);
2966 *range = Range(zero, RangeBoundary::FromConstant(
2967 Utils::NBitMask(kBitsPerByte * element_count_)));
2968 break;
2969 case kTwoByteStringCid:
2970 ASSERT(element_count_ <= 2);
2971 *range = Range(zero, RangeBoundary::FromConstant(Utils::NBitMask(
2972 2 * kBitsPerByte * element_count_)));
2973 break;
2974 default:
2975 UNREACHABLE();
2976 break;
2977 }
2978}
#define UNREACHABLE()
Definition assert.h:248
static RangeBoundary FromConstant(int64_t val)
static constexpr T NBitMask(size_t n)
Definition utils.h:533

◆ IsExternal()

bool dart::LoadCodeUnitsInstr::IsExternal ( ) const
inline

Definition at line 6844 of file il.h.

6844 {
6845 return array()->definition()->representation() == kUntagged;
6846 }
virtual Representation representation() const
Definition il.h:1254
Value * array() const
Definition il.h:6848
Definition * definition() const
Definition il.h:103

◆ representation()

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

Definition at line 6865 of file il.h.

6865{ return representation_; }

◆ RequiredInputRepresentation()

virtual Representation dart::LoadCodeUnitsInstr::RequiredInputRepresentation ( intptr_t  idx) const
inlinevirtual

Definition at line 6835 of file il.h.

6835 {
6836 if (idx == 0) {
6837 // The string may be tagged or untagged (for external strings).
6838 return kNoRepresentation;
6839 }
6840 ASSERT(idx == 1);
6841 return kTagged;
6842 }

◆ set_representation()

void dart::LoadCodeUnitsInstr::set_representation ( Representation  repr)
inline

Definition at line 6866 of file il.h.

6866{ representation_ = repr; }

◆ token_pos()

TokenPosition dart::LoadCodeUnitsInstr::token_pos ( ) const
inline

Definition at line 6830 of file il.h.

6830{ return token_pos_; }

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