Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
dart::compiler::ffi::NativeLocation Class Referenceabstract

#include <native_location.h>

Inheritance diagram for dart::compiler::ffi::NativeLocation:
dart::ZoneAllocated dart::compiler::ffi::BothNativeLocations dart::compiler::ffi::MultipleNativeLocations dart::compiler::ffi::NativeFpuRegistersLocation dart::compiler::ffi::NativeRegistersLocation dart::compiler::ffi::NativeStackLocation dart::compiler::ffi::PointerToMemoryLocation

Public Member Functions

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)
 

Static Public Member Functions

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

 NativeLocation (const NativeType &payload_type, const NativeType &container_type)
 

Detailed Description

Definition at line 63 of file native_location.h.

Constructor & Destructor Documentation

◆ ~NativeLocation()

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

Definition at line 141 of file native_location.h.

141{}

◆ NativeLocation()

dart::compiler::ffi::NativeLocation::NativeLocation ( const NativeType payload_type,
const NativeType container_type 
)
inlineprotected

Definition at line 144 of file native_location.h.

146 : payload_type_(payload_type), container_type_(container_type) {}
const NativeType & container_type() const
const NativeType & payload_type() const

Member Function Documentation

◆ AsBoth()

const BothNativeLocations & dart::compiler::ffi::NativeLocation::AsBoth ( ) const

Definition at line 100 of file native_location.cc.

100 {
101 ASSERT(IsBoth());
102 return static_cast<const BothNativeLocations&>(*this);
103}
#define ASSERT(E)

◆ AsFpuRegisters()

const NativeFpuRegistersLocation & dart::compiler::ffi::NativeLocation::AsFpuRegisters ( ) const

Definition at line 80 of file native_location.cc.

80 {
82 return static_cast<const NativeFpuRegistersLocation&>(*this);
83}

◆ AsLocation()

virtual Location dart::compiler::ffi::NativeLocation::AsLocation ( ) const
inlinevirtual

◆ AsMultiple()

const MultipleNativeLocations & dart::compiler::ffi::NativeLocation::AsMultiple ( ) const

Definition at line 90 of file native_location.cc.

90 {
92 return static_cast<const MultipleNativeLocations&>(*this);
93}

◆ AsPointerToMemory()

const PointerToMemoryLocation & dart::compiler::ffi::NativeLocation::AsPointerToMemory ( ) const

Definition at line 95 of file native_location.cc.

95 {
97 return static_cast<const PointerToMemoryLocation&>(*this);
98}
virtual bool IsPointerToMemory() const

◆ AsRegisters()

const NativeRegistersLocation & dart::compiler::ffi::NativeLocation::AsRegisters ( ) const

Definition at line 75 of file native_location.cc.

75 {
77 return static_cast<const NativeRegistersLocation&>(*this);
78}

◆ AsStack()

const NativeStackLocation & dart::compiler::ffi::NativeLocation::AsStack ( ) const

Definition at line 85 of file native_location.cc.

85 {
86 ASSERT(IsStack());
87 return static_cast<const NativeStackLocation&>(*this);
88}

◆ container_type()

const NativeType & dart::compiler::ffi::NativeLocation::container_type ( ) const
inline

Definition at line 85 of file native_location.h.

85{ return container_type_; }

◆ Equals()

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

◆ FromLocation()

NativeLocation & dart::compiler::ffi::NativeLocation::FromLocation ( Zone zone,
Location  loc,
Representation  rep 
)
static

Definition at line 32 of file native_location.cc.

34 {
36
37 const NativeType& native_rep = NativeType::FromRepresentation(zone, rep);
38
39 switch (loc.kind()) {
40 case Location::Kind::kRegister:
41 return *new (zone)
42 NativeRegistersLocation(zone, native_rep, native_rep, loc.reg());
43 case Location::Kind::kFpuRegister:
44 return *new (zone)
45 NativeFpuRegistersLocation(native_rep, native_rep, loc.fpu_reg());
46 case Location::Kind::kStackSlot:
47 return *new (zone)
48 NativeStackLocation(native_rep, native_rep, loc.base_reg(),
49 loc.stack_index() * compiler::target::kWordSize);
50 case Location::Kind::kDoubleStackSlot:
51 return *new (zone)
52 NativeStackLocation(native_rep, native_rep, loc.base_reg(),
53 loc.stack_index() * compiler::target::kWordSize);
54 default:
55 break;
56 }
57
59}
#define UNREACHABLE()
Definition: assert.h:248
static bool LocationCanBeExpressed(Location loc, Representation rep)
static NativePrimitiveType & FromRepresentation(Zone *zone, Representation rep)
Definition: native_type.cc:632
static constexpr intptr_t kWordSize
Definition: runtime_api.h:274

◆ FromPairLocation()

NativeLocation & dart::compiler::ffi::NativeLocation::FromPairLocation ( Zone zone,
Location  loc,
Representation  rep,
intptr_t  index 
)
static

Definition at line 61 of file native_location.cc.

64 {
65 ASSERT(pair_loc.IsPairLocation());
66 ASSERT(index == 0 || index == 1);
67 const Representation rep = NativeType::FromRepresentation(zone, pair_rep)
68 .Split(zone, index)
70 const Location loc = pair_loc.AsPairLocation()->At(index);
71 return FromLocation(zone, loc, rep);
72}
static NativeLocation & FromLocation(Zone *zone, Location loc, Representation rep)
virtual Representation AsRepresentation() const
Definition: native_type.cc:313
virtual NativePrimitiveType & Split(Zone *zone, intptr_t part) const
Definition: native_type.cc:396
Representation
Definition: locations.h:66

◆ IsBoth()

virtual bool dart::compiler::ffi::NativeLocation::IsBoth ( ) const
inlinevirtual

Reimplemented in dart::compiler::ffi::BothNativeLocations.

Definition at line 104 of file native_location.h.

104{ return false; }

◆ IsExpressibleAsLocation()

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

◆ IsFpuRegisters()

virtual bool dart::compiler::ffi::NativeLocation::IsFpuRegisters ( ) const
inlinevirtual

Reimplemented in dart::compiler::ffi::NativeFpuRegistersLocation.

Definition at line 100 of file native_location.h.

100{ return false; }

◆ IsMultiple()

virtual bool dart::compiler::ffi::NativeLocation::IsMultiple ( ) const
inlinevirtual

Reimplemented in dart::compiler::ffi::MultipleNativeLocations.

Definition at line 102 of file native_location.h.

102{ return false; }

◆ IsPointerToMemory()

virtual bool dart::compiler::ffi::NativeLocation::IsPointerToMemory ( ) const
inlinevirtual

Reimplemented in dart::compiler::ffi::PointerToMemoryLocation.

Definition at line 103 of file native_location.h.

103{ return false; }

◆ IsRegisters()

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

Reimplemented in dart::compiler::ffi::NativeRegistersLocation.

Definition at line 99 of file native_location.h.

99{ return false; }

◆ IsStack()

virtual bool dart::compiler::ffi::NativeLocation::IsStack ( ) const
inlinevirtual

Reimplemented in dart::compiler::ffi::NativeStackLocation.

Definition at line 101 of file native_location.h.

101{ return false; }

◆ LocationCanBeExpressed()

bool dart::compiler::ffi::NativeLocation::LocationCanBeExpressed ( Location  loc,
Representation  rep 
)
static

Definition at line 16 of file native_location.cc.

16 {
17 switch (loc.kind()) {
18 case Location::Kind::kRegister:
19 case Location::Kind::kFpuRegister:
20 case Location::Kind::kStackSlot:
21 case Location::Kind::kDoubleStackSlot:
22 return true;
23 default:
24 break;
25 }
26 if (loc.IsPairLocation()) {
27 return false;
28 }
29 return false;
30}

◆ payload_type()

const NativeType & dart::compiler::ffi::NativeLocation::payload_type ( ) const
inline

Definition at line 77 of file native_location.h.

77{ return payload_type_; }

◆ PrintTo()

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

◆ Split()

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

◆ StackTopInBytes()

virtual intptr_t dart::compiler::ffi::NativeLocation::StackTopInBytes ( ) const
inlinevirtual

◆ ToCString() [1/2]

const char * dart::compiler::ffi::NativeLocation::ToCString ( ) const

Definition at line 374 of file native_location.cc.

374 {
375 return ToCString(Thread::Current()->zone());
376}
static Thread * Current()
Definition: thread.h:362

◆ ToCString() [2/2]

const char * dart::compiler::ffi::NativeLocation::ToCString ( Zone zone) const

Definition at line 338 of file native_location.cc.

338 {
339 ZoneTextBuffer textBuffer(zone);
340 PrintTo(&textBuffer);
341 return textBuffer.buffer();
342}
virtual void PrintTo(BaseTextBuffer *f) const

◆ WidenTo4Bytes()

NativeLocation & dart::compiler::ffi::NativeLocation::WidenTo4Bytes ( Zone zone) const

Definition at line 187 of file native_location.cc.

187 {
190}
virtual NativeLocation & WithOtherNativeType(Zone *zone, const NativeType &new_payload_type, const NativeType &new_container_type) const =0
NativeLocation & WidenTo4Bytes(Zone *zone) const

◆ WidenTo8Bytes()

NativeLocation & dart::compiler::ffi::NativeLocation::WidenTo8Bytes ( Zone zone) const

Definition at line 192 of file native_location.cc.

192 {
195}
NativeLocation & WidenTo8Bytes(Zone *zone) const

◆ WithOtherNativeType()

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

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