5#ifndef RUNTIME_VM_COMPILER_FFI_NATIVE_TYPE_H_
6#define RUNTIME_VM_COMPILER_FFI_NATIVE_TYPE_H_
14#if !defined(DART_PRECOMPILED_RUNTIME)
17#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(FFI_UNIT_TESTS)
20#if !defined(FFI_UNIT_TESTS)
24#if !defined(FFI_UNIT_TESTS)
25#define UNREACHABLE_THIS() FATAL("Unreachable code with: %s", ToCString())
28#define UNREACHABLE_THIS() UNREACHABLE()
39class NativePrimitiveType;
41class NativeCompoundType;
42class NativeStructType;
68#if !defined(FFI_UNIT_TESTS)
75#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(FFI_UNIT_TESTS)
82 virtual bool IsArray()
const {
return false; }
86 virtual bool IsStruct()
const {
return false; }
89 virtual bool IsInt()
const {
return false; }
90 virtual bool IsFloat()
const {
return false; }
91 virtual bool IsVoid()
const {
return false; }
93 virtual bool IsSigned()
const {
return false; }
106#if !defined(DART_PRECOMPILED_RUNTIME)
116#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(FFI_UNIT_TESTS)
154 bool multi_line =
false,
157 bool multi_line =
false,
159#if !defined(FFI_UNIT_TESTS)
171 intptr_t offset_in_members = 0)
const = 0;
207#if defined(TARGET_ARCH_IS_32_BIT)
229 virtual bool IsInt()
const;
231 virtual bool IsVoid()
const;
239#if !defined(DART_PRECOMPILED_RUNTIME)
245#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(FFI_UNIT_TESTS)
254 bool multi_line =
false,
261 intptr_t offset_in_members = 0)
const;
279 intptr_t
length()
const {
return length_; }
293#if !defined(DART_PRECOMPILED_RUNTIME)
302 bool multi_line =
false,
309 intptr_t offset_in_members = 0)
const;
313 const intptr_t length_;
334 bool multi_line =
false,
337#if !defined(DART_PRECOMPILED_RUNTIME)
363 intptr_t offset_in_members = 0)
const;
368 intptr_t alignment_field,
369 intptr_t alignment_stack)
382 intptr_t member_index)
const {}
393 return member_offsets_;
400 return alignment_stack_vararg_;
405#if !defined(DART_PRECOMPILED_RUNTIME)
416 intptr_t member_index)
const;
422 intptr_t alignment_field,
423 intptr_t alignment_stack,
424 intptr_t alignment_stack_vararg)
426 alignment_stack_vararg_(alignment_stack_vararg),
429 const intptr_t alignment_stack_vararg_;
439#if !defined(DART_PRECOMPILED_RUNTIME)
453 intptr_t alignment_field,
454 intptr_t alignment_stack)
467#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(FFI_UNIT_TESTS)
477 return variadic_arguments_index_;
482#if !defined(FFI_UNIT_TESTS)
492 const intptr_t variadic_arguments_index_;
virtual void PrintTo(BaseTextBuffer *f, bool multi_line=false, bool verbose=true) const
virtual intptr_t SizeInBytes() const
virtual bool Equals(const NativeType &other) const
virtual intptr_t AlignmentInBytesStack(bool is_vararg=false) const
virtual bool ContainsOnlyFloats(Range range) const
virtual bool ContainsUnalignedMembers(intptr_t offset=0) const
virtual intptr_t PrimitivePairMembers(const NativePrimitiveType **first, const NativePrimitiveType **second, intptr_t offset_in_members=0) const
virtual const NativePrimitiveType & FirstPrimitiveMember() const
virtual intptr_t NumPrimitiveMembersRecursive() const
virtual intptr_t AlignmentInBytesField() const
virtual bool IsArray() const
NativeArrayType(const NativeType &element_type, intptr_t length)
const NativeType & element_type() const
const intptr_t alignment_stack_
virtual intptr_t NumPrimitiveMembersRecursive() const =0
const NativeTypes & members() const
virtual bool Equals(const NativeType &other) const
bool ContainsHomogeneousFloats() const
NativeCompoundType(const NativeTypes &members, intptr_t size, intptr_t alignment_field, intptr_t alignment_stack)
virtual bool ContainsUnalignedMembers(intptr_t offset=0) const =0
virtual intptr_t SizeInBytes() const
intptr_t NumberOfWordSizeChunksOnlyFloat() const
virtual intptr_t AlignmentInBytesStack(bool is_vararg=false) const
virtual intptr_t PrimitivePairMembers(const NativePrimitiveType **first, const NativePrimitiveType **second, intptr_t offset_in_members=0) const
const intptr_t alignment_field_
virtual bool IsCompound() const
virtual const NativePrimitiveType & FirstPrimitiveMember() const
const NativeTypes & members_
virtual bool ContainsOnlyFloats(Range range) const =0
intptr_t NumberOfWordSizeChunksNotOnlyFloat() const
virtual void PrintMemberOffset(BaseTextBuffer *f, intptr_t member_index) const
virtual intptr_t AlignmentInBytesField() const
virtual void PrintTo(BaseTextBuffer *f, bool multi_line=false, bool verbose=true) const
virtual void PrintCompoundType(BaseTextBuffer *f) const =0
static const NativeFunctionType * FromRepresentations(Zone *zone, Representation return_representation, const ZoneGrowableArray< Representation > &argument_representations)
const NativeTypes & argument_types() const
void PrintTo(BaseTextBuffer *f) const
const NativeType & return_type() const
const char * ToCString() const
static constexpr intptr_t kNoVariadicArguments
intptr_t variadic_arguments_index() const
NativeFunctionType(const NativeTypes &argument_types, const NativeType &return_type, intptr_t variadic_arguments_index=kNoVariadicArguments)
virtual bool IsFloat() const
virtual Representation AsRepresentation() const
virtual bool IsVoid() const
virtual const NativePrimitiveType & FirstPrimitiveMember() const
virtual NativePrimitiveType & Split(Zone *zone, intptr_t part) const
virtual bool IsPrimitive() const
virtual bool ContainsOnlyFloats(Range range) const
virtual ~NativePrimitiveType()
virtual bool Equals(const NativeType &other) const
virtual bool ContainsUnalignedMembers(intptr_t offset=0) const
virtual intptr_t PrimitivePairMembers(const NativePrimitiveType **first, const NativePrimitiveType **second, intptr_t offset_in_members=0) const
virtual bool IsExpressibleAsRepresentation() const
PrimitiveType representation() const
virtual bool IsSigned() const
virtual intptr_t NumPrimitiveMembersRecursive() const
virtual intptr_t AlignmentInBytesStack(bool is_vararg=false) const
virtual intptr_t AlignmentInBytesField() const
NativePrimitiveType(PrimitiveType rep)
virtual void PrintTo(BaseTextBuffer *f, bool multi_line=false, bool verbose=true) const
virtual bool IsInt() const
virtual intptr_t SizeInBytes() const
virtual bool IsStruct() const
virtual bool ContainsOnlyFloats(Range range) const
virtual intptr_t AlignmentInBytesStack(bool is_vararg=false) const
static NativeStructType & FromNativeTypes(Zone *zone, const NativeTypes &members, intptr_t member_packing=kMaxInt32)
virtual bool ContainsUnalignedMembers(intptr_t offset=0) const
virtual void PrintMemberOffset(BaseTextBuffer *f, intptr_t member_index) const
virtual intptr_t NumPrimitiveMembersRecursive() const
virtual void PrintCompoundType(BaseTextBuffer *f) const
const ZoneGrowableArray< intptr_t > & member_offsets() const
const NativeCompoundType & AsCompound() const
Representation AsRepresentationOverApprox(Zone *zone_) const
virtual bool IsInt() const
static const NativeType * FromAbstractType(Zone *zone, const AbstractType &type, const char **error)
virtual bool IsCompound() const
virtual void PrintTo(BaseTextBuffer *f, bool multi_line=false, bool verbose=true) const
virtual bool IsExpressibleAsRepresentation() const
virtual intptr_t PrimitivePairMembers(const NativePrimitiveType **first, const NativePrimitiveType **second, intptr_t offset_in_members=0) const =0
virtual bool IsSigned() const
const NativeArrayType & AsArray() const
const NativePrimitiveType & AsPrimitive() const
virtual bool IsVoid() const
virtual bool IsFloat() const
const char * ToCString() const
virtual intptr_t AlignmentInBytesStack(bool is_vararg=false) const =0
virtual intptr_t SizeInBytes() const =0
virtual const NativePrimitiveType & FirstPrimitiveMember() const =0
virtual Representation AsRepresentation() const
const NativeType & Extend(Zone *zone, ExtensionStrategy extension) const
virtual bool IsArray() const
const NativeType & WidenTo4Bytes(Zone *zone) const
virtual bool ContainsOnlyFloats(Range range) const =0
virtual bool IsPrimitive() const
const NativeType & WidenTo8Bytes(Zone *zone) const
static const NativeType & FromTypedDataClassId(Zone *zone, classid_t class_id)
static NativePrimitiveType & FromRepresentation(Zone *zone, Representation rep)
virtual NativeType & Split(Zone *zone, intptr_t index) const
virtual intptr_t AlignmentInBytesField() const =0
virtual bool IsStruct() const
virtual bool ContainsUnalignedMembers(intptr_t offset=0) const =0
virtual bool Equals(const NativeType &other) const
const NativeStructType & AsStruct() const
virtual intptr_t NumPrimitiveMembersRecursive() const =0
static NativeUnionType & FromNativeTypes(Zone *zone, const NativeTypes &members)
virtual bool ContainsUnalignedMembers(intptr_t offset=0) const
virtual intptr_t NumPrimitiveMembersRecursive() const
virtual void PrintCompoundType(BaseTextBuffer *f) const
virtual bool ContainsOnlyFloats(Range range) const
const uint8_t uint32_t uint32_t GError ** error
PrimitiveType PrimitiveTypeFromSizeInBytes(intptr_t size)
constexpr PrimitiveType kAddress
constexpr int32_t kMaxInt32
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
#define UNREACHABLE_THIS()