Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
dart::LeafRuntimeCallInstr Class Reference

#include <il.h>

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

Public Member Functions

LocationSummaryMakeLocationSummaryInternal (Zone *zone, const RegList temps) const
 
intptr_t TargetAddressIndex () const
 
virtual bool MayThrow () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool HasUnknownSideEffects () const
 
virtual bool CanCallDart () const
 
virtual Representation RequiredInputRepresentation (intptr_t idx) const
 
virtual bool MayCreateUnsafeUntaggedPointer () const
 
virtual Representation representation () const
 
virtual CompileType ComputeType () const
 
void EmitParamMoves (FlowGraphCompiler *compiler, Register saved_fp, Register temp0)
 
- 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 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 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
 
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 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
 
SpeculativeMode SpeculativeModeOfInputs () const
 
virtual SpeculativeMode SpeculativeModeOfInput (intptr_t index) const
 
bool WasEliminated () const
 
virtual intptr_t DeoptimizationTarget () const
 
void InsertBefore (Instruction *next)
 
void InsertAfter (Instruction *prev)
 
InstructionAppendInstruction (Instruction *tail)
 
virtual bool AllowsCSE () 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 MayHaveVisibleEffect () 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 LeafRuntimeCallInstrMake (Zone *zone, Representation return_representation, const ZoneGrowableArray< Representation > &argument_representations, InputsArray &&inputs)
 
- 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

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

Detailed Description

Definition at line 6135 of file il.h.

Member Function Documentation

◆ CanCallDart()

virtual bool dart::LeafRuntimeCallInstr::CanCallDart ( ) const
inlinevirtual

Reimplemented from dart::Instruction.

Definition at line 6159 of file il.h.

6159{ return false; }

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Definition at line 6155 of file il.h.

6155{ return false; }

◆ ComputeType()

virtual CompileType dart::LeafRuntimeCallInstr::ComputeType ( ) const
inlinevirtual

Reimplemented from dart::Definition.

Definition at line 6188 of file il.h.

6188 {
6191 : CompileType::Object();
6192 }
static CompileType FromUnboxedRepresentation(Representation rep)
virtual Representation representation() const
Definition il.h:6184
static constexpr bool IsUnboxed(Representation rep)
Definition locations.h:101

◆ EmitParamMoves()

void dart::LeafRuntimeCallInstr::EmitParamMoves ( FlowGraphCompiler compiler,
Register  saved_fp,
Register  temp0 
)

Definition at line 8042 of file il.cc.

8044 {
8045 if (native_calling_convention_.StackTopInBytes() == 0) {
8046 return;
8047 }
8048
8049 ConstantTemporaryAllocator temp_alloc(temp0);
8050 compiler::ffi::FrameRebase rebase(compiler->zone(), /*old_base=*/FPREG,
8051 /*new_base=*/saved_fp,
8052 /*stack_delta=*/0);
8053
8054 __ Comment("EmitParamMoves");
8055 const auto& argument_locations =
8056 native_calling_convention_.argument_locations();
8057 for (intptr_t i = 0, n = argument_locations.length(); i < n; ++i) {
8058 const auto& argument_location = *argument_locations.At(i);
8059 if (argument_location.IsRegisters()) {
8060 const auto& reg_location = argument_location.AsRegisters();
8061 ASSERT(reg_location.num_regs() == 1);
8062 const Location src_loc = rebase.Rebase(locs()->in(i));
8064 compiler->EmitMoveToNative(argument_location, src_loc, src_rep,
8065 &temp_alloc);
8066 } else if (argument_location.IsFpuRegisters()) {
8067 UNIMPLEMENTED();
8068 } else if (argument_location.IsStack()) {
8069 const Location src_loc = rebase.Rebase(locs()->in(i));
8071 __ Comment("Param %" Pd ": %s %s -> %s", i, src_loc.ToCString(),
8073 argument_location.ToCString());
8074 compiler->EmitMoveToNative(argument_location, src_loc, src_rep,
8075 &temp_alloc);
8076 } else {
8077 UNIMPLEMENTED();
8078 }
8079 }
8080 __ Comment("EmitParamMovesEnd");
8081}
#define __
const T & At(intptr_t index) const
LocationSummary * locs()
Definition il.h:1186
virtual Representation RequiredInputRepresentation(intptr_t idx) const
Definition il.h:6161
#define UNIMPLEMENTED
#define ASSERT(E)
Representation
Definition locations.h:66
const Register FPREG
#define Pd
Definition globals.h:408
static const char * ToCString(Representation rep)
Definition locations.cc:129

◆ HasUnknownSideEffects()

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

Implements dart::Instruction.

Definition at line 6157 of file il.h.

6157{ return true; }

◆ Make()

LeafRuntimeCallInstr * dart::LeafRuntimeCallInstr::Make ( Zone zone,
Representation  return_representation,
const ZoneGrowableArray< Representation > &  argument_representations,
InputsArray &&  inputs 
)
static

Definition at line 8026 of file il.cc.

8030 {
8031 const auto& native_function_type =
8033 zone, return_representation, argument_representations);
8034 const auto& native_calling_convention =
8036 zone, native_function_type);
8037 return new (zone)
8038 LeafRuntimeCallInstr(return_representation, argument_representations,
8039 native_calling_convention, std::move(inputs));
8040}
InputsIterable inputs()
Definition il.h:1027
static const NativeCallingConvention & FromSignature(Zone *zone, const NativeFunctionType &signature)
static const NativeFunctionType * FromRepresentations(Zone *zone, Representation return_representation, const ZoneGrowableArray< Representation > &argument_representations)

◆ MakeLocationSummaryInternal()

LocationSummary * dart::LeafRuntimeCallInstr::MakeLocationSummaryInternal ( Zone zone,
const RegList  temps 
) const

Definition at line 7964 of file il.cc.

7966 {
7967 LocationSummary* summary =
7968 new (zone) LocationSummary(zone, /*num_inputs=*/InputCount(),
7969 /*num_temps=*/Utils::CountOneBitsWord(temps),
7971
7972 intptr_t reg_i = 0;
7973 for (intptr_t reg = 0; reg < kNumberOfCpuRegisters; reg++) {
7974 if ((temps & (1 << reg)) != 0) {
7975 summary->set_temp(reg_i,
7976 Location::RegisterLocation(static_cast<Register>(reg)));
7977 reg_i++;
7978 }
7979 }
7980
7981 summary->set_in(TargetAddressIndex(),
7984
7985 const auto& argument_locations =
7986 native_calling_convention_.argument_locations();
7987 for (intptr_t i = 0, n = argument_locations.length(); i < n; ++i) {
7988 const auto& argument_location = *argument_locations.At(i);
7989 if (argument_location.IsRegisters()) {
7990 const auto& reg_location = argument_location.AsRegisters();
7991 ASSERT(reg_location.num_regs() == 1);
7992 summary->set_in(i, reg_location.AsLocation());
7993 } else if (argument_location.IsFpuRegisters()) {
7994 UNIMPLEMENTED();
7995 } else if (argument_location.IsStack()) {
7996 summary->set_in(i, Location::Any());
7997 } else {
7998 UNIMPLEMENTED();
7999 }
8000 }
8001 const auto& return_location = native_calling_convention_.return_location();
8002 ASSERT(return_location.IsRegisters());
8003 summary->set_out(0, return_location.AsLocation());
8004 return summary;
8005}
static constexpr Register kFirstNonArgumentRegister
intptr_t TargetAddressIndex() const
Definition il.h:6149
static Location RegisterLocation(Register reg)
Definition locations.h:398
static Location Any()
Definition locations.h:352
static constexpr int CountOneBitsWord(uword x)
Definition utils.h:161
intptr_t InputCount() const
Definition il.h:2776
@ kNumberOfCpuRegisters

◆ MayCreateUnsafeUntaggedPointer()

virtual bool dart::LeafRuntimeCallInstr::MayCreateUnsafeUntaggedPointer ( ) const
inlinevirtual

Reimplemented from dart::Definition.

Definition at line 6169 of file il.h.

6169 {
6170 if (representation() != kUntagged) return false;
6171 // Returns true iff any of the inputs to the target may be an unsafe
6172 // untagged pointer.
6173 //
6174 // This assumes that the inputs to the target function are only used during
6175 // the dynamic extent of the call and not cached/stored somehow.
6176 for (intptr_t i = 0; i < TargetAddressIndex(); i++) {
6178 return true;
6179 }
6180 }
6181 return false;
6182 }
virtual bool MayCreateUnsafeUntaggedPointer() const
Definition il.h:2573
Definition * definition() const
Definition il.h:103
Value * InputAt(intptr_t i) const
Definition il.h:2777

◆ MayThrow()

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

Implements dart::Instruction.

Definition at line 6153 of file il.h.

6153{ return false; }

◆ representation()

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

Reimplemented from dart::Instruction.

Definition at line 6184 of file il.h.

6184 {
6185 return return_representation_;
6186 }

◆ RequiredInputRepresentation()

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

Reimplemented from dart::Instruction.

Definition at line 6161 of file il.h.

6161 {
6162 if (idx < argument_representations_.length()) {
6163 return argument_representations_.At(idx);
6164 }
6166 return kUntagged;
6167 }
#define ASSERT_EQUAL(expected, actual)
Definition assert.h:309

◆ TargetAddressIndex()

intptr_t dart::LeafRuntimeCallInstr::TargetAddressIndex ( ) const
inline

Definition at line 6149 of file il.h.

6149 {
6150 return argument_representations_.length();
6151 }

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