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

#include <il.h>

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

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
 
- 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< 2, NoThrow >
using BaseClass = typename NoCSE< 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::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::Instruction
static const intptr_t kInstructionAttrs [kNumInstructions]
 
- 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< 2, NoThrow >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

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

6864 class_id_(class_id),
6865 token_pos_(source.token_pos),
6866 element_count_(element_count),
6867 representation_(kTagged) {
6868 ASSERT(element_count == 1 || element_count == 2 || element_count == 4);
6870 SetInputAt(0, str);
6871 SetInputAt(1, index);
6872 }
void SetInputAt(intptr_t i, Value *value)
Definition: il.h:1014
InstructionSource source() const
Definition: il.h:1008
Value * index() const
Definition: il.h:6893
intptr_t element_count() const
Definition: il.h:6900
intptr_t class_id() const
Definition: il.h:6899
TemplateDefinition(intptr_t deopt_id=DeoptId::kNone)
Definition: il.h:2749
#define ASSERT(E)
bool IsStringClassId(intptr_t index)
Definition: class_id.h:350
const TokenPosition token_pos

Member Function Documentation

◆ array()

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

Definition at line 6892 of file il.h.

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

◆ can_pack_into_smi()

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

Definition at line 6902 of file il.h.

6902 {
6903 return element_count() <=
6905 }
intptr_t index_scale() const
Definition: il.h:6895
constexpr intptr_t kSmiBits
Definition: runtime_api.h:301
constexpr intptr_t kBitsPerByte
Definition: globals.h:463

◆ CanTriggerGC()

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

Reimplemented from dart::Instruction.

Definition at line 6915 of file il.h.

6915 {
6916 return !can_pack_into_smi() && (representation() == kTagged);
6917 }
virtual Representation representation() const
Definition: il.h:6909
bool can_pack_into_smi() const
Definition: il.h:6902

◆ class_id()

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

Definition at line 6899 of file il.h.

6899{ return class_id_; }

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Definition at line 6907 of file il.h.

6907{ return false; }

◆ ComputeType()

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

Definition at line 1730 of file type_propagator.cc.

1730 {
1731 switch (class_id()) {
1732 case kOneByteStringCid:
1733 case kTwoByteStringCid:
1734 return can_pack_into_smi() ? CompileType::FromCid(kSmiCid)
1735 : CompileType::Int();
1736 default:
1737 UNIMPLEMENTED();
1738 return CompileType::Dynamic();
1739 }
1740}
static CompileType FromCid(intptr_t cid)
static CompileType Dynamic()
#define UNIMPLEMENTED

◆ element_count()

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

Definition at line 6900 of file il.h.

6900{ return element_count_; }

◆ HasUnknownSideEffects()

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

Implements dart::Instruction.

Definition at line 6913 of file il.h.

6913{ return false; }

◆ index()

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

Definition at line 6893 of file il.h.

6893{ return inputs_[1]; }

◆ index_scale()

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

Definition at line 6895 of file il.h.

6895 {
6897 }
static word ElementSizeFor(intptr_t cid)
Definition: runtime_api.cc:581

◆ InferRange()

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

Definition at line 2962 of file range_analysis.cc.

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

◆ IsExternal()

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

Definition at line 6888 of file il.h.

6888 {
6889 return array()->definition()->representation() == kUntagged;
6890 }
virtual Representation representation() const
Definition: il.h:1260
Value * array() const
Definition: il.h:6892
Definition * definition() const
Definition: il.h:103

◆ representation()

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

Reimplemented from dart::Instruction.

Definition at line 6909 of file il.h.

6909{ return representation_; }

◆ RequiredInputRepresentation()

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

Reimplemented from dart::Instruction.

Definition at line 6879 of file il.h.

6879 {
6880 if (idx == 0) {
6881 // The string may be tagged or untagged (for external strings).
6882 return kNoRepresentation;
6883 }
6884 ASSERT(idx == 1);
6885 return kTagged;
6886 }

◆ set_representation()

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

Definition at line 6910 of file il.h.

6910{ representation_ = repr; }

◆ token_pos()

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

Reimplemented from dart::Instruction.

Definition at line 6874 of file il.h.

6874{ return token_pos_; }

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