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

#include <il.h>

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

Public Member Functions

 BinarySmiOpInstr (Token::Kind op_kind, Value *left, Value *right, intptr_t deopt_id, Range *right_range=nullptr)
 
virtual bool ComputeCanDeoptimize () const
 
virtual void InferRange (RangeAnalysis *analysis, Range *range)
 
virtual CompileType ComputeType () const
 
Rangeright_range () 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
 
- 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
 

Additional Inherited Members

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

Detailed Description

Definition at line 9407 of file il.h.

Constructor & Destructor Documentation

◆ BinarySmiOpInstr()

dart::BinarySmiOpInstr::BinarySmiOpInstr ( Token::Kind  op_kind,
Value left,
Value right,
intptr_t  deopt_id,
Range right_range = nullptr 
)
inline

Definition at line 9409 of file il.h.

9415 : BinaryIntegerOpInstr(op_kind, left, right, deopt_id),
9416 right_range_(right_range) {}
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
Range * right_range() const
Definition il.h:9425

Member Function Documentation

◆ ComputeCanDeoptimize()

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

Definition at line 2077 of file il.cc.

2077 {
2078 switch (op_kind()) {
2079 case Token::kBIT_AND:
2080 case Token::kBIT_OR:
2081 case Token::kBIT_XOR:
2082 return false;
2083
2084 case Token::kSHR:
2086
2087 case Token::kUSHR:
2088 case Token::kSHL:
2090
2091 case Token::kMOD:
2093
2094 case Token::kTRUNCDIV:
2097
2098 default:
2099 return can_overflow();
2100 }
2101}
bool can_overflow() const
Definition il.h:9352
static bool Overlaps(Range *range, intptr_t min, intptr_t max)
static bool IsPositive(Range *range)
static bool CanBeZero(Range *range)

◆ ComputeType()

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

Definition at line 1750 of file type_propagator.cc.

1750 {
1751 return CompileType::FromCid(kSmiCid);
1752}
static CompileType FromCid(intptr_t cid)

◆ InferRange()

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

Reimplemented from dart::BinaryIntegerOpInstr.

Definition at line 3043 of file range_analysis.cc.

3043 {
3044 const Range* right_smi_range = analysis->GetSmiRange(right());
3045 // TODO(vegorov) completely remove this once GetSmiRange is eliminated.
3046 if (op_kind() == Token::kSHL || op_kind() == Token::kSHR ||
3047 op_kind() == Token::kUSHR || op_kind() == Token::kMOD ||
3048 op_kind() == Token::kTRUNCDIV) {
3049 CacheRange(&right_range_, right_smi_range,
3051 }
3052 InferRangeHelper(analysis->GetSmiRange(left()), right_smi_range, range);
3053}
static void CacheRange(Range **slot, const Range *range, RangeBoundary::RangeSize size)

◆ right_range()

Range * dart::BinarySmiOpInstr::right_range ( ) const
inline

Definition at line 9425 of file il.h.

9425{ return right_range_; }

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