Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::compiler::ffi::NativeRegistersLocation Class Reference

#include <native_location.h>

Inheritance diagram for dart::compiler::ffi::NativeRegistersLocation:
dart::compiler::ffi::NativeLocation dart::ZoneAllocated

Public Member Functions

 NativeRegistersLocation (const NativeType &payload_type, const NativeType &container_type, ZoneGrowableArray< Register > *registers)
 
 NativeRegistersLocation (Zone *zone, const NativeType &payload_type, const NativeType &container_type, Register reg)
 
 NativeRegistersLocation (Zone *zone, const NativeType &payload_type, const NativeType &container_type, Register register1, Register register2)
 
virtual ~NativeRegistersLocation ()
 
virtual NativeRegistersLocationWithOtherNativeType (Zone *zone, const NativeType &new_payload_type, const NativeType &new_container_type) const
 
virtual bool IsRegisters () const
 
virtual bool IsExpressibleAsLocation () const
 
virtual Location AsLocation () const
 
intptr_t num_regs () const
 
Register reg_at (intptr_t index) const
 
virtual NativeRegistersLocationSplit (Zone *zone, intptr_t num_parts, intptr_t index) const
 
virtual void PrintTo (BaseTextBuffer *f) const
 
virtual bool Equals (const NativeLocation &other) const
 
- Public Member Functions inherited from dart::compiler::ffi::NativeLocation
const NativeTypepayload_type () const
 
const NativeTypecontainer_type () const
 
virtual NativeLocationWithOtherNativeType (Zone *zone, const NativeType &new_payload_type, const NativeType &new_container_type) const =0
 
NativeLocationWidenTo4Bytes (Zone *zone) const
 
NativeLocationWidenTo8Bytes (Zone *zone) const
 
virtual bool IsRegisters () const
 
virtual bool IsFpuRegisters () const
 
virtual bool IsStack () const
 
virtual bool IsMultiple () const
 
virtual bool IsPointerToMemory () const
 
virtual bool IsBoth () const
 
virtual bool IsExpressibleAsLocation () const
 
virtual Location AsLocation () const
 
virtual void PrintTo (BaseTextBuffer *f) const
 
const char * ToCString (Zone *zone) const
 
const char * ToCString () const
 
const NativeRegistersLocationAsRegisters () const
 
const NativeFpuRegistersLocationAsFpuRegisters () const
 
const NativeStackLocationAsStack () const
 
const MultipleNativeLocationsAsMultiple () const
 
const PointerToMemoryLocationAsPointerToMemory () const
 
const BothNativeLocationsAsBoth () const
 
virtual NativeLocationSplit (Zone *zone, intptr_t num_parts, intptr_t index) const
 
virtual intptr_t StackTopInBytes () const
 
virtual bool Equals (const NativeLocation &other) const
 
virtual ~NativeLocation ()
 
- 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

- Static Public Member Functions inherited from dart::compiler::ffi::NativeLocation
static bool LocationCanBeExpressed (Location loc, Representation rep)
 
static NativeLocationFromLocation (Zone *zone, Location loc, Representation rep)
 
static NativeLocationFromPairLocation (Zone *zone, Location loc, Representation rep, intptr_t index)
 
- Protected Member Functions inherited from dart::compiler::ffi::NativeLocation
 NativeLocation (const NativeType &payload_type, const NativeType &container_type)
 

Detailed Description

Definition at line 159 of file native_location.h.

Constructor & Destructor Documentation

◆ NativeRegistersLocation() [1/3]

dart::compiler::ffi::NativeRegistersLocation::NativeRegistersLocation ( const NativeType payload_type,
const NativeType container_type,
ZoneGrowableArray< Register > *  registers 
)
inline

Definition at line 161 of file native_location.h.

164 : NativeLocation(payload_type, container_type), regs_(registers) {}
const NativeType & container_type() const
NativeLocation(const NativeType &payload_type, const NativeType &container_type)
const NativeType & payload_type() const

◆ NativeRegistersLocation() [2/3]

dart::compiler::ffi::NativeRegistersLocation::NativeRegistersLocation ( Zone zone,
const NativeType payload_type,
const NativeType container_type,
Register  reg 
)
inline

Definition at line 165 of file native_location.h.

170 regs_ = new (zone) ZoneGrowableArray<Register>(zone, 1);
171 regs_->Add(reg);
172 }
void Add(const T &value)

◆ NativeRegistersLocation() [3/3]

dart::compiler::ffi::NativeRegistersLocation::NativeRegistersLocation ( Zone zone,
const NativeType payload_type,
const NativeType container_type,
Register  register1,
Register  register2 
)
inline

Definition at line 173 of file native_location.h.

179 regs_ = new (zone) ZoneGrowableArray<Register>(zone, 2);
180 regs_->Add(register1);
181 regs_->Add(register2);
182 }

◆ ~NativeRegistersLocation()

virtual dart::compiler::ffi::NativeRegistersLocation::~NativeRegistersLocation ( )
inlinevirtual

Definition at line 183 of file native_location.h.

183{}

Member Function Documentation

◆ AsLocation()

Location dart::compiler::ffi::NativeRegistersLocation::AsLocation ( ) const
virtual

Reimplemented from dart::compiler::ffi::NativeLocation.

Definition at line 106 of file native_location.cc.

106 {
108 switch (num_regs()) {
109 case 1:
110 return Location::RegisterLocation(regs_->At(0));
111 case 2:
113 Location::RegisterLocation(regs_->At(1)));
114 }
116}
const T & At(intptr_t index) const
static Location Pair(Location first, Location second)
Definition: locations.cc:271
static Location RegisterLocation(Register reg)
Definition: locations.h:398
#define ASSERT(E)
#define UNREACHABLE_THIS()
Definition: native_type.h:25

◆ Equals()

bool dart::compiler::ffi::NativeRegistersLocation::Equals ( const NativeLocation other) const
virtual

Reimplemented from dart::compiler::ffi::NativeLocation.

Definition at line 219 of file native_location.cc.

219 {
220 if (!other.IsRegisters()) {
221 return false;
222 }
223 const auto& other_regs = other.AsRegisters();
224 if (other_regs.num_regs() != num_regs()) {
225 return false;
226 }
227 for (intptr_t i = 0; i < num_regs(); i++) {
228 if (other_regs.reg_at(i) != reg_at(i)) {
229 return false;
230 }
231 }
232 return true;
233}
Register reg_at(intptr_t index) const

◆ IsExpressibleAsLocation()

virtual bool dart::compiler::ffi::NativeRegistersLocation::IsExpressibleAsLocation ( ) const
inlinevirtual

Reimplemented from dart::compiler::ffi::NativeLocation.

Definition at line 194 of file native_location.h.

194 {
195 return num_regs() == 1 || num_regs() == 2;
196 }

◆ IsRegisters()

virtual bool dart::compiler::ffi::NativeRegistersLocation::IsRegisters ( ) const
inlinevirtual

Reimplemented from dart::compiler::ffi::NativeLocation.

Definition at line 193 of file native_location.h.

193{ return true; }

◆ num_regs()

intptr_t dart::compiler::ffi::NativeRegistersLocation::num_regs ( ) const
inline

Definition at line 200 of file native_location.h.

200{ return regs_->length(); }
intptr_t length() const

◆ PrintTo()

void dart::compiler::ffi::NativeRegistersLocation::PrintTo ( BaseTextBuffer f) const
virtual

Reimplemented from dart::compiler::ffi::NativeLocation.

Definition at line 292 of file native_location.cc.

292 {
293 if (num_regs() == 1) {
294 f->Printf("%s", RegisterNames::RegisterAbiName(regs_->At(0)));
295 } else {
296 f->AddString("(");
297 for (intptr_t i = 0; i < num_regs(); i++) {
298 if (i != 0) {
299 f->Printf(", ");
300 }
301 f->Printf("%s", RegisterNames::RegisterAbiName(regs_->At(i)));
302 }
303 f->AddString(")");
304 }
305 PrintRepresentations(f, *this);
306}
static const char * RegisterAbiName(Register reg)
Definition: constants.h:50
static void PrintRepresentations(BaseTextBuffer *f, const NativeLocation &loc)

◆ reg_at()

Register dart::compiler::ffi::NativeRegistersLocation::reg_at ( intptr_t  index) const
inline

Definition at line 201 of file native_location.h.

201{ return regs_->At(index); }

◆ Split()

NativeRegistersLocation & dart::compiler::ffi::NativeRegistersLocation::Split ( Zone zone,
intptr_t  num_parts,
intptr_t  index 
) const
virtual

Reimplemented from dart::compiler::ffi::NativeLocation.

Definition at line 144 of file native_location.cc.

146 {
147 ASSERT(num_parts == 2);
148 ASSERT(num_regs() == num_parts);
149 return *new (zone) NativeRegistersLocation(
150 zone, payload_type().Split(zone, index),
151 container_type().Split(zone, index), reg_at(index));
152}
NativeRegistersLocation(const NativeType &payload_type, const NativeType &container_type, ZoneGrowableArray< Register > *registers)
virtual NativeType & Split(Zone *zone, intptr_t index) const
Definition: native_type.h:130

◆ WithOtherNativeType()

virtual NativeRegistersLocation & dart::compiler::ffi::NativeRegistersLocation::WithOtherNativeType ( Zone zone,
const NativeType new_payload_type,
const NativeType new_container_type 
) const
inlinevirtual

Implements dart::compiler::ffi::NativeLocation.

Definition at line 185 of file native_location.h.

188 {
189 return *new (zone)
190 NativeRegistersLocation(new_payload_type, new_container_type, regs_);
191 }

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