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

#include <native_location.h>

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

Public Member Functions

 NativeStackLocation (const NativeType &payload_type, const NativeType &container_type, Register base_register, intptr_t offset_in_bytes)
 
virtual ~NativeStackLocation ()
 
virtual NativeStackLocationWithOtherNativeType (Zone *zone, const NativeType &new_payload_type, const NativeType &new_container_type) const
 
virtual bool IsStack () const
 
virtual bool IsExpressibleAsLocation () const
 
virtual Location AsLocation () const
 
Location AsDoubleStackSlotLocation () const
 
virtual NativeStackLocationSplit (Zone *zone, intptr_t num_parts, intptr_t index) const
 
virtual intptr_t StackTopInBytes () const
 
virtual void PrintTo (BaseTextBuffer *f) const
 
virtual bool Equals (const NativeLocation &other) const
 
Register base_register () const
 
intptr_t offset_in_bytes () 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 304 of file native_location.h.

Constructor & Destructor Documentation

◆ NativeStackLocation()

dart::compiler::ffi::NativeStackLocation::NativeStackLocation ( const NativeType payload_type,
const NativeType container_type,
Register  base_register,
intptr_t  offset_in_bytes 
)
inline

Definition at line 306 of file native_location.h.

311 base_register_(base_register),
312 offset_in_bytes_(offset_in_bytes) {}
const NativeType & container_type() const
NativeLocation(const NativeType &payload_type, const NativeType &container_type)
const NativeType & payload_type() const

◆ ~NativeStackLocation()

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

Definition at line 313 of file native_location.h.

313{}

Member Function Documentation

◆ AsDoubleStackSlotLocation()

Location dart::compiler::ffi::NativeStackLocation::AsDoubleStackSlotLocation ( ) const
inline

Definition at line 338 of file native_location.h.

338 {
340 return Location::DoubleStackSlot(offset_in_words(), base_register_);
341 }
static Location DoubleStackSlot(intptr_t stack_index, Register base)
Definition: locations.h:458
#define ASSERT(E)
static constexpr intptr_t kWordSize
Definition: runtime_api.h:274

◆ AsLocation()

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

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

Definition at line 118 of file native_location.cc.

118 {
120 if (payload_type().IsInt()) {
121 const intptr_t size = payload_type().SizeInBytes();
122 const intptr_t size_slots = size / compiler::target::kWordSize;
123 switch (size_slots) {
124 case 1:
125 return Location::StackSlot(offset_in_words(), base_register_);
126 case 2:
127 return Location::Pair(
128 Location::StackSlot(offset_in_words(), base_register_),
129 Location::StackSlot(offset_in_words() + 1, base_register_));
130 }
131 } else {
132 ASSERT(payload_type().IsFloat());
133 if (payload_type().AsPrimitive().representation() == kFloat) {
134 return Location::StackSlot(offset_in_words(), base_register_);
135 } else {
136 ASSERT(payload_type().AsPrimitive().representation() == kDouble);
137 return Location::DoubleStackSlot(offset_in_words(), base_register_);
138 }
139 }
141}
static Location StackSlot(intptr_t stack_index, Register base)
Definition: locations.h:447
static Location Pair(Location first, Location second)
Definition: locations.cc:271
virtual intptr_t SizeInBytes() const =0
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
#define UNREACHABLE_THIS()
Definition: native_type.h:25

◆ base_register()

Register dart::compiler::ffi::NativeStackLocation::base_register ( ) const
inline

Definition at line 356 of file native_location.h.

356{ return base_register_; }

◆ Equals()

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

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

Definition at line 248 of file native_location.cc.

248 {
249 if (!other.IsStack()) {
250 return false;
251 }
252 const auto& other_stack = other.AsStack();
253 if (other_stack.base_register_ != base_register_) {
254 return false;
255 }
256 return other_stack.offset_in_bytes_ == offset_in_bytes_;
257}

◆ IsExpressibleAsLocation()

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

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

Definition at line 324 of file native_location.h.

324 {
325 const intptr_t size = payload_type().SizeInBytes();
326 const intptr_t size_slots = size / compiler::target::kWordSize;
327 return offset_in_bytes_ % compiler::target::kWordSize == 0 &&
329 (size_slots == 1 || size_slots == 2);
330 }

◆ IsStack()

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

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

Definition at line 323 of file native_location.h.

323{ return true; }

◆ offset_in_bytes()

intptr_t dart::compiler::ffi::NativeStackLocation::offset_in_bytes ( ) const
inline

Definition at line 357 of file native_location.h.

357{ return offset_in_bytes_; }

◆ PrintTo()

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

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

Definition at line 328 of file native_location.cc.

328 {
329 if (base_register_ != SPREG) {
330 f->Printf("S(%s)+%" Pd, RegisterNames::RegisterAbiName(base_register_),
331 offset_in_bytes_);
332 } else {
333 f->Printf("S+%" Pd, offset_in_bytes_);
334 }
335 PrintRepresentations(f, *this);
336}
static const char * RegisterAbiName(Register reg)
Definition: constants.h:50
static void PrintRepresentations(BaseTextBuffer *f, const NativeLocation &loc)
const Register SPREG
#define Pd
Definition: globals.h:408

◆ Split()

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

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

Definition at line 154 of file native_location.cc.

156 {
157 const intptr_t size = payload_type().SizeInBytes();
158
159 if (payload_type().IsPrimitive()) {
160 ASSERT(num_parts == 2);
161 return *new (zone) NativeStackLocation(
162 payload_type().Split(zone, index), container_type().Split(zone, index),
163 base_register_, offset_in_bytes_ + size / num_parts * index);
164 } else {
165 const intptr_t size_rounded_up =
167 ASSERT(size_rounded_up / compiler::target::kWordSize == num_parts);
168
169 // Blocks of compiler::target::kWordSize.
170 return *new (zone) NativeStackLocation(
171 *new (zone) NativePrimitiveType(
173 *new (zone) NativePrimitiveType(
175 base_register_, offset_in_bytes_ + compiler::target::kWordSize * index);
176 }
177}
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
Definition: utils.h:120
NativeStackLocation(const NativeType &payload_type, const NativeType &container_type, Register base_register, intptr_t offset_in_bytes)
virtual NativeType & Split(Zone *zone, intptr_t index) const
Definition: native_type.h:130

◆ StackTopInBytes()

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

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

Definition at line 348 of file native_location.h.

348 {
350 }

◆ WithOtherNativeType()

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

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

Definition at line 315 of file native_location.h.

318 {
319 return *new (zone) NativeStackLocation(new_payload_type, new_container_type,
320 base_register_, offset_in_bytes_);
321 }

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