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

#include <il.h>

Inheritance diagram for dart::BinaryInt32OpInstr:
dart::BinaryIntegerOpInstr dart::TemplateDefinition< 2, NoThrow, Pure >

Public Member Functions

 BinaryInt32OpInstr (Token::Kind op_kind, Value *left, Value *right, intptr_t deopt_id)
 
virtual bool ComputeCanDeoptimize () const
 
virtual Representation representation () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
- Public Member Functions inherited from dart::BinaryIntegerOpInstr
 BinaryIntegerOpInstr (Token::Kind op_kind, Value *left, Value *right, intptr_t deopt_id)
 
Token::Kind op_kind () const
 
Valueleft () const
 
Valueright () const
 
bool can_overflow () const
 
void set_can_overflow (bool overflow)
 
bool is_truncating () const
 
void mark_truncating ()
 
bool RightIsNonZero () const
 
bool RightIsPowerOfTwoConstant () const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
virtual bool AttributesEqual (const Instruction &other) const
 
virtual intptr_t DeoptimizationTarget () const
 
virtual void InferRange (RangeAnalysis *analysis, Range *range)
 
- Public Member Functions inherited from dart::TemplateDefinition< 2, 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 bool IsSupported (Token::Kind op_kind, Value *left, Value *right)
 
- Static Public Member Functions inherited from dart::BinaryIntegerOpInstr
static BinaryIntegerOpInstrMake (Representation representation, Token::Kind op_kind, Value *left, Value *right, intptr_t deopt_id, SpeculativeMode speculative_mode=kGuardInputs)
 
static BinaryIntegerOpInstrMake (Representation representation, Token::Kind op_kind, Value *left, Value *right, intptr_t deopt_id, bool can_overflow, bool is_truncating, Range *range, SpeculativeMode speculative_mode=kGuardInputs)
 

Additional Inherited Members

- Public Types inherited from dart::TemplateDefinition< 2, NoThrow, Pure >
using BaseClass = typename Pure< Definition, PureDefinition >::Base
 
- Protected Attributes inherited from dart::TemplateDefinition< 2, NoThrow, Pure >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 9438 of file il.h.

Constructor & Destructor Documentation

◆ BinaryInt32OpInstr()

dart::BinaryInt32OpInstr::BinaryInt32OpInstr ( Token::Kind  op_kind,
Value left,
Value right,
intptr_t  deopt_id 
)
inline

Definition at line 9440 of file il.h.

9444 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {
9445 SetInputAt(0, left);
9446 SetInputAt(1, right);
9447 }
Value * right() const
Definition il.h:9350
Token::Kind op_kind() const
Definition il.h:9348
Value * left() const
Definition il.h:9349
BinaryIntegerOpInstr(Token::Kind op_kind, Value *left, Value *right, intptr_t deopt_id)
Definition il.h:9317

Member Function Documentation

◆ ComputeCanDeoptimize()

bool dart::BinaryInt32OpInstr::ComputeCanDeoptimize ( ) const
virtual

Definition at line 2052 of file il.cc.

2052 {
2053 switch (op_kind()) {
2054 case Token::kBIT_AND:
2055 case Token::kBIT_OR:
2056 case Token::kBIT_XOR:
2057 return false;
2058
2059 case Token::kSHR:
2060 return false;
2061
2062 case Token::kUSHR:
2063 case Token::kSHL:
2064 // Currently only shifts by in range constant are supported, see
2065 // BinaryInt32OpInstr::IsSupported.
2066 return can_overflow();
2067
2068 case Token::kMOD: {
2069 UNREACHABLE();
2070 }
2071
2072 default:
2073 return can_overflow();
2074 }
2075}
#define UNREACHABLE()
Definition assert.h:248
bool can_overflow() const
Definition il.h:9352

◆ IsSupported()

static bool dart::BinaryInt32OpInstr::IsSupported ( Token::Kind  op_kind,
Value left,
Value right 
)
inlinestatic

Definition at line 9449 of file il.h.

9449 {
9450#if defined(TARGET_ARCH_IS_32_BIT)
9451 switch (op_kind) {
9452 case Token::kADD:
9453 case Token::kSUB:
9454 case Token::kMUL:
9455 case Token::kBIT_AND:
9456 case Token::kBIT_OR:
9457 case Token::kBIT_XOR:
9458 return true;
9459
9460 case Token::kSHL:
9461 case Token::kSHR:
9462 case Token::kUSHR:
9463 if (right->BindsToConstant() && right->BoundConstant().IsSmi()) {
9464 const intptr_t value = Smi::Cast(right->BoundConstant()).Value();
9465 return 0 <= value && value < kBitsPerWord;
9466 }
9467 return false;
9468
9469 default:
9470 return false;
9471 }
9472#else
9473 return false;
9474#endif
9475 }
bool BindsToConstant() const
Definition il.cc:1181
const Object & BoundConstant() const
Definition il.cc:1199
uint8_t value
constexpr intptr_t kBitsPerWord
Definition globals.h:514

◆ representation()

virtual Representation dart::BinaryInt32OpInstr::representation ( ) const
inlinevirtual

Definition at line 9479 of file il.h.

9479{ return kUnboxedInt32; }

◆ RequiredInputRepresentation()

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

Definition at line 9481 of file il.h.

9481 {
9482 ASSERT((idx == 0) || (idx == 1));
9483 return kUnboxedInt32;
9484 }
#define ASSERT(E)

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