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

#include <il.h>

Inheritance diagram for dart::TestCidsInstr:
dart::TemplateComparison< 1, NoThrow, Pure > dart::PureDefinition dart::Definition dart::Instruction dart::ZoneAllocated

Public Member Functions

 TestCidsInstr (const InstructionSource &source, Token::Kind kind, Value *value, const ZoneGrowableArray< intptr_t > &cid_results, intptr_t deopt_id)
 
const ZoneGrowableArray< intptr_t > & cid_results () const
 
 DECLARE_COMPARISON_INSTRUCTION (TestCids)
 
virtual ComparisonInstrCopyWithNewOperands (Value *left, Value *right)
 
virtual CompileType ComputeType () const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
virtual bool ComputeCanDeoptimize () const
 
Valuevalue () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
virtual bool AttributesEqual (const Instruction &other) const
 
- Public Member Functions inherited from dart::TemplateComparison< 1, NoThrow, Pure >
 TemplateComparison (const InstructionSource &source, Token::Kind kind, 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

- Public Types inherited from dart::TemplateComparison< 1, NoThrow, Pure >
using BaseClass = typename Pure< ComparisonInstr, PureComparison >::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 >
 
- 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::TemplateComparison< 1, NoThrow, Pure >
EmbeddedArray< Value *, Ninputs_
 
- Protected Attributes inherited from dart::Definition
Rangerange_ = nullptr
 

Detailed Description

Definition at line 5226 of file il.h.

Constructor & Destructor Documentation

◆ TestCidsInstr()

dart::TestCidsInstr::TestCidsInstr ( const InstructionSource source,
Token::Kind  kind,
Value value,
const ZoneGrowableArray< intptr_t > &  cid_results,
intptr_t  deopt_id 
)

Definition at line 3831 of file il.cc.

3836 : TemplateComparison(source, kind, deopt_id), cid_results_(cid_results) {
3837 ASSERT((kind == Token::kIS) || (kind == Token::kISNOT));
3838 SetInputAt(0, value);
3839 set_operation_cid(kObjectCid);
3840#ifdef DEBUG
3841 ASSERT(cid_results[0] == kSmiCid);
3842 if (deopt_id == DeoptId::kNone) {
3843 // The entry for Smi can be special, but all other entries have
3844 // to match in the no-deopt case.
3845 for (intptr_t i = 4; i < cid_results.length(); i += 2) {
3846 ASSERT(cid_results[i + 1] == cid_results[3]);
3847 }
3848 }
3849#endif
3850}
intptr_t length() const
static constexpr intptr_t kNone
Definition: deopt_id.h:27
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
TemplateComparison(const InstructionSource &source, Token::Kind kind, intptr_t deopt_id=DeoptId::kNone)
Definition: il.h:3953
Value * value() const
Definition: il.h:5250
const ZoneGrowableArray< intptr_t > & cid_results() const
Definition: il.h:5234
#define ASSERT(E)

Member Function Documentation

◆ AttributesEqual()

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

Reimplemented from dart::Instruction.

Definition at line 6588 of file il.cc.

6588 {
6589 auto const other_instr = other.AsTestCids();
6591 return false;
6592 }
6593 if (cid_results().length() != other_instr->cid_results().length()) {
6594 return false;
6595 }
6596 for (intptr_t i = 0; i < cid_results().length(); i++) {
6597 if (cid_results()[i] != other_instr->cid_results()[i]) {
6598 return false;
6599 }
6600 }
6601 return true;
6602}
virtual bool AttributesEqual(const Instruction &other) const
Definition: il.h:3885
size_t length

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Definition at line 3852 of file il.cc.

3852 {
3853 CompileType* in_type = value()->Type();
3854 intptr_t cid = in_type->ToCid();
3855 if (cid == kDynamicCid) return this;
3856
3857 const ZoneGrowableArray<intptr_t>& data = cid_results();
3858 const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0;
3859 for (intptr_t i = 0; i < data.length(); i += 2) {
3860 if (data[i] == cid) {
3861 return (data[i + 1] == true_result)
3862 ? flow_graph->GetConstant(Bool::True())
3863 : flow_graph->GetConstant(Bool::False());
3864 }
3865 }
3866
3867 if (!CanDeoptimize()) {
3869 return (data[data.length() - 1] == true_result)
3870 ? flow_graph->GetConstant(Bool::False())
3871 : flow_graph->GetConstant(Bool::True());
3872 }
3873
3874 // TODO(sra): Handle nullable input, possibly canonicalizing to a compare
3875 // against `null`.
3876 return this;
3877}
static const Bool & False()
Definition: object.h:10799
static const Bool & True()
Definition: object.h:10797
bool CanDeoptimize() const
Definition: il.h:1079
CompileType * Type()
@ kDynamicCid
Definition: class_id.h:253
const intptr_t cid
static int8_t data[kExtLength]

◆ cid_results()

const ZoneGrowableArray< intptr_t > & dart::TestCidsInstr::cid_results ( ) const
inline

Definition at line 5234 of file il.h.

5234 {
5235 return cid_results_;
5236 }

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Definition at line 5246 of file il.h.

5246 {
5247 return GetDeoptId() != DeoptId::kNone;
5248 }
intptr_t GetDeoptId() const
Definition: il.h:1409

◆ ComputeType()

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

Reimplemented from dart::Definition.

Definition at line 1416 of file type_propagator.cc.

1416 {
1417 return CompileType::Bool();
1418}
static CompileType Bool()

◆ CopyWithNewOperands()

ComparisonInstr * dart::TestCidsInstr::CopyWithNewOperands ( Value left,
Value right 
)
virtual

Definition at line 6576 of file il.cc.

6577 {
6578 return new TestCidsInstr(source(), kind(), new_left, cid_results(),
6579 deopt_id());
6580}
TestCidsInstr(const InstructionSource &source, Token::Kind kind, Value *value, const ZoneGrowableArray< intptr_t > &cid_results, intptr_t deopt_id)
Definition: il.cc:3831

◆ DECLARE_COMPARISON_INSTRUCTION()

dart::TestCidsInstr::DECLARE_COMPARISON_INSTRUCTION ( TestCids  )

◆ RequiredInputRepresentation()

virtual Representation dart::TestCidsInstr::RequiredInputRepresentation ( intptr_t  idx) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 5251 of file il.h.

5251 {
5252 return kTagged;
5253 }

◆ value()

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

Definition at line 5250 of file il.h.

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

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