Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
dart::InvokeMathCFunctionInstr Class Reference

#include <il.h>

Inheritance diagram for dart::InvokeMathCFunctionInstr:
dart::VariadicDefinition dart::Definition dart::Instruction dart::ZoneAllocated

Public Member Functions

 InvokeMathCFunctionInstr (InputsArray &&inputs, intptr_t deopt_id, MethodRecognizer::Kind recognized_kind, const InstructionSource &source)
 
const RuntimeEntryTargetFunction () const
 
MethodRecognizer::Kind recognized_kind () const
 
virtual TokenPosition token_pos () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual Representation representation () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
virtual SpeculativeMode SpeculativeModeOfInput (intptr_t idx) const
 
virtual intptr_t DeoptimizationTarget () const
 
virtual bool AllowsCSE () const
 
virtual bool HasUnknownSideEffects () const
 
virtual bool AttributesEqual (const Instruction &other) const
 
virtual DefinitionCanonicalize (FlowGraph *flow_graph)
 
virtual bool MayThrow () const
 
- Public Member Functions inherited from dart::VariadicDefinition
 VariadicDefinition (InputsArray &&inputs, intptr_t deopt_id=DeoptId::kNone)
 
 VariadicDefinition (InputsArray &&inputs, const InstructionSource &source, intptr_t deopt_id=DeoptId::kNone)
 
 VariadicDefinition (const intptr_t num_inputs, intptr_t deopt_id=DeoptId::kNone)
 
intptr_t InputCount () const
 
ValueInputAt (intptr_t i) 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 intptr_t ArgumentCountFor (MethodRecognizer::Kind recognized_kind_)
 
- 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

static constexpr intptr_t kSavedSpTempIndex = 0
 
static constexpr intptr_t kObjectTempIndex = 1
 
static constexpr intptr_t kDoubleTempIndex = 2
 
- 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]
 

Additional Inherited Members

- 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 >
 
- 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::VariadicDefinition
InputsArray inputs_
 
- Protected Attributes inherited from dart::Definition
Rangerange_ = nullptr
 

Detailed Description

Definition at line 10250 of file il.h.

Constructor & Destructor Documentation

◆ InvokeMathCFunctionInstr()

dart::InvokeMathCFunctionInstr::InvokeMathCFunctionInstr ( InputsArray &&  inputs,
intptr_t  deopt_id,
MethodRecognizer::Kind  recognized_kind,
const InstructionSource source 
)

Definition at line 7185 of file il.cc.

7190 : VariadicDefinition(std::move(inputs), source, deopt_id),
7191 recognized_kind_(recognized_kind),
7192 token_pos_(source.token_pos) {
7193 ASSERT(InputCount() == ArgumentCountFor(recognized_kind_));
7194}
InputsIterable inputs()
Definition: il.h:1033
InstructionSource source() const
Definition: il.h:1008
intptr_t deopt_id() const
Definition: il.h:993
MethodRecognizer::Kind recognized_kind() const
Definition: il.h:10261
static intptr_t ArgumentCountFor(MethodRecognizer::Kind recognized_kind_)
Definition: il.cc:7196
VariadicDefinition(InputsArray &&inputs, intptr_t deopt_id=DeoptId::kNone)
Definition: il.h:2773
intptr_t InputCount() const
Definition: il.h:2794
#define ASSERT(E)
const TokenPosition token_pos

Member Function Documentation

◆ AllowsCSE()

virtual bool dart::InvokeMathCFunctionInstr::AllowsCSE ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 10283 of file il.h.

10283{ return true; }

◆ ArgumentCountFor()

intptr_t dart::InvokeMathCFunctionInstr::ArgumentCountFor ( MethodRecognizer::Kind  recognized_kind_)
static

Definition at line 7196 of file il.cc.

7197 {
7198 switch (kind) {
7199 case MethodRecognizer::kDoubleTruncateToDouble:
7200 case MethodRecognizer::kDoubleFloorToDouble:
7201 case MethodRecognizer::kDoubleCeilToDouble:
7202 case MethodRecognizer::kDoubleRoundToDouble:
7203 case MethodRecognizer::kMathAtan:
7204 case MethodRecognizer::kMathTan:
7205 case MethodRecognizer::kMathAcos:
7206 case MethodRecognizer::kMathAsin:
7207 case MethodRecognizer::kMathSin:
7208 case MethodRecognizer::kMathCos:
7209 case MethodRecognizer::kMathExp:
7210 case MethodRecognizer::kMathLog:
7211 return 1;
7212 case MethodRecognizer::kDoubleMod:
7213 case MethodRecognizer::kDoubleRem:
7214 case MethodRecognizer::kMathDoublePow:
7215 case MethodRecognizer::kMathAtan2:
7216 return 2;
7217 default:
7218 UNREACHABLE();
7219 }
7220 return 0;
7221}
#define UNREACHABLE()
Definition: assert.h:248

◆ AttributesEqual()

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

Reimplemented from dart::Instruction.

Definition at line 10286 of file il.h.

10286 {
10287 auto const other_invoke = other.AsInvokeMathCFunction();
10288 return other_invoke->recognized_kind() == recognized_kind();
10289 }

◆ Canonicalize()

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

Reimplemented from dart::Definition.

Definition at line 7263 of file il.cc.

7263 {
7264 if (!CompilerState::Current().is_aot() &&
7266 Token::Kind op_kind = Token::kILLEGAL;
7267 switch (recognized_kind_) {
7268 case MethodRecognizer::kDoubleTruncateToDouble:
7269 op_kind = Token::kTRUNCATE;
7270 break;
7271 case MethodRecognizer::kDoubleFloorToDouble:
7272 op_kind = Token::kFLOOR;
7273 break;
7274 case MethodRecognizer::kDoubleCeilToDouble:
7275 op_kind = Token::kCEILING;
7276 break;
7277 default:
7278 return this;
7279 }
7280 auto* instr = new UnaryDoubleOpInstr(
7281 op_kind, new Value(InputAt(0)->definition()), GetDeoptId(),
7282 Instruction::kNotSpeculative, kUnboxedDouble);
7283 flow_graph->InsertBefore(this, instr, env(), FlowGraph::kValue);
7284 return instr;
7285 }
7286
7287 return this;
7288}
static CompilerState & Current()
friend class Value
Definition: il.h:2690
intptr_t GetDeoptId() const
Definition: il.h:1409
Environment * env() const
Definition: il.h:1215
@ kNotSpeculative
Definition: il.h:975
static bool double_truncate_round_supported()
Definition: cpu_arm.h:72
Value * InputAt(intptr_t i) const
Definition: il.h:2795

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Definition at line 10267 of file il.h.

10267{ return false; }

◆ DeoptimizationTarget()

virtual intptr_t dart::InvokeMathCFunctionInstr::DeoptimizationTarget ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 10281 of file il.h.

10281{ return GetDeoptId(); }

◆ HasUnknownSideEffects()

virtual bool dart::InvokeMathCFunctionInstr::HasUnknownSideEffects ( ) const
inlinevirtual

Implements dart::Instruction.

Definition at line 10284 of file il.h.

10284{ return false; }

◆ MayThrow()

virtual bool dart::InvokeMathCFunctionInstr::MayThrow ( ) const
inlinevirtual

Implements dart::Instruction.

Definition at line 10293 of file il.h.

10293{ return false; }

◆ recognized_kind()

MethodRecognizer::Kind dart::InvokeMathCFunctionInstr::recognized_kind ( ) const
inline

Definition at line 10261 of file il.h.

10261{ return recognized_kind_; }

◆ representation()

virtual Representation dart::InvokeMathCFunctionInstr::representation ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 10269 of file il.h.

10269{ return kUnboxedDouble; }

◆ RequiredInputRepresentation()

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

Reimplemented from dart::Instruction.

Definition at line 10271 of file il.h.

10271 {
10272 ASSERT((0 <= idx) && (idx < InputCount()));
10273 return kUnboxedDouble;
10274 }

◆ SpeculativeModeOfInput()

virtual SpeculativeMode dart::InvokeMathCFunctionInstr::SpeculativeModeOfInput ( intptr_t  idx) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 10276 of file il.h.

10276 {
10277 ASSERT((0 <= idx) && (idx < InputCount()));
10278 return kNotSpeculative;
10279 }

◆ TargetFunction()

const RuntimeEntry & dart::InvokeMathCFunctionInstr::TargetFunction ( ) const

Definition at line 7223 of file il.cc.

7223 {
7224 switch (recognized_kind_) {
7225 case MethodRecognizer::kDoubleTruncateToDouble:
7226 return kLibcTruncRuntimeEntry;
7227 case MethodRecognizer::kDoubleRoundToDouble:
7228 return kLibcRoundRuntimeEntry;
7229 case MethodRecognizer::kDoubleFloorToDouble:
7230 return kLibcFloorRuntimeEntry;
7231 case MethodRecognizer::kDoubleCeilToDouble:
7232 return kLibcCeilRuntimeEntry;
7233 case MethodRecognizer::kMathDoublePow:
7234 return kLibcPowRuntimeEntry;
7235 case MethodRecognizer::kDoubleMod:
7236 return kDartModuloRuntimeEntry;
7237 case MethodRecognizer::kDoubleRem:
7238 return kLibcFmodRuntimeEntry;
7239 case MethodRecognizer::kMathTan:
7240 return kLibcTanRuntimeEntry;
7241 case MethodRecognizer::kMathAsin:
7242 return kLibcAsinRuntimeEntry;
7243 case MethodRecognizer::kMathSin:
7244 return kLibcSinRuntimeEntry;
7245 case MethodRecognizer::kMathCos:
7246 return kLibcCosRuntimeEntry;
7247 case MethodRecognizer::kMathAcos:
7248 return kLibcAcosRuntimeEntry;
7249 case MethodRecognizer::kMathAtan:
7250 return kLibcAtanRuntimeEntry;
7251 case MethodRecognizer::kMathAtan2:
7252 return kLibcAtan2RuntimeEntry;
7253 case MethodRecognizer::kMathExp:
7254 return kLibcExpRuntimeEntry;
7255 case MethodRecognizer::kMathLog:
7256 return kLibcLogRuntimeEntry;
7257 default:
7258 UNREACHABLE();
7259 }
7260 return kLibcPowRuntimeEntry;
7261}

◆ token_pos()

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

Reimplemented from dart::Instruction.

Definition at line 10263 of file il.h.

10263{ return token_pos_; }

Member Data Documentation

◆ kDoubleTempIndex

constexpr intptr_t dart::InvokeMathCFunctionInstr::kDoubleTempIndex = 2
staticconstexpr

Definition at line 10297 of file il.h.

◆ kObjectTempIndex

constexpr intptr_t dart::InvokeMathCFunctionInstr::kObjectTempIndex = 1
staticconstexpr

Definition at line 10296 of file il.h.

◆ kSavedSpTempIndex

constexpr intptr_t dart::InvokeMathCFunctionInstr::kSavedSpTempIndex = 0
staticconstexpr

Definition at line 10295 of file il.h.


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