Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
dart::compiler::ffi::NativeUnionType Class Reference

#include <native_type.h>

Inheritance diagram for dart::compiler::ffi::NativeUnionType:
dart::compiler::ffi::NativeCompoundType dart::compiler::ffi::NativeType dart::ZoneAllocated

Public Member Functions

virtual bool ContainsOnlyFloats (Range range) const
 
virtual bool ContainsUnalignedMembers (intptr_t offset=0) const
 
virtual intptr_t NumPrimitiveMembersRecursive () const
 
- Public Member Functions inherited from dart::compiler::ffi::NativeCompoundType
const NativeTypesmembers () const
 
virtual bool IsCompound () const
 
virtual intptr_t SizeInBytes () const
 
virtual intptr_t AlignmentInBytesField () const
 
virtual intptr_t AlignmentInBytesStack (bool is_vararg=false) const
 
virtual bool Equals (const NativeType &other) const
 
virtual void PrintTo (BaseTextBuffer *f, bool multi_line=false, bool verbose=true) const
 
intptr_t NumberOfWordSizeChunksOnlyFloat () const
 
intptr_t NumberOfWordSizeChunksNotOnlyFloat () const
 
bool ContainsHomogeneousFloats () const
 
virtual const NativePrimitiveTypeFirstPrimitiveMember () const
 
virtual intptr_t PrimitivePairMembers (const NativePrimitiveType **first, const NativePrimitiveType **second, intptr_t offset_in_members=0) const
 
- Public Member Functions inherited from dart::compiler::ffi::NativeType
virtual bool IsPrimitive () const
 
const NativePrimitiveTypeAsPrimitive () const
 
virtual bool IsArray () const
 
const NativeArrayTypeAsArray () const
 
const NativeCompoundTypeAsCompound () const
 
virtual bool IsStruct () const
 
const NativeStructTypeAsStruct () const
 
virtual bool IsInt () const
 
virtual bool IsFloat () const
 
virtual bool IsVoid () const
 
virtual bool IsSigned () const
 
virtual bool IsExpressibleAsRepresentation () const
 
virtual Representation AsRepresentation () const
 
Representation AsRepresentationOverApprox (Zone *zone_) const
 
virtual NativeTypeSplit (Zone *zone, intptr_t index) const
 
const NativeTypeWidenTo4Bytes (Zone *zone) const
 
const NativeTypeWidenTo8Bytes (Zone *zone) const
 
const NativeTypeExtend (Zone *zone, ExtensionStrategy extension) const
 
const char * ToCString (Zone *zone, bool multi_line=false, bool verbose=true) const
 
const char * ToCString () const
 
virtual ~NativeType ()
 
- 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 NativeUnionTypeFromNativeTypes (Zone *zone, const NativeTypes &members)
 
- Static Public Member Functions inherited from dart::compiler::ffi::NativeType
static const NativeTypeFromAbstractType (Zone *zone, const AbstractType &type, const char **error)
 
static const NativeTypeFromTypedDataClassId (Zone *zone, classid_t class_id)
 
static NativePrimitiveTypeFromRepresentation (Zone *zone, Representation rep)
 

Protected Member Functions

virtual void PrintCompoundType (BaseTextBuffer *f) const
 
- Protected Member Functions inherited from dart::compiler::ffi::NativeCompoundType
 NativeCompoundType (const NativeTypes &members, intptr_t size, intptr_t alignment_field, intptr_t alignment_stack)
 
virtual void PrintMemberOffset (BaseTextBuffer *f, intptr_t member_index) const
 
- Protected Member Functions inherited from dart::compiler::ffi::NativeType
 NativeType ()
 

Additional Inherited Members

- Protected Attributes inherited from dart::compiler::ffi::NativeCompoundType
const NativeTypesmembers_
 
const intptr_t size_
 
const intptr_t alignment_field_
 
const intptr_t alignment_stack_
 

Detailed Description

Definition at line 434 of file native_type.h.

Member Function Documentation

◆ ContainsOnlyFloats()

bool dart::compiler::ffi::NativeUnionType::ContainsOnlyFloats ( Range  range) const
virtual

Implements dart::compiler::ffi::NativeCompoundType.

Definition at line 963 of file native_type.cc.

963 {
964 for (intptr_t i = 0; i < members_.length(); i++) {
965 const auto& member = *members_[i];
966 const intptr_t member_size = member.SizeInBytes();
967 const auto member_range = Range::StartAndLength(0, member_size);
968 if (member_range.Overlaps(range)) {
969 const auto member_range_clipped = member_range.Intersect(range);
970 if (!member.ContainsOnlyFloats(member_range_clipped)) {
971 return false;
972 }
973 }
974 }
975 return true;
976}
intptr_t length() const
static Range StartAndLength(intptr_t start_inclusive, intptr_t length)
Definition range.h:28

◆ ContainsUnalignedMembers()

bool dart::compiler::ffi::NativeUnionType::ContainsUnalignedMembers ( intptr_t  offset = 0) const
virtual

Implements dart::compiler::ffi::NativeCompoundType.

Definition at line 1035 of file native_type.cc.

1035 {
1036 for (intptr_t i = 0; i < members_.length(); i++) {
1037 const auto& member = *members_.At(i);
1038 if (member.ContainsUnalignedMembers(offset)) {
1039 return true;
1040 }
1041 }
1042 return false;
1043}
const T & At(intptr_t index) const
Point offset

◆ FromNativeTypes()

NativeUnionType & dart::compiler::ffi::NativeUnionType::FromNativeTypes ( Zone zone,
const NativeTypes members 
)
static

Definition at line 256 of file native_type.cc.

257 {
258 intptr_t size = 0;
259
260 const intptr_t kAtLeast1ByteAligned = 1;
261 // If this union is nested in a struct, it should be aligned to the
262 // largest alignment of its members.
263 intptr_t alignment_field = kAtLeast1ByteAligned;
264 // If this union is passed on the stack, it should be aligned to the largest
265 // alignment of its members when passing those members on the stack.
266 intptr_t alignment_stack = kAtLeast1ByteAligned;
267
268 for (intptr_t i = 0; i < members.length(); i++) {
269 const NativeType& member = *members[i];
270 const intptr_t member_size = member.SizeInBytes();
271 const intptr_t member_align_field = member.AlignmentInBytesField();
272 const intptr_t member_align_stack = member.AlignmentInBytesStack();
273 size = Utils::Maximum(size, member_size);
274 alignment_field = Utils::Maximum(alignment_field, member_align_field);
275 alignment_stack = Utils::Maximum(alignment_stack, member_align_stack);
276 }
277 size = Utils::RoundUp(size, alignment_field);
278
279 return *new (zone)
280 NativeUnionType(members, size, alignment_field, alignment_stack);
281}
static constexpr T Maximum(T x, T y)
Definition utils.h:26
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
Definition utils.h:105
const NativeTypes & members() const
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

◆ NumPrimitiveMembersRecursive()

intptr_t dart::compiler::ffi::NativeUnionType::NumPrimitiveMembersRecursive ( ) const
virtual

Implements dart::compiler::ffi::NativeCompoundType.

Definition at line 828 of file native_type.cc.

828 {
829 intptr_t count = 0;
830 for (intptr_t i = 0; i < members_.length(); i++) {
832 }
833 return count;
834}
int count
virtual intptr_t NumPrimitiveMembersRecursive() const

◆ PrintCompoundType()

void dart::compiler::ffi::NativeUnionType::PrintCompoundType ( BaseTextBuffer f) const
protectedvirtual

Implements dart::compiler::ffi::NativeCompoundType.

Definition at line 782 of file native_type.cc.

782 {
783 f->AddString("Union");
784}

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