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

#include <il.h>

Inheritance diagram for dart::UnaryIntegerOpInstr:
dart::TemplateDefinition< 1, NoThrow, Pure > dart::UnaryInt64OpInstr dart::UnarySmiOpInstr dart::UnaryUint32OpInstr

Public Member Functions

 UnaryIntegerOpInstr (Token::Kind op_kind, Value *value, intptr_t deopt_id)
 
Valuevalue () const
 
Token::Kind op_kind () const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
virtual bool AttributesEqual (const Instruction &other) const
 
virtual intptr_t DeoptimizationTarget () const
 
- 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 UnaryIntegerOpInstrMake (Representation representation, Token::Kind op_kind, Value *value, intptr_t deopt_id, SpeculativeMode speculative_mode, Range *range)
 

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

Constructor & Destructor Documentation

◆ UnaryIntegerOpInstr()

dart::UnaryIntegerOpInstr::UnaryIntegerOpInstr ( Token::Kind  op_kind,
Value value,
intptr_t  deopt_id 
)
inline

Definition at line 9179 of file il.h.

9180 : TemplateDefinition(deopt_id), op_kind_(op_kind) {
9181 ASSERT((op_kind == Token::kNEGATE) || (op_kind == Token::kBIT_NOT));
9182 SetInputAt(0, value);
9183 }
TemplateDefinition(intptr_t deopt_id=DeoptId::kNone)
Definition il.h:2731
Value * value() const
Definition il.h:9192
Token::Kind op_kind() const
Definition il.h:9193
#define ASSERT(E)

Member Function Documentation

◆ AttributesEqual()

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

Reimplemented in dart::UnaryInt64OpInstr.

Definition at line 9197 of file il.h.

9197 {
9198 return other.AsUnaryIntegerOp()->op_kind() == op_kind();
9199 }

◆ Canonicalize()

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

Definition at line 2384 of file il.cc.

2384 {
2385 // If range analysis has already determined a single possible value for
2386 // this operation, then replace it if possible.
2387 if (RangeUtils::IsSingleton(range()) && CanReplaceWithConstant()) {
2388 const auto& value =
2389 Integer::Handle(Integer::NewCanonical(range()->Singleton()));
2390 auto* const replacement =
2391 flow_graph->TryCreateConstantReplacementFor(this, value);
2392 if (replacement != this) {
2393 return replacement;
2394 }
2395 }
2396
2397 return this;
2398}
static IntegerPtr NewCanonical(const String &str)
Definition object.cc:23078
static Object & Handle()
Definition object.h:407
static bool IsSingleton(Range *range)

◆ DeoptimizationTarget()

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

Definition at line 9201 of file il.h.

9201 {
9202 // Direct access since this instruction cannot deoptimize, and the deopt-id
9203 // was inherited from another instruction that could deoptimize.
9204 return GetDeoptId();
9205 }

◆ Make()

UnaryIntegerOpInstr * dart::UnaryIntegerOpInstr::Make ( Representation  representation,
Token::Kind  op_kind,
Value value,
intptr_t  deopt_id,
SpeculativeMode  speculative_mode,
Range range 
)
static

Definition at line 2248 of file il.cc.

2253 {
2254 UnaryIntegerOpInstr* op = nullptr;
2255 switch (representation) {
2256 case kTagged:
2257 op = new UnarySmiOpInstr(op_kind, value, deopt_id);
2258 break;
2259 case kUnboxedInt32:
2260 return nullptr;
2261 case kUnboxedUint32:
2262 op = new UnaryUint32OpInstr(op_kind, value, deopt_id);
2263 break;
2264 case kUnboxedInt64:
2265 op = new UnaryInt64OpInstr(op_kind, value, deopt_id, speculative_mode);
2266 break;
2267 default:
2268 UNREACHABLE();
2269 return nullptr;
2270 }
2271
2272 if (op == nullptr) {
2273 return op;
2274 }
2275
2276 if (!Range::IsUnknown(range)) {
2277 op->set_range(*range);
2278 }
2279
2280 ASSERT(op->representation() == representation);
2281 return op;
2282}
#define UNREACHABLE()
Definition assert.h:248
static bool IsUnknown(const Range *other)
UnaryIntegerOpInstr(Token::Kind op_kind, Value *value, intptr_t deopt_id)
Definition il.h:9179

◆ op_kind()

Token::Kind dart::UnaryIntegerOpInstr::op_kind ( ) const
inline

Definition at line 9193 of file il.h.

9193{ return op_kind_; }

◆ value()

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

Definition at line 9192 of file il.h.

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

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