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

#include <il.h>

Inheritance diagram for dart::BoxInstr:
dart::TemplateDefinition< 1, NoThrow, Pure > dart::PureDefinition dart::Definition dart::Instruction dart::ZoneAllocated dart::BoxIntegerInstr dart::BoxInt64Instr dart::BoxInteger32Instr dart::BoxSmallIntInstr dart::BoxInt32Instr dart::BoxUint32Instr

Public Member Functions

Valuevalue () const
 
Representation from_representation () const
 
virtual CompileType ComputeType () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual intptr_t DeoptimizationTarget () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
virtual bool AttributesEqual (const Instruction &other) const
 
DefinitionCanonicalize (FlowGraph *flow_graph)
 
virtual TokenPosition token_pos () const
 
virtual SpeculativeMode SpeculativeModeOfInput (intptr_t index) const
 
 DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS (BoxInstr, TemplateDefinition, FIELD_LIST) protected
 
- 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)
 

Static Public Member Functions

static BoxInstrCreate (Representation from, Value *value)
 
- 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)
 

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

Member Function Documentation

◆ AttributesEqual()

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

Reimplemented from dart::Instruction.

Definition at line 8542 of file il.h.

8542 {
8543 return other.AsBox()->from_representation() == from_representation();
8544 }
Representation from_representation() const
Definition: il.h:8529

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Reimplemented in dart::BoxIntegerInstr, and dart::BoxInt64Instr.

Definition at line 3195 of file il.cc.

3195 {
3196 if (input_use_list() == nullptr) {
3197 // Environments can accommodate any representation. No need to box.
3198 return value()->definition();
3199 }
3200
3201 // Fold away Box<rep>(v) if v has a target representation already.
3202 Definition* value_defn = value()->definition();
3203 if (value_defn->representation() == representation()) {
3204 return value_defn;
3205 }
3206
3207 // Fold away Box<rep>(Unbox<rep>(v)) if value is known to be of the
3208 // right class.
3209 UnboxInstr* unbox_defn = value()->definition()->AsUnbox();
3210 if ((unbox_defn != nullptr) &&
3211 (unbox_defn->representation() == from_representation()) &&
3212 (unbox_defn->value()->Type()->ToCid() == Type()->ToCid())) {
3213 if (from_representation() == kUnboxedFloat) {
3214 // This is a narrowing conversion.
3215 return this;
3216 }
3217 return unbox_defn->value()->definition();
3218 }
3219
3220 if (value()->BindsToConstant()) {
3221 switch (representation()) {
3222 case kUnboxedFloat64x2:
3223 ASSERT(value()->BoundConstant().IsFloat64x2());
3224 return flow_graph->GetConstant(value()->BoundConstant(), kTagged);
3225 case kUnboxedFloat32x4:
3226 ASSERT(value()->BoundConstant().IsFloat32x4());
3227 return flow_graph->GetConstant(value()->BoundConstant(), kTagged);
3228 case kUnboxedInt32x4:
3229 ASSERT(value()->BoundConstant().IsInt32x4());
3230 return flow_graph->GetConstant(value()->BoundConstant(), kTagged);
3231 default:
3232 return this;
3233 }
3234 }
3235
3236 return this;
3237}
Value * value() const
Definition: il.h:8528
Value * input_use_list() const
Definition: il.h:2575
Definition(intptr_t deopt_id=DeoptId::kNone)
Definition: il.h:2488
virtual Representation representation() const
Definition: il.h:1260
Definition * definition() const
Definition: il.h:103
#define ASSERT(E)

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Definition at line 8534 of file il.h.

8534{ return false; }

◆ ComputeType()

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

Reimplemented from dart::Definition.

Reimplemented in dart::BoxIntegerInstr.

Definition at line 1795 of file type_propagator.cc.

1795 {
1797}
static CompileType FromUnboxedRepresentation(Representation rep)

◆ Create()

BoxInstr * dart::BoxInstr::Create ( Representation  from,
Value value 
)
static

Definition at line 4007 of file il.cc.

4007 {
4008 switch (from) {
4009 case kUnboxedInt8:
4010 case kUnboxedUint8:
4011 case kUnboxedInt16:
4012 case kUnboxedUint16:
4013#if defined(HAS_SMI_63_BITS)
4014 case kUnboxedInt32:
4015 case kUnboxedUint32:
4016#endif
4017 return new BoxSmallIntInstr(from, value);
4018
4019#if !defined(HAS_SMI_63_BITS)
4020 case kUnboxedInt32:
4021 return new BoxInt32Instr(value);
4022
4023 case kUnboxedUint32:
4024 return new BoxUint32Instr(value);
4025#endif
4026
4027 case kUnboxedInt64:
4028 return new BoxInt64Instr(value);
4029
4030 case kUnboxedDouble:
4031 case kUnboxedFloat:
4032 case kUnboxedFloat32x4:
4033 case kUnboxedFloat64x2:
4034 case kUnboxedInt32x4:
4035 return new BoxInstr(from, value);
4036
4037 default:
4038 UNREACHABLE();
4039 return nullptr;
4040 }
4041}
#define UNREACHABLE()
Definition: assert.h:248

◆ DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS()

dart::BoxInstr::DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS ( BoxInstr  ,
TemplateDefinition  ,
FIELD_LIST   
)
inline

Definition at line 8556 of file il.h.

8561 :
8563 : from_representation_(from_representation) {
8564 SetInputAt(0, value);
8565 }
void SetInputAt(intptr_t i, Value *value)
Definition: il.h:1014
Representation
Definition: locations.h:66

◆ DeoptimizationTarget()

virtual intptr_t dart::BoxInstr::DeoptimizationTarget ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 8535 of file il.h.

8535{ return DeoptId::kNone; }
static constexpr intptr_t kNone
Definition: deopt_id.h:27

◆ from_representation()

Representation dart::BoxInstr::from_representation ( ) const
inline

Definition at line 8529 of file il.h.

8529{ return from_representation_; }

◆ RequiredInputRepresentation()

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

Reimplemented from dart::Instruction.

Definition at line 8537 of file il.h.

8537 {
8538 ASSERT(idx == 0);
8539 return from_representation();
8540 }

◆ SpeculativeModeOfInput()

virtual SpeculativeMode dart::BoxInstr::SpeculativeModeOfInput ( intptr_t  index) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 8550 of file il.h.

8550 {
8551 return kNotSpeculative;
8552 }
@ kNotSpeculative
Definition: il.h:975

◆ token_pos()

virtual TokenPosition dart::BoxInstr::token_pos ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 8548 of file il.h.

8548{ return TokenPosition::kBox; }

◆ value()

Value * dart::BoxInstr::value ( ) const
inline

Definition at line 8528 of file il.h.

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

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