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

#include <il.h>

Inheritance diagram for dart::CheckBoundBaseInstr:
dart::TemplateDefinition< 2, NoThrow, Pure > dart::CheckArrayBoundInstr dart::GenericCheckBoundInstr

Public Types

enum  { kLengthPos = 0 , kIndexPos = 1 }
 
- Public Types inherited from dart::TemplateDefinition< 2, NoThrow, Pure >
using BaseClass = typename Pure< Definition, PureDefinition >::Base
 

Public Member Functions

 CheckBoundBaseInstr (Value *length, Value *index, intptr_t deopt_id)
 
Valuelength () const
 
Valueindex () const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
 DECLARE_ABSTRACT_INSTRUCTION (CheckBoundBase)
 
virtual ValueRedefinedValue () const
 
bool IsRedundant (bool use_loops=false)
 
- 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

- Protected Attributes inherited from dart::TemplateDefinition< 2, NoThrow, Pure >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 10734 of file il.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kLengthPos 
kIndexPos 

Definition at line 10756 of file il.h.

Constructor & Destructor Documentation

◆ CheckBoundBaseInstr()

dart::CheckBoundBaseInstr::CheckBoundBaseInstr ( Value length,
Value index,
intptr_t  deopt_id 
)
inline

Definition at line 10736 of file il.h.

10737 : TemplateDefinition(deopt_id) {
10738 SetInputAt(kLengthPos, length);
10739 SetInputAt(kIndexPos, index);
10740 }
Value * index() const
Definition il.h:10743
Value * length() const
Definition il.h:10742
TemplateDefinition(intptr_t deopt_id=DeoptId::kNone)
Definition il.h:2731

Member Function Documentation

◆ Canonicalize()

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

Definition at line 6773 of file il.cc.

6773 {
6774 return (flow_graph->should_remove_all_bounds_checks() || IsRedundant())
6775 ? index()->definition()
6776 : this;
6777}
bool IsRedundant(bool use_loops=false)
Definition * definition() const
Definition il.h:103

◆ DECLARE_ABSTRACT_INSTRUCTION()

dart::CheckBoundBaseInstr::DECLARE_ABSTRACT_INSTRUCTION ( CheckBoundBase  )

◆ index()

Value * dart::CheckBoundBaseInstr::index ( ) const
inline

Definition at line 10743 of file il.h.

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

◆ IsRedundant()

bool dart::CheckBoundBaseInstr::IsRedundant ( bool  use_loops = false)

Definition at line 3211 of file range_analysis.cc.

3211 {
3212 // First, try to prove redundancy with the results of range analysis.
3214 return true;
3215 } else if (!use_loops) {
3216 return false;
3217 }
3218 // Next, try to prove redundancy with the results of induction analysis.
3219 LoopInfo* loop = GetBlock()->loop_info();
3220 if (loop != nullptr) {
3221 return loop->IsInRange(this, index(), length());
3222 }
3223 return false;
3224}
static bool IsRedundantBasedOnRangeInformation(Value *index, Value *length)

◆ length()

Value * dart::CheckBoundBaseInstr::length ( ) const
inline

Definition at line 10742 of file il.h.

10742{ return inputs_[kLengthPos]; }

◆ RedefinedValue()

Value * dart::CheckBoundBaseInstr::RedefinedValue ( ) const
virtual

Definition at line 555 of file il.cc.

555 {
556 return index();
557}

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