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

#include <il.h>

Inheritance diagram for dart::CheckNullInstr:
dart::TemplateDefinition< 1, Throws, Pure >

Public Types

enum  ExceptionType { kNoSuchMethod , kArgumentError , kCastError }
 
- Public Types inherited from dart::TemplateDefinition< 1, Throws, Pure >
using BaseClass = typename Pure< Definition, PureDefinition >::Base
 

Public Member Functions

 CheckNullInstr (Value *value, const String &function_name, intptr_t deopt_id, const InstructionSource &source, ExceptionType exception_type=kNoSuchMethod)
 
Valuevalue () const
 
virtual TokenPosition token_pos () const
 
const Stringfunction_name () const
 
ExceptionType exception_type () const
 
virtual bool UseSharedSlowPathStub (bool is_optimizing) const
 
virtual CompileType ComputeType () const
 
virtual bool RecomputeType ()
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool ComputeCanDeoptimizeAfterCall () const
 
virtual bool CanBecomeDeoptimizationTarget () const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
virtual bool AttributesEqual (const Instruction &other) const
 
virtual ValueRedefinedValue () const
 
- Public Member Functions inherited from dart::TemplateDefinition< 1, Throws, 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 void AddMetadataForRuntimeCall (CheckNullInstr *check_null, FlowGraphCompiler *compiler)
 

Additional Inherited Members

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

Detailed Description

Definition at line 10625 of file il.h.

Member Enumeration Documentation

◆ ExceptionType

Enumerator
kNoSuchMethod 
kArgumentError 
kCastError 

Definition at line 10627 of file il.h.

10627 {
10630 kCastError,
10631 };

Constructor & Destructor Documentation

◆ CheckNullInstr()

dart::CheckNullInstr::CheckNullInstr ( Value value,
const String function_name,
intptr_t  deopt_id,
const InstructionSource source,
ExceptionType  exception_type = kNoSuchMethod 
)
inline

Definition at line 10633 of file il.h.

10638 : TemplateDefinition(source, deopt_id),
10639 token_pos_(source.token_pos),
10640 function_name_(function_name),
10641 exception_type_(exception_type) {
10642 DEBUG_ASSERT(function_name.IsNotTemporaryScopedHandle());
10644 SetInputAt(0, value);
10645 }
#define DEBUG_ASSERT(cond)
Definition assert.h:321
const String & function_name() const
Definition il.h:10649
Value * value() const
Definition il.h:10647
ExceptionType exception_type() const
Definition il.h:10650
bool IsSymbol() const
Definition object.h:10288
TemplateDefinition(intptr_t deopt_id=DeoptId::kNone)
Definition il.h:2731
#define ASSERT(E)
SkBitmap source
Definition examples.cpp:28

Member Function Documentation

◆ AddMetadataForRuntimeCall()

void dart::CheckNullInstr::AddMetadataForRuntimeCall ( CheckNullInstr check_null,
FlowGraphCompiler compiler 
)
static

Definition at line 6286 of file il.cc.

6287 {
6288 compiler->AddNullCheck(check_null->source(), check_null->function_name());
6289}

◆ AttributesEqual()

bool dart::CheckNullInstr::AttributesEqual ( const Instruction other) const
virtual

Definition at line 4002 of file il.cc.

4002 {
4003 auto const other_check = other.AsCheckNull();
4004 ASSERT(other_check != nullptr);
4005 return function_name().Equals(other_check->function_name()) &&
4006 exception_type() == other_check->exception_type();
4007}
bool Equals(const String &str) const
Definition object.h:13311

◆ CanBecomeDeoptimizationTarget()

virtual bool dart::CheckNullInstr::CanBecomeDeoptimizationTarget ( ) const
inlinevirtual

Definition at line 10667 of file il.h.

10667{ return true; }

◆ Canonicalize()

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

Definition at line 3998 of file il.cc.

3998 {
3999 return (!value()->Type()->is_nullable()) ? value()->definition() : this;
4000}
Definition * definition() const
Definition il.h:103

◆ ComputeCanDeoptimize()

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

Definition at line 10663 of file il.h.

10663{ return false; }

◆ ComputeCanDeoptimizeAfterCall()

virtual bool dart::CheckNullInstr::ComputeCanDeoptimizeAfterCall ( ) const
inlinevirtual

Definition at line 10664 of file il.h.

10664 {
10665 return !CompilerState::Current().is_aot();
10666 }
static CompilerState & Current()

◆ ComputeType()

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

Definition at line 1160 of file type_propagator.cc.

1160 {
1161 CompileType* type = value()->Type();
1162 if (type->is_nullable()) {
1163 CompileType result = type->CopyNonNullable();
1164 if (!result.IsNone()) {
1165 return result;
1166 }
1167 }
1168 return *type;
1169}
CompileType CopyNonNullable()
CompileType * Type()
GAsyncResult * result

◆ exception_type()

ExceptionType dart::CheckNullInstr::exception_type ( ) const
inline

Definition at line 10650 of file il.h.

10650{ return exception_type_; }

◆ function_name()

const String & dart::CheckNullInstr::function_name ( ) const
inline

Definition at line 10649 of file il.h.

10649{ return function_name_; }

◆ RecomputeType()

bool dart::CheckNullInstr::RecomputeType ( )
virtual

Definition at line 1171 of file type_propagator.cc.

1171 {
1172 return UpdateType(ComputeType());
1173}
virtual CompileType ComputeType() const

◆ RedefinedValue()

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

Definition at line 563 of file il.cc.

563 {
564 return value();
565}

◆ token_pos()

virtual TokenPosition dart::CheckNullInstr::token_pos ( ) const
inlinevirtual

Definition at line 10648 of file il.h.

10648{ return token_pos_; }

◆ UseSharedSlowPathStub()

virtual bool dart::CheckNullInstr::UseSharedSlowPathStub ( bool  is_optimizing) const
inlinevirtual

Definition at line 10652 of file il.h.

10652 {
10653 return SlowPathSharingSupported(is_optimizing);
10654 }

◆ value()

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

Definition at line 10647 of file il.h.

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

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