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

#include <il.h>

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

Public Member Functions

 BoxIntegerInstr (Representation representation, Value *value)
 
virtual bool ValueFitsSmi () const
 
virtual void InferRange (RangeAnalysis *analysis, Range *range)
 
virtual CompileType ComputeType () const
 
virtual bool RecomputeType ()
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
virtual bool CanTriggerGC () const
 
- Public Member Functions inherited from dart::BoxInstr
Valuevalue () const
 
Representation from_representation () 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
 

Additional Inherited Members

- Public Types inherited from dart::TemplateDefinition< 1, NoThrow, Pure >
using BaseClass = typename Pure< Definition, PureDefinition >::Base
 
- Static Public Member Functions inherited from dart::BoxInstr
static BoxInstrCreate (Representation from, Value *value)
 
- Protected Attributes inherited from dart::TemplateDefinition< 1, NoThrow, Pure >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 8527 of file il.h.

Constructor & Destructor Documentation

◆ BoxIntegerInstr()

dart::BoxIntegerInstr::BoxIntegerInstr ( Representation  representation,
Value value 
)
inline

Definition at line 8529 of file il.h.

8530 : BoxInstr(representation, value) {}
Value * value() const
Definition il.h:8480

Member Function Documentation

◆ Canonicalize()

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

Reimplemented in dart::BoxInt64Instr.

Definition at line 3249 of file il.cc.

3249 {
3250 if (input_use_list() == nullptr) {
3251 // Environments can accommodate any representation. No need to box.
3252 return value()->definition();
3253 }
3254
3255 // Fold away Box<rep>(v) if v has a target representation already.
3256 Definition* value_defn = value()->definition();
3257 if (value_defn->representation() == representation()) {
3258 return value_defn;
3259 }
3260
3261 return this;
3262}
Definition * definition() const
Definition il.h:103

◆ CanTriggerGC()

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

Definition at line 8541 of file il.h.

8541{ return !ValueFitsSmi(); }
virtual bool ValueFitsSmi() const
Definition il.cc:3244

◆ ComputeType()

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

Reimplemented from dart::BoxInstr.

Definition at line 1766 of file type_propagator.cc.

1766 {
1767 return ValueFitsSmi() ? CompileType::FromCid(kSmiCid)
1768 : BoxInstr::ComputeType();
1769}
virtual CompileType ComputeType() const
static CompileType FromCid(intptr_t cid)

◆ InferRange()

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

Definition at line 3064 of file range_analysis.cc.

3064 {
3065 const Range* value_range = value()->definition()->range();
3066 if (Range::IsUnknown(value_range)) {
3067 *range = Range::Full(from_representation());
3068 } else {
3069 ASSERT_VALID_RANGE_FOR_REPRESENTATION(value()->definition(), value_range,
3071 *range = *value_range;
3072 }
3073}
Representation from_representation() const
Definition il.h:8481
Range * range() const
Definition il.h:2618
static bool IsUnknown(const Range *other)
static Range Full(RangeBoundary::RangeSize size)
#define ASSERT_VALID_RANGE_FOR_REPRESENTATION(instr, range, representation)

◆ RecomputeType()

bool dart::BoxIntegerInstr::RecomputeType ( )
virtual

Definition at line 1771 of file type_propagator.cc.

1771 {
1772 return UpdateType(ComputeType());
1773}

◆ ValueFitsSmi()

bool dart::BoxIntegerInstr::ValueFitsSmi ( ) const
virtual

Reimplemented in dart::BoxSmallIntInstr.

Definition at line 3244 of file il.cc.

3244 {
3245 Range* range = value()->definition()->range();
3247}
static bool Fits(Range *range, RangeBoundary::RangeSize size)

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