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

#include <il.h>

Inheritance diagram for dart::BoxInt64Instr:
dart::BoxIntegerInstr dart::BoxInstr dart::TemplateDefinition< 1, NoThrow, Pure >

Public Member Functions

 BoxInt64Instr (Value *value)
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
- Public Member Functions inherited from dart::BoxIntegerInstr
 BoxIntegerInstr (Representation representation, Value *value)
 
virtual bool ValueFitsSmi () const
 
virtual void InferRange (RangeAnalysis *analysis, Range *range)
 
virtual CompileType ComputeType () const
 
virtual bool RecomputeType ()
 
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 8608 of file il.h.

Constructor & Destructor Documentation

◆ BoxInt64Instr()

dart::BoxInt64Instr::BoxInt64Instr ( Value value)
inlineexplicit

Definition at line 8610 of file il.h.

8611 : BoxIntegerInstr(kUnboxedInt64, value) {}
Value * value() const
Definition il.h:8480
BoxIntegerInstr(Representation representation, Value *value)
Definition il.h:8529

Member Function Documentation

◆ Canonicalize()

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

Reimplemented from dart::BoxIntegerInstr.

Definition at line 3264 of file il.cc.

3264 {
3265 Definition* replacement = BoxIntegerInstr::Canonicalize(flow_graph);
3266 if (replacement != this) {
3267 return replacement;
3268 }
3269
3270 // For all x, box(unbox(x)) = x.
3271 if (auto unbox = value()->definition()->AsUnboxInt64()) {
3272 if (unbox->SpeculativeModeOfInputs() == kNotSpeculative) {
3273 return unbox->value()->definition();
3274 }
3275 } else if (auto unbox = value()->definition()->AsUnboxedConstant()) {
3276 return flow_graph->GetConstant(unbox->value());
3277 }
3278
3279 // Find a more precise box instruction.
3280 if (auto conv = value()->definition()->AsIntConverter()) {
3281 Definition* replacement;
3282 if (conv->from() == kUntagged) {
3283 return this;
3284 }
3285 switch (conv->from()) {
3286 case kUnboxedInt32:
3287 replacement = new BoxInt32Instr(conv->value()->CopyWithType());
3288 break;
3289 case kUnboxedUint32:
3290 replacement = new BoxUint32Instr(conv->value()->CopyWithType());
3291 break;
3292 default:
3293 UNREACHABLE();
3294 break;
3295 }
3296 flow_graph->InsertBefore(this, replacement, nullptr, FlowGraph::kValue);
3297 return replacement;
3298 }
3299
3300 return this;
3301}
#define UNREACHABLE()
Definition assert.h:248
virtual Definition * Canonicalize(FlowGraph *flow_graph)
Definition il.cc:3249

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