Flutter Engine
The Flutter Engine
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 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 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 6184 of file il.h.

Member Function Documentation

◆ CanCallDart()

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

Reimplemented from dart::Instruction.

Definition at line 6208 of file il.h.

6208{ return false; }

◆ ComputeCanDeoptimize()

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

Implements dart::Instruction.

Definition at line 6204 of file il.h.

6204{ return false; }

◆ ComputeType()

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

Reimplemented from dart::Definition.

Definition at line 6237 of file il.h.

6237 {
6240 : CompileType::Object();
6241 }
static CompileType FromUnboxedRepresentation(Representation rep)
virtual Representation representation() const
Definition: il.h:6233
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 8191 of file il.cc.

8193 {
8194 if (native_calling_convention_.StackTopInBytes() == 0) {
8195 return;
8196 }
8197
8198 ConstantTemporaryAllocator temp_alloc(temp0);
8199 compiler::ffi::FrameRebase rebase(compiler->zone(), /*old_base=*/FPREG,
8200 /*new_base=*/saved_fp,
8201 /*stack_delta=*/0);
8202
8203 __ Comment("EmitParamMoves");
8204 const auto& argument_locations =
8205 native_calling_convention_.argument_locations();
8206 for (intptr_t i = 0, n = argument_locations.length(); i < n; ++i) {
8207 const auto& argument_location = *argument_locations.At(i);
8208 if (argument_location.IsRegisters()) {
8209 const auto& reg_location = argument_location.AsRegisters();
8210 ASSERT(reg_location.num_regs() == 1);
8211 const Location src_loc = rebase.Rebase(locs()->in(i));
8213 compiler->EmitMoveToNative(argument_location, src_loc, src_rep,
8214 &temp_alloc);
8215 } else if (argument_location.IsFpuRegisters()) {
8216 UNIMPLEMENTED();
8217 } else if (argument_location.IsStack()) {
8218 const Location src_loc = rebase.Rebase(locs()->in(i));
8220 __ Comment("Param %" Pd ": %s %s -> %s", i, src_loc.ToCString(),
8222 argument_location.ToCString());
8223 compiler->EmitMoveToNative(argument_location, src_loc, src_rep,
8224 &temp_alloc);
8225 } else {
8226 UNIMPLEMENTED();
8227 }
8228 }
8229 __ Comment("EmitParamMovesEnd");
8230}
const T & At(intptr_t index) const
LocationSummary * locs()
Definition: il.h:1192
virtual Representation RequiredInputRepresentation(intptr_t idx) const
Definition: il.h:6210
#define UNIMPLEMENTED
#define ASSERT(E)
#define __
Definition: il.cc:4271
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 6206 of file il.h.

6206{ return true; }

◆ Make()

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

Definition at line 8175 of file il.cc.

8179 {
8180 const auto& native_function_type =
8182 zone, return_representation, argument_representations);
8183 const auto& native_calling_convention =
8185 zone, native_function_type);
8186 return new (zone)
8187 LeafRuntimeCallInstr(return_representation, argument_representations,
8188 native_calling_convention, std::move(inputs));
8189}
InputsIterable inputs()
Definition: il.h:1033
static const NativeCallingConvention & FromSignature(Zone *zone, const NativeFunctionType &signature)
static const NativeFunctionType * FromRepresentations(Zone *zone, Representation return_representation, const ZoneGrowableArray< Representation > &argument_representations)
Definition: native_type.cc:637

◆ MakeLocationSummaryInternal()

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

Definition at line 8113 of file il.cc.

8115 {
8116 LocationSummary* summary =
8117 new (zone) LocationSummary(zone, /*num_inputs=*/InputCount(),
8118 /*num_temps=*/Utils::CountOneBitsWord(temps),
8120
8121 intptr_t reg_i = 0;
8122 for (intptr_t reg = 0; reg < kNumberOfCpuRegisters; reg++) {
8123 if ((temps & (1 << reg)) != 0) {
8124 summary->set_temp(reg_i,
8125 Location::RegisterLocation(static_cast<Register>(reg)));
8126 reg_i++;
8127 }
8128 }
8129
8130 summary->set_in(TargetAddressIndex(),
8133
8134 const auto& argument_locations =
8135 native_calling_convention_.argument_locations();
8136 for (intptr_t i = 0, n = argument_locations.length(); i < n; ++i) {
8137 const auto& argument_location = *argument_locations.At(i);
8138 if (argument_location.IsRegisters()) {
8139 const auto& reg_location = argument_location.AsRegisters();
8140 ASSERT(reg_location.num_regs() == 1);
8141 summary->set_in(i, reg_location.AsLocation());
8142 } else if (argument_location.IsFpuRegisters()) {
8143 UNIMPLEMENTED();
8144 } else if (argument_location.IsStack()) {
8145 summary->set_in(i, Location::Any());
8146 } else {
8147 UNIMPLEMENTED();
8148 }
8149 }
8150 const auto& return_location = native_calling_convention_.return_location();
8151 ASSERT(return_location.IsRegisters());
8152 summary->set_out(0, return_location.AsLocation());
8153 return summary;
8154}
static constexpr Register kFirstNonArgumentRegister
intptr_t TargetAddressIndex() const
Definition: il.h:6198
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:176
intptr_t InputCount() const
Definition: il.h:2794
@ kNumberOfCpuRegisters
Definition: constants_arm.h:98

◆ MayCreateUnsafeUntaggedPointer()

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

Reimplemented from dart::Definition.

Definition at line 6218 of file il.h.

6218 {
6219 if (representation() != kUntagged) return false;
6220 // Returns true iff any of the inputs to the target may be an unsafe
6221 // untagged pointer.
6222 //
6223 // This assumes that the inputs to the target function are only used during
6224 // the dynamic extent of the call and not cached/stored somehow.
6225 for (intptr_t i = 0; i < TargetAddressIndex(); i++) {
6227 return true;
6228 }
6229 }
6230 return false;
6231 }
virtual bool MayCreateUnsafeUntaggedPointer() const
Definition: il.h:2591
Definition * definition() const
Definition: il.h:103
Value * InputAt(intptr_t i) const
Definition: il.h:2795

◆ MayThrow()

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

Implements dart::Instruction.

Definition at line 6202 of file il.h.

6202{ return false; }

◆ representation()

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

Reimplemented from dart::Instruction.

Definition at line 6233 of file il.h.

6233 {
6234 return return_representation_;
6235 }

◆ RequiredInputRepresentation()

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

Reimplemented from dart::Instruction.

Definition at line 6210 of file il.h.

6210 {
6211 if (idx < argument_representations_.length()) {
6212 return argument_representations_.At(idx);
6213 }
6215 return kUntagged;
6216 }
#define ASSERT_EQUAL(expected, actual)
Definition: assert.h:309

◆ TargetAddressIndex()

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

Definition at line 6198 of file il.h.

6198 {
6199 return argument_representations_.length();
6200 }

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