Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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::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
 

Static Public Member Functions

static BoxInstrCreate (Representation from, Value *value)
 

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

Member Function Documentation

◆ AttributesEqual()

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

Definition at line 8494 of file il.h.

8494 {
8495 return other.AsBox()->from_representation() == from_representation();
8496 }
Representation from_representation() const
Definition il.h:8481

◆ Canonicalize()

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

Definition at line 3186 of file il.cc.

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

◆ ComputeCanDeoptimize()

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

Definition at line 8486 of file il.h.

8486{ return false; }

◆ ComputeType()

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

Reimplemented in dart::BoxIntegerInstr.

Definition at line 1803 of file type_propagator.cc.

1803 {
1805}
static CompileType FromUnboxedRepresentation(Representation rep)

◆ Create()

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

Definition at line 4009 of file il.cc.

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

◆ DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS()

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

Definition at line 8508 of file il.h.

8513 :
8515 : from_representation_(from_representation) {
8516 SetInputAt(0, value);
8517 }
Representation
Definition locations.h:66

◆ DeoptimizationTarget()

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

Definition at line 8487 of file il.h.

8487{ 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 8481 of file il.h.

8481{ return from_representation_; }

◆ RequiredInputRepresentation()

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

Definition at line 8489 of file il.h.

8489 {
8490 ASSERT(idx == 0);
8491 return from_representation();
8492 }

◆ SpeculativeModeOfInput()

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

Definition at line 8502 of file il.h.

8502 {
8503 return kNotSpeculative;
8504 }

◆ token_pos()

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

Definition at line 8500 of file il.h.

8500{ return TokenPosition::kBox; }

◆ value()

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

Definition at line 8480 of file il.h.

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

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