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

#include <il.h>

Inheritance diagram for dart::StrictCompareInstr:
dart::TemplateComparison< 2, NoThrow, Pure >

Public Member Functions

 StrictCompareInstr (const InstructionSource &source, Token::Kind kind, Value *left, Value *right, bool needs_number_check, intptr_t deopt_id)
 
virtual ComparisonInstrCopyWithNewOperands (Value *left, Value *right)
 
virtual CompileType ComputeType () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
bool needs_number_check () const
 
void set_needs_number_check (bool value)
 
bool AttributesEqual (const Instruction &other) const
 
DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(StrictCompareInstr, TemplateComparison, FIELD_LIST) private bool TryEmitBoolTest (FlowGraphCompiler *compiler, BranchLabels labels, intptr_t input_index, const Object &obj, Condition *condition_out)
 
 DISALLOW_COPY_AND_ASSIGN (StrictCompareInstr)
 
- Public Member Functions inherited from dart::TemplateComparison< 2, NoThrow, Pure >
 TemplateComparison (const InstructionSource &source, Token::Kind kind, intptr_t deopt_id=DeoptId::kNone)
 
virtual intptr_t InputCount () const
 
virtual ValueInputAt (intptr_t i) const
 
virtual bool MayThrow () const
 

Public Attributes

 PRINT_OPERANDS_TO_SUPPORT
 

Additional Inherited Members

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

Detailed Description

Definition at line 5088 of file il.h.

Constructor & Destructor Documentation

◆ StrictCompareInstr()

dart::StrictCompareInstr::StrictCompareInstr ( const InstructionSource source,
Token::Kind  kind,
Value left,
Value right,
bool  needs_number_check,
intptr_t  deopt_id 
)

Definition at line 5030 of file il.cc.

5036 : TemplateComparison(source, kind, deopt_id),
5037 needs_number_check_(needs_number_check) {
5038 ASSERT((kind == Token::kEQ_STRICT) || (kind == Token::kNE_STRICT));
5039 SetInputAt(0, left);
5040 SetInputAt(1, right);
5041}
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
bool needs_number_check() const
Definition il.h:5107
TemplateComparison(const InstructionSource &source, Token::Kind kind, intptr_t deopt_id=DeoptId::kNone)
Definition il.h:3935
#define ASSERT(E)
SkBitmap source
Definition examples.cpp:28

Member Function Documentation

◆ AttributesEqual()

bool dart::StrictCompareInstr::AttributesEqual ( const Instruction other) const

Definition at line 1092 of file il.cc.

1092 {
1093 auto const other_op = other.AsStrictCompare();
1094 ASSERT(other_op != nullptr);
1095 return ComparisonInstr::AttributesEqual(other) &&
1096 (needs_number_check() == other_op->needs_number_check());
1097}
virtual bool AttributesEqual(const Instruction &other) const
Definition il.h:3867

◆ Canonicalize()

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

Definition at line 3718 of file il.cc.

3718 {
3719 if (!HasUses()) return nullptr;
3720
3721 bool negated = false;
3722 Definition* replacement = CanonicalizeStrictCompare(this, &negated,
3723 /*is_branch=*/false);
3724 if (negated && replacement->IsComparison()) {
3725 ASSERT(replacement != this);
3726 replacement->AsComparison()->NegateComparison();
3727 }
3728 return replacement;
3729}
static Definition * CanonicalizeStrictCompare(StrictCompareInstr *compare, bool *negated, bool is_branch)
Definition il.cc:3553

◆ ComputeCanDeoptimize()

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

Definition at line 5103 of file il.h.

5103{ return false; }

◆ ComputeType()

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

Definition at line 1409 of file type_propagator.cc.

1409 {
1410 return CompileType::Bool();
1411}
static CompileType Bool()

◆ CopyWithNewOperands()

ComparisonInstr * dart::StrictCompareInstr::CopyWithNewOperands ( Value left,
Value right 
)
virtual

Definition at line 6572 of file il.cc.

6573 {
6574 return new StrictCompareInstr(source(), kind(), new_left, new_right,
6576}
static constexpr intptr_t kNone
Definition deopt_id.h:27
StrictCompareInstr(const InstructionSource &source, Token::Kind kind, Value *left, Value *right, bool needs_number_check, intptr_t deopt_id)
Definition il.cc:5030

◆ DISALLOW_COPY_AND_ASSIGN()

dart::StrictCompareInstr::DISALLOW_COPY_AND_ASSIGN ( StrictCompareInstr  )

◆ needs_number_check()

bool dart::StrictCompareInstr::needs_number_check ( ) const
inline

Definition at line 5107 of file il.h.

5107{ return needs_number_check_; }

◆ set_needs_number_check()

void dart::StrictCompareInstr::set_needs_number_check ( bool  value)
inline

Definition at line 5108 of file il.h.

5108{ needs_number_check_ = value; }
uint8_t value

◆ TryEmitBoolTest()

bool dart::StrictCompareInstr::TryEmitBoolTest ( FlowGraphCompiler compiler,
BranchLabels  labels,
intptr_t  input_index,
const Object obj,
Condition condition_out 
)

Definition at line 5072 of file il.cc.

5076 {
5077 CompileType* input_type = InputAt(input_index)->Type();
5078 if (input_type->ToCid() == kBoolCid && obj.GetClassId() == kBoolCid) {
5079 bool invert = (kind() != Token::kEQ_STRICT) ^ !Bool::Cast(obj).value();
5080 *true_condition_out =
5081 compiler->EmitBoolTest(locs()->in(input_index).reg(), labels, invert);
5082 return true;
5083 }
5084 return false;
5085}
virtual Value * InputAt(intptr_t i) const
Definition il.h:3941
CompileType * Type()
gboolean invert

Member Data Documentation

◆ PRINT_OPERANDS_TO_SUPPORT

dart::StrictCompareInstr::PRINT_OPERANDS_TO_SUPPORT

Definition at line 5112 of file il.h.


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