Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
dart::AssertSubtypeInstr Class Reference

#include <il.h>

Inheritance diagram for dart::AssertSubtypeInstr:
dart::TemplateInstruction< 5, Throws, Pure > dart::PureDefinition dart::Definition dart::Instruction dart::ZoneAllocated

Public Types

enum  {
  kInstantiatorTAVPos = 0 , kFunctionTAVPos = 1 , kSubTypePos = 2 , kSuperTypePos = 3 ,
  kDstNamePos = 4
}
 
- Public Types inherited from dart::TemplateInstruction< 5, Throws, Pure >
using BaseClass = typename Pure< Instruction, PureInstruction >::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

 AssertSubtypeInstr (const InstructionSource &source, Value *instantiator_type_arguments, Value *function_type_arguments, Value *sub_type, Value *super_type, Value *dst_name, intptr_t deopt_id)
 
 DECLARE_INSTRUCTION (AssertSubtype)
 
Valueinstantiator_type_arguments () const
 
Valuefunction_type_arguments () const
 
Valuesub_type () const
 
Valuesuper_type () const
 
Valuedst_name () const
 
virtual TokenPosition token_pos () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool ComputeCanDeoptimizeAfterCall () const
 
virtual intptr_t NumberOfInputsConsumedBeforeCall () const
 
virtual bool CanBecomeDeoptimizationTarget () const
 
virtual InstructionCanonicalize (FlowGraph *flow_graph)
 
virtual bool AttributesEqual (const Instruction &other) const
 
- Public Member Functions inherited from dart::TemplateInstruction< 5, Throws, Pure >
 TemplateInstruction (intptr_t deopt_id=DeoptId::kNone)
 
 TemplateInstruction (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)
 

Additional Inherited Members

- 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)
 
- 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::TemplateInstruction< 5, Throws, Pure >
EmbeddedArray< Value *, Ninputs_
 
- Protected Attributes inherited from dart::Definition
Rangerange_ = nullptr
 

Detailed Description

Definition at line 4310 of file il.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kInstantiatorTAVPos 
kFunctionTAVPos 
kSubTypePos 
kSuperTypePos 
kDstNamePos 

Definition at line 4312 of file il.h.

4312 {
4314 kFunctionTAVPos = 1,
4315 kSubTypePos = 2,
4316 kSuperTypePos = 3,
4317 kDstNamePos = 4,
4318 };

Constructor & Destructor Documentation

◆ AssertSubtypeInstr()

dart::AssertSubtypeInstr::AssertSubtypeInstr ( const InstructionSource source,
Value instantiator_type_arguments,
Value function_type_arguments,
Value sub_type,
Value super_type,
Value dst_name,
intptr_t  deopt_id 
)
inline

Definition at line 4320 of file il.h.

4333 }
Value * function_type_arguments() const
Definition: il.h:4340
Value * dst_name() const
Definition: il.h:4343
Value * super_type() const
Definition: il.h:4342
Value * sub_type() const
Definition: il.h:4341
Value * instantiator_type_arguments() const
Definition: il.h:4337
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
TemplateInstruction(intptr_t deopt_id=DeoptId::kNone)
Definition: il.h:1507
const TokenPosition token_pos

Member Function Documentation

◆ AttributesEqual()

virtual bool dart::AssertSubtypeInstr::AttributesEqual ( const Instruction other) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 4359 of file il.h.

4359{ return true; }

◆ CanBecomeDeoptimizationTarget()

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

Reimplemented from dart::Instruction.

Definition at line 4355 of file il.h.

4355{ return true; }

◆ Canonicalize()

Instruction * dart::AssertSubtypeInstr::Canonicalize ( FlowGraph flow_graph)
virtual

Reimplemented from dart::Definition.

Definition at line 1064 of file il.cc.

1064 {
1065 // If all inputs needed to check instantiation are constant, instantiate the
1066 // sub and super type and remove the instruction if the subtype test succeeds.
1067 if (super_type()->BindsToConstant() && sub_type()->BindsToConstant() &&
1068 instantiator_type_arguments()->BindsToConstant() &&
1069 function_type_arguments()->BindsToConstant()) {
1070 auto Z = Thread::Current()->zone();
1071 const auto& constant_instantiator_type_args =
1073 ? TypeArguments::null_type_arguments()
1074 : TypeArguments::Cast(
1075 instantiator_type_arguments()->BoundConstant());
1076 const auto& constant_function_type_args =
1078 ? TypeArguments::null_type_arguments()
1079 : TypeArguments::Cast(function_type_arguments()->BoundConstant());
1080 auto& constant_sub_type = AbstractType::Handle(
1081 Z, AbstractType::Cast(sub_type()->BoundConstant()).ptr());
1082 auto& constant_super_type = AbstractType::Handle(
1083 Z, AbstractType::Cast(super_type()->BoundConstant()).ptr());
1084
1086 &constant_sub_type, &constant_super_type,
1087 constant_instantiator_type_args, constant_function_type_args)) {
1088 return nullptr;
1089 }
1090 }
1091 return this;
1092}
static bool InstantiateAndTestSubtype(AbstractType *subtype, AbstractType *supertype, const TypeArguments &instantiator_type_args, const TypeArguments &function_type_args)
Definition: object.cc:4287
const T * Cast() const
Definition: il.h:1186
bool IsNull() const
Definition: object.h:363
static Object & Handle()
Definition: object.h:407
Zone * zone() const
Definition: thread_state.h:37
static Thread * Current()
Definition: thread.h:362
const Object & BoundConstant() const
Definition: il.cc:1201
#define Z
Definition: il.cc:7430

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Definition at line 4347 of file il.h.

4347{ return false; }

◆ ComputeCanDeoptimizeAfterCall()

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

Reimplemented from dart::Instruction.

Definition at line 4348 of file il.h.

4348 {
4349 return !CompilerState::Current().is_aot();
4350 }
bool is_aot() const
static CompilerState & Current()

◆ DECLARE_INSTRUCTION()

dart::AssertSubtypeInstr::DECLARE_INSTRUCTION ( AssertSubtype  )

◆ dst_name()

Value * dart::AssertSubtypeInstr::dst_name ( ) const
inline

Definition at line 4343 of file il.h.

4343{ return inputs_[kDstNamePos]; }
EmbeddedArray< Value *, N > inputs_
Definition: il.h:1522

◆ function_type_arguments()

Value * dart::AssertSubtypeInstr::function_type_arguments ( ) const
inline

Definition at line 4340 of file il.h.

4340{ return inputs_[kFunctionTAVPos]; }

◆ instantiator_type_arguments()

Value * dart::AssertSubtypeInstr::instantiator_type_arguments ( ) const
inline

Definition at line 4337 of file il.h.

4337 {
4339 }

◆ NumberOfInputsConsumedBeforeCall()

virtual intptr_t dart::AssertSubtypeInstr::NumberOfInputsConsumedBeforeCall ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 4351 of file il.h.

4351 {
4352 return InputCount();
4353 }
virtual intptr_t InputCount() const
Definition: il.h:1514

◆ sub_type()

Value * dart::AssertSubtypeInstr::sub_type ( ) const
inline

Definition at line 4341 of file il.h.

4341{ return inputs_[kSubTypePos]; }

◆ super_type()

Value * dart::AssertSubtypeInstr::super_type ( ) const
inline

Definition at line 4342 of file il.h.

4342{ return inputs_[kSuperTypePos]; }

◆ token_pos()

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

Reimplemented from dart::Instruction.

Definition at line 4345 of file il.h.

4345{ return token_pos_; }

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