Flutter Engine
The Flutter Engine
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 > dart::PureDefinition dart::Definition dart::Instruction dart::ZoneAllocated

Public Types

enum  ExceptionType { kNoSuchMethod , kArgumentError , kCastError }
 
- Public Types inherited from dart::TemplateDefinition< 1, Throws, Pure >
using BaseClass = typename Pure< Definition, PureDefinition >::Base
 
- Public Types inherited from dart::Instruction
enum  Tag { FOR_EACH_INSTRUCTION =(DECLARE_TAG) kNumInstructions }
 
enum  SpeculativeMode { kGuardInputs , kNotSpeculative }
 
using InputsIterable = InstructionIndexedPropertyIterable< InputsTrait >
 
using SuccessorsIterable = InstructionIndexedPropertyIterable< SuccessorsTrait >
 

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
 
- Public Member Functions inherited from dart::PureDefinition
 PureDefinition (intptr_t deopt_id)
 
 PureDefinition (const InstructionSource &source, intptr_t deopt_id)
 
virtual bool AllowsCSE () const
 
virtual bool HasUnknownSideEffects () const
 
- Public Member Functions inherited from dart::Definition
 Definition (intptr_t deopt_id=DeoptId::kNone)
 
 Definition (const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
virtual intptr_t CallCount () const
 
intptr_t temp_index () const
 
void set_temp_index (intptr_t index)
 
void ClearTempIndex ()
 
bool HasTemp () const
 
intptr_t ssa_temp_index () const
 
void set_ssa_temp_index (intptr_t index)
 
bool HasSSATemp () const
 
void ClearSSATempIndex ()
 
intptr_t vreg (intptr_t index) const
 
intptr_t location_count () const
 
bool HasPairRepresentation () const
 
CompileTypeType ()
 
bool HasType () const
 
bool IsInt64Definition ()
 
bool IsInt32Definition ()
 
virtual CompileType ComputeType () const
 
virtual bool RecomputeType ()
 
PRINT_OPERANDS_TO_SUPPORT PRINT_TO_SUPPORT bool UpdateType (CompileType new_type)
 
bool HasUses () const
 
bool HasOnlyUse (Value *use) const
 
bool HasOnlyInputUse (Value *use) const
 
Valueinput_use_list () const
 
void set_input_use_list (Value *head)
 
Valueenv_use_list () const
 
void set_env_use_list (Value *head)
 
ValueListIterable input_uses () const
 
void AddInputUse (Value *value)
 
void AddEnvUse (Value *value)
 
virtual bool MayCreateUnsafeUntaggedPointer () const
 
virtual bool CanReplaceWithConstant () const
 
virtual bool CanEliminate (const BlockEntryInstr *block) const
 
void ReplaceUsesWith (Definition *other)
 
void ReplaceWithResult (Instruction *replacement, Definition *replacement_for_uses, ForwardInstructionIterator *iterator)
 
void ReplaceWith (Definition *other, ForwardInstructionIterator *iterator)
 
Objectconstant_value ()
 
virtual void InferRange (RangeAnalysis *analysis, Range *range)
 
Rangerange () const
 
void set_range (const Range &)
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
DefinitionReplacement ()
 
void SetReplacement (Definition *other)
 
virtual AliasIdentity Identity () const
 
virtual void SetIdentity (AliasIdentity identity)
 
DefinitionOriginalDefinition ()
 
virtual ValueRedefinedValue () const
 
DefinitionOriginalDefinitionIgnoreBoxingAndConstraints ()
 
virtual DefinitionAsDefinition ()
 
virtual const DefinitionAsDefinition () const
 
- Public Member Functions inherited from dart::Instruction
 Instruction (const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
 Instruction (intptr_t deopt_id=DeoptId::kNone)
 
virtual ~Instruction ()
 
virtual Tag tag () const =0
 
virtual intptr_t statistics_tag () const
 
intptr_t deopt_id () const
 
virtual TokenPosition token_pos () const
 
InstructionSource source () const
 
virtual intptr_t InputCount () const =0
 
virtual ValueInputAt (intptr_t i) const =0
 
void SetInputAt (intptr_t i, Value *value)
 
InputsIterable inputs ()
 
void UnuseAllInputs ()
 
virtual intptr_t ArgumentCount () const
 
ValueArgumentValueAt (intptr_t index) const
 
DefinitionArgumentAt (intptr_t index) const
 
virtual void SetMoveArguments (MoveArgumentsArray *move_arguments)
 
virtual MoveArgumentsArrayGetMoveArguments () const
 
virtual void ReplaceInputsWithMoveArguments (MoveArgumentsArray *move_arguments)
 
bool HasMoveArguments () const
 
void RepairArgumentUsesInEnvironment () const
 
virtual bool ComputeCanDeoptimize () const =0
 
virtual bool ComputeCanDeoptimizeAfterCall () const
 
bool CanDeoptimize () const
 
virtual void Accept (InstructionVisitor *visitor)=0
 
Instructionprevious () const
 
void set_previous (Instruction *instr)
 
Instructionnext () const
 
void set_next (Instruction *instr)
 
void LinkTo (Instruction *next)
 
InstructionRemoveFromGraph (bool return_previous=true)
 
virtual intptr_t SuccessorCount () const
 
virtual BlockEntryInstrSuccessorAt (intptr_t index) const
 
SuccessorsIterable successors () const
 
void Goto (JoinEntryInstr *entry)
 
virtual const char * DebugName () const =0
 
void CheckField (const Field &field) const
 
const char * ToCString () const
 
 DECLARE_INSTRUCTION_TYPE_CHECK (BlockEntryWithInitialDefs, BlockEntryWithInitialDefs) template< typename T > T *Cast()
 
template<typename T >
const TCast () const
 
LocationSummarylocs ()
 
bool HasLocs () const
 
virtual LocationSummaryMakeLocationSummary (Zone *zone, bool is_optimizing) const =0
 
void InitializeLocationSummary (Zone *zone, bool optimizing)
 
virtual void EmitNativeCode (FlowGraphCompiler *compiler)
 
Environmentenv () const
 
void SetEnvironment (Environment *deopt_env)
 
void RemoveEnvironment ()
 
void ReplaceInEnvironment (Definition *current, Definition *replacement)
 
virtual intptr_t NumberOfInputsConsumedBeforeCall () const
 
intptr_t GetPassSpecificId (CompilerPass::Id pass) const
 
void SetPassSpecificId (CompilerPass::Id pass, intptr_t id)
 
bool HasPassSpecificId (CompilerPass::Id pass) const
 
bool HasUnmatchedInputRepresentations () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
SpeculativeMode SpeculativeModeOfInputs () const
 
virtual SpeculativeMode SpeculativeModeOfInput (intptr_t index) const
 
virtual Representation representation () const
 
bool WasEliminated () const
 
virtual intptr_t DeoptimizationTarget () const
 
virtual InstructionCanonicalize (FlowGraph *flow_graph)
 
void InsertBefore (Instruction *next)
 
void InsertAfter (Instruction *prev)
 
InstructionAppendInstruction (Instruction *tail)
 
virtual bool AllowsCSE () const
 
virtual bool HasUnknownSideEffects () const =0
 
virtual bool CanCallDart () const
 
virtual bool CanTriggerGC () const
 
virtual BlockEntryInstrGetBlock ()
 
virtual intptr_t inlining_id () const
 
virtual void set_inlining_id (intptr_t value)
 
virtual bool has_inlining_id () const
 
virtual uword Hash () const
 
bool Equals (const Instruction &other) const
 
virtual bool AttributesEqual (const Instruction &other) const
 
void InheritDeoptTarget (Zone *zone, Instruction *other)
 
bool NeedsEnvironment () const
 
virtual bool CanBecomeDeoptimizationTarget () const
 
void InheritDeoptTargetAfter (FlowGraph *flow_graph, Definition *call, Definition *result)
 
virtual bool MayThrow () const =0
 
virtual bool MayHaveVisibleEffect () const
 
virtual bool CanEliminate (const BlockEntryInstr *block) const
 
bool CanEliminate ()
 
bool IsDominatedBy (Instruction *dom)
 
void ClearEnv ()
 
void Unsupported (FlowGraphCompiler *compiler)
 
virtual bool UseSharedSlowPathStub (bool is_optimizing) const
 
Location::Kind RegisterKindForResult () const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Static Public Member Functions

static void AddMetadataForRuntimeCall (CheckNullInstr *check_null, FlowGraphCompiler *compiler)
 
- Static Public Member Functions inherited from dart::Definition
static bool IsArrayLength (Definition *def)
 
- Static Public Member Functions inherited from dart::Instruction
static const ICDataGetICData (const ZoneGrowableArray< const ICData * > &ic_data_array, intptr_t deopt_id, bool is_static_call)
 
static LocationSummaryMakeCallSummary (Zone *zone, const Instruction *instr, LocationSummary *locs=nullptr)
 
static bool SlowPathSharingSupported (bool is_optimizing)
 

Additional Inherited Members

- Static Public Attributes inherited from dart::Definition
static constexpr intptr_t kReplacementMarker = -2
 
- Static Public Attributes inherited from dart::Instruction
static const intptr_t kInstructionAttrs [kNumInstructions]
 
- Protected Member Functions inherited from dart::Definition
void set_type (CompileType *type)
 
- Protected Member Functions inherited from dart::Instruction
intptr_t GetDeoptId () const
 
virtual void CopyDeoptIdFrom (const Instruction &instr)
 
void WriteExtraWithoutInputs (FlowGraphSerializer *s)
 
void ReadExtraWithoutInputs (FlowGraphDeserializer *d)
 
- Protected Attributes inherited from dart::TemplateDefinition< 1, Throws, Pure >
EmbeddedArray< Value *, Ninputs_
 
- Protected Attributes inherited from dart::Definition
Rangerange_ = nullptr
 

Detailed Description

Definition at line 10679 of file il.h.

Member Enumeration Documentation

◆ ExceptionType

Enumerator
kNoSuchMethod 
kArgumentError 
kCastError 

Definition at line 10681 of file il.h.

10681 {
10684 kCastError,
10685 };

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 10687 of file il.h.

10693 token_pos_(source.token_pos),
10694 function_name_(function_name),
10695 exception_type_(exception_type) {
10696 DEBUG_ASSERT(function_name.IsNotTemporaryScopedHandle());
10698 SetInputAt(0, value);
10699 }
#define DEBUG_ASSERT(cond)
Definition: assert.h:321
const String & function_name() const
Definition: il.h:10703
Value * value() const
Definition: il.h:10701
ExceptionType exception_type() const
Definition: il.h:10704
void SetInputAt(intptr_t i, Value *value)
Definition: il.h:1014
InstructionSource source() const
Definition: il.h:1008
intptr_t deopt_id() const
Definition: il.h:993
bool IsSymbol() const
Definition: object.h:10309
TemplateDefinition(intptr_t deopt_id=DeoptId::kNone)
Definition: il.h:2749
#define ASSERT(E)
const TokenPosition token_pos

Member Function Documentation

◆ AddMetadataForRuntimeCall()

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

Definition at line 6278 of file il.cc.

6279 {
6280 compiler->AddNullCheck(check_null->source(), check_null->function_name());
6281}

◆ AttributesEqual()

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

Reimplemented from dart::Instruction.

Definition at line 4000 of file il.cc.

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

◆ CanBecomeDeoptimizationTarget()

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

Reimplemented from dart::Instruction.

Definition at line 10721 of file il.h.

10721{ return true; }

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Definition at line 3996 of file il.cc.

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

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Definition at line 10717 of file il.h.

10717{ return false; }

◆ ComputeCanDeoptimizeAfterCall()

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

Reimplemented from dart::Instruction.

Definition at line 10718 of file il.h.

10718 {
10719 return !CompilerState::Current().is_aot();
10720 }
bool is_aot() const
static CompilerState & Current()

◆ ComputeType()

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

Reimplemented from dart::Definition.

Definition at line 1159 of file type_propagator.cc.

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

◆ exception_type()

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

Definition at line 10704 of file il.h.

10704{ return exception_type_; }

◆ function_name()

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

Definition at line 10703 of file il.h.

10703{ return function_name_; }

◆ RecomputeType()

bool dart::CheckNullInstr::RecomputeType ( )
virtual

Reimplemented from dart::Definition.

Definition at line 1170 of file type_propagator.cc.

1170 {
1171 return UpdateType(ComputeType());
1172}
virtual CompileType ComputeType() const
PRINT_OPERANDS_TO_SUPPORT PRINT_TO_SUPPORT bool UpdateType(CompileType new_type)
Definition: il.h:2553

◆ RedefinedValue()

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

Reimplemented from dart::Definition.

Definition at line 565 of file il.cc.

565 {
566 return value();
567}

◆ token_pos()

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

Reimplemented from dart::Instruction.

Definition at line 10702 of file il.h.

10702{ return token_pos_; }

◆ UseSharedSlowPathStub()

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

Reimplemented from dart::Instruction.

Definition at line 10706 of file il.h.

10706 {
10707 return SlowPathSharingSupported(is_optimizing);
10708 }
static bool SlowPathSharingSupported(bool is_optimizing)
Definition: il.h:1368

◆ value()

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

Definition at line 10701 of file il.h.

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

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