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

#include <il.h>

Inheritance diagram for dart::NativeEntryInstr:
dart::FunctionEntryInstr dart::BlockEntryWithInitialDefs dart::BlockEntryInstr dart::TemplateInstruction< 0, NoThrow > dart::Instruction dart::ZoneAllocated

Public Member Functions

 NativeEntryInstr (const compiler::ffi::CallbackMarshaller &marshaller, GraphEntryInstr *graph_entry, intptr_t block_id, intptr_t try_index, intptr_t deopt_id)
 
DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(NativeEntryInstr, FunctionEntryInstr, FIELD_LIST) private void SaveArgument (FlowGraphCompiler *compiler, const compiler::ffi::NativeLocation &loc) const
 
- Public Member Functions inherited from dart::FunctionEntryInstr
 FunctionEntryInstr (GraphEntryInstr *graph_entry, intptr_t block_id, intptr_t try_index, intptr_t deopt_id)
 
virtual intptr_t PredecessorCount () const
 
virtual BlockEntryInstrPredecessorAt (intptr_t index) const
 
GraphEntryInstrgraph_entry () const
 
- Public Member Functions inherited from dart::BlockEntryWithInitialDefs
 BlockEntryWithInitialDefs (intptr_t block_id, intptr_t try_index, intptr_t deopt_id, intptr_t stack_depth)
 
GrowableArray< Definition * > * initial_definitions ()
 
const GrowableArray< Definition * > * initial_definitions () const
 
virtual BlockEntryWithInitialDefsAsBlockEntryWithInitialDefs ()
 
virtual const BlockEntryWithInitialDefsAsBlockEntryWithInitialDefs () const
 
- Public Member Functions inherited from dart::BlockEntryInstr
virtual intptr_t PredecessorCount () const =0
 
virtual BlockEntryInstrPredecessorAt (intptr_t index) const =0
 
intptr_t preorder_number () const
 
void set_preorder_number (intptr_t number)
 
intptr_t postorder_number () const
 
void set_postorder_number (intptr_t number)
 
intptr_t block_id () const
 
void set_start_pos (intptr_t pos)
 
intptr_t start_pos () const
 
void set_end_pos (intptr_t pos)
 
intptr_t end_pos () const
 
BlockEntryInstrdominator () const
 
BlockEntryInstrImmediateDominator () const
 
const GrowableArray< BlockEntryInstr * > & dominated_blocks ()
 
void AddDominatedBlock (BlockEntryInstr *block)
 
void ClearDominatedBlocks ()
 
bool Dominates (BlockEntryInstr *other) const
 
Instructionlast_instruction () const
 
void set_last_instruction (Instruction *instr)
 
ParallelMoveInstrparallel_move () const
 
bool HasParallelMove () const
 
bool HasNonRedundantParallelMove () const
 
ParallelMoveInstrGetParallelMove ()
 
bool DiscoverBlock (BlockEntryInstr *predecessor, GrowableArray< BlockEntryInstr * > *preorder, GrowableArray< intptr_t > *parent)
 
virtual bool CanBecomeDeoptimizationTarget () const
 
virtual bool ComputeCanDeoptimize () const
 
virtual bool HasUnknownSideEffects () const
 
intptr_t try_index () const
 
void set_try_index (intptr_t index)
 
bool InsideTryBlock () const
 
LoopInfoloop_info () const
 
void set_loop_info (LoopInfo *loop_info)
 
bool IsLoopHeader () const
 
intptr_t NestingDepth () const
 
virtual BlockEntryInstrGetBlock ()
 
virtual TokenPosition token_pos () const
 
void ReplaceAsPredecessorWith (BlockEntryInstr *new_block)
 
void set_block_id (intptr_t block_id)
 
intptr_t stack_depth () const
 
void set_stack_depth (intptr_t s)
 
void ClearAllInstructions ()
 
InstructionsIterable instructions ()
 
- Public Member Functions inherited from dart::TemplateInstruction< 0, NoThrow >
 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
 
- 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 Attributes

static constexpr intptr_t kVMTagOffsetFromFp
 
- Static Public Attributes inherited from dart::Instruction
static const intptr_t kInstructionAttrs [kNumInstructions]
 

Additional Inherited Members

- Public Types inherited from dart::TemplateInstruction< 0, NoThrow >
using BaseClass = typename NoCSE< Instruction, PureInstruction >::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::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)
 
- Protected Member Functions inherited from dart::BlockEntryWithInitialDefs
virtual void PrintBlockHeaderTo (BaseTextBuffer *f) const
 
void PrintInitialDefinitionsTo (BaseTextBuffer *f, std::function< void(BaseTextBuffer *f)> callback) const
 
- Protected Member Functions inherited from dart::BlockEntryInstr
 BlockEntryInstr (intptr_t block_id, intptr_t try_index, intptr_t deopt_id, intptr_t stack_depth)
 
bool FindOsrEntryAndRelink (GraphEntryInstr *graph_entry, Instruction *parent, BitVector *block_marks)
 
- 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::TemplateInstruction< 0, NoThrow >
EmbeddedArray< Value *, Ninputs_
 

Detailed Description

Definition at line 2233 of file il.h.

Constructor & Destructor Documentation

◆ NativeEntryInstr()

dart::NativeEntryInstr::NativeEntryInstr ( const compiler::ffi::CallbackMarshaller marshaller,
GraphEntryInstr graph_entry,
intptr_t  block_id,
intptr_t  try_index,
intptr_t  deopt_id 
)
inline

Definition at line 2238 of file il.h.

2244 marshaller_(marshaller) {}
intptr_t try_index() const
Definition: il.h:1730
intptr_t block_id() const
Definition: il.h:1661
GraphEntryInstr * graph_entry() const
Definition: il.h:2212
FunctionEntryInstr(GraphEntryInstr *graph_entry, intptr_t block_id, intptr_t try_index, intptr_t deopt_id)
Definition: il.h:2192
intptr_t deopt_id() const
Definition: il.h:993

Member Function Documentation

◆ SaveArgument()

void dart::NativeEntryInstr::SaveArgument ( FlowGraphCompiler compiler,
const compiler::ffi::NativeLocation loc 
) const

Definition at line 4420 of file il.cc.

4422 {
4423 if (nloc.IsStack()) return;
4424
4425 if (nloc.IsRegisters()) {
4426 const auto& reg_loc = nloc.WidenTo4Bytes(compiler->zone()).AsRegisters();
4427 const intptr_t num_regs = reg_loc.num_regs();
4428 // Save higher-order component first, so bytes are in little-endian layout
4429 // overall.
4430 for (intptr_t i = num_regs - 1; i >= 0; i--) {
4431 __ PushRegister(reg_loc.reg_at(i));
4432 }
4433 } else if (nloc.IsFpuRegisters()) {
4434 // TODO(dartbug.com/40469): Reduce code size.
4435 __ AddImmediate(SPREG, -8);
4436 NoTemporaryAllocator temp_alloc;
4437 const auto& dst = compiler::ffi::NativeStackLocation(
4438 nloc.payload_type(), nloc.payload_type(), SPREG, 0);
4439 compiler->EmitNativeMove(dst, nloc, &temp_alloc);
4440 } else if (nloc.IsPointerToMemory()) {
4441 const auto& pointer_loc = nloc.AsPointerToMemory().pointer_location();
4442 if (pointer_loc.IsRegisters()) {
4443 const auto& regs_loc = pointer_loc.AsRegisters();
4444 ASSERT(regs_loc.num_regs() == 1);
4445 __ PushRegister(regs_loc.reg_at(0));
4446 } else {
4447 ASSERT(pointer_loc.IsStack());
4448 // It's already on the stack, so we don't have to save it.
4449 }
4450 } else if (nloc.IsMultiple()) {
4451 const auto& multiple = nloc.AsMultiple();
4452 const intptr_t num = multiple.locations().length();
4453 // Save the argument registers, in reverse order.
4454 for (intptr_t i = num; i-- > 0;) {
4455 SaveArgument(compiler, *multiple.locations().At(i));
4456 }
4457 } else {
4458 ASSERT(nloc.IsBoth());
4459 const auto& both = nloc.AsBoth();
4460 SaveArgument(compiler, both.location(0));
4461 }
4462}
DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(NativeEntryInstr, FunctionEntryInstr, FIELD_LIST) private void SaveArgument(FlowGraphCompiler *compiler, const compiler::ffi::NativeLocation &loc) const
Definition: il.cc:4420
#define ASSERT(E)
#define __
Definition: il.cc:4271
const Register SPREG
dst
Definition: cp.py:12

Member Data Documentation

◆ kVMTagOffsetFromFp

constexpr intptr_t dart::NativeEntryInstr::kVMTagOffsetFromFp
staticconstexpr
Initial value:
=
static constexpr intptr_t kWordSize
Definition: runtime_api.h:274

Definition at line 2235 of file il.h.


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