Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 >

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 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
 

Additional Inherited Members

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

Detailed Description

Definition at line 4292 of file il.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kInstantiatorTAVPos 
kFunctionTAVPos 
kSubTypePos 
kSuperTypePos 
kDstNamePos 

Definition at line 4294 of file il.h.

4294 {
4296 kFunctionTAVPos = 1,
4297 kSubTypePos = 2,
4298 kSuperTypePos = 3,
4299 kDstNamePos = 4,
4300 };

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

4309 : TemplateInstruction(source, deopt_id), token_pos_(source.token_pos) {
4312 SetInputAt(kSubTypePos, sub_type);
4313 SetInputAt(kSuperTypePos, super_type);
4314 SetInputAt(kDstNamePos, dst_name);
4315 }
Value * function_type_arguments() const
Definition il.h:4322
Value * dst_name() const
Definition il.h:4325
Value * super_type() const
Definition il.h:4324
Value * sub_type() const
Definition il.h:4323
Value * instantiator_type_arguments() const
Definition il.h:4319
TemplateInstruction(intptr_t deopt_id=DeoptId::kNone)
Definition il.h:1501
SkBitmap source
Definition examples.cpp:28

Member Function Documentation

◆ AttributesEqual()

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

Definition at line 4341 of file il.h.

4341{ return true; }

◆ CanBecomeDeoptimizationTarget()

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

Definition at line 4337 of file il.h.

4337{ return true; }

◆ Canonicalize()

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

Definition at line 1062 of file il.cc.

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

◆ ComputeCanDeoptimize()

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

Definition at line 4329 of file il.h.

4329{ return false; }

◆ ComputeCanDeoptimizeAfterCall()

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

Definition at line 4330 of file il.h.

4330 {
4331 return !CompilerState::Current().is_aot();
4332 }
static CompilerState & Current()

◆ DECLARE_INSTRUCTION()

dart::AssertSubtypeInstr::DECLARE_INSTRUCTION ( AssertSubtype  )

◆ dst_name()

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

Definition at line 4325 of file il.h.

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

◆ function_type_arguments()

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

Definition at line 4322 of file il.h.

4322{ return inputs_[kFunctionTAVPos]; }

◆ instantiator_type_arguments()

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

Definition at line 4319 of file il.h.

4319 {
4321 }

◆ NumberOfInputsConsumedBeforeCall()

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

Definition at line 4333 of file il.h.

4333 {
4334 return InputCount();
4335 }
virtual intptr_t InputCount() const
Definition il.h:1508

◆ sub_type()

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

Definition at line 4323 of file il.h.

4323{ return inputs_[kSubTypePos]; }

◆ super_type()

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

Definition at line 4324 of file il.h.

4324{ return inputs_[kSuperTypePos]; }

◆ token_pos()

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

Definition at line 4327 of file il.h.

4327{ return token_pos_; }

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