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

#include <native_type.h>

Inheritance diagram for dart::compiler::ffi::NativeFunctionType:
dart::ZoneAllocated

Public Member Functions

 NativeFunctionType (const NativeTypes &argument_types, const NativeType &return_type, intptr_t variadic_arguments_index=kNoVariadicArguments)
 
const NativeTypesargument_types () const
 
const NativeTypereturn_type () const
 
intptr_t variadic_arguments_index () const
 
void PrintTo (BaseTextBuffer *f) const
 
const char * ToCString (Zone *zone) const
 
const char * ToCString () const
 
- 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 const NativeFunctionTypeFromRepresentations (Zone *zone, Representation return_representation, const ZoneGrowableArray< Representation > &argument_representations)
 

Static Public Attributes

static constexpr intptr_t kNoVariadicArguments = INTPTR_MAX
 

Detailed Description

Definition at line 458 of file native_type.h.

Constructor & Destructor Documentation

◆ NativeFunctionType()

dart::compiler::ffi::NativeFunctionType::NativeFunctionType ( const NativeTypes argument_types,
const NativeType return_type,
intptr_t  variadic_arguments_index = kNoVariadicArguments 
)
inline

Definition at line 460 of file native_type.h.

463 : argument_types_(argument_types),
464 return_type_(return_type),
465 variadic_arguments_index_(variadic_arguments_index) {}
const NativeTypes & argument_types() const
const NativeType & return_type() const

Member Function Documentation

◆ argument_types()

const NativeTypes & dart::compiler::ffi::NativeFunctionType::argument_types ( ) const
inline

Definition at line 474 of file native_type.h.

474{ return argument_types_; }

◆ FromRepresentations()

const NativeFunctionType * dart::compiler::ffi::NativeFunctionType::FromRepresentations ( Zone zone,
Representation  return_representation,
const ZoneGrowableArray< Representation > &  argument_representations 
)
static

Definition at line 637 of file native_type.cc.

640 {
641 const auto& return_type =
642 NativePrimitiveType::FromRepresentation(zone, return_representation);
643 auto& argument_types =
644 *new (zone) ZoneGrowableArray<const compiler::ffi::NativeType*>(
645 zone, argument_representations.length());
646 for (intptr_t i = 0; i < argument_representations.length(); i++) {
648 zone, argument_representations.At(i)));
649 }
651}
void Add(const T &value)
NativeFunctionType(const NativeTypes &argument_types, const NativeType &return_type, intptr_t variadic_arguments_index=kNoVariadicArguments)
static NativePrimitiveType & FromRepresentation(Zone *zone, Representation rep)

◆ PrintTo()

void dart::compiler::ffi::NativeFunctionType::PrintTo ( BaseTextBuffer f) const

Definition at line 797 of file native_type.cc.

797 {
798 f->AddString("(");
799 for (intptr_t i = 0; i < argument_types_.length(); i++) {
800 if (i > 0) {
801 f->AddString(", ");
802 }
803 if (i == variadic_arguments_index_) {
804 f->AddString("varargs: ");
805 }
806 argument_types_[i]->PrintTo(f);
807 }
808 f->AddString(") => ");
809 return_type_.PrintTo(f);
810}
intptr_t length() const
virtual void PrintTo(BaseTextBuffer *f, bool multi_line=false, bool verbose=true) const

◆ return_type()

const NativeType & dart::compiler::ffi::NativeFunctionType::return_type ( ) const
inline

Definition at line 475 of file native_type.h.

475{ return return_type_; }

◆ ToCString() [1/2]

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

Definition at line 792 of file native_type.cc.

792 {
793 return ToCString(Thread::Current()->zone());
794}
static Thread * Current()
Definition thread.h:361

◆ ToCString() [2/2]

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

Definition at line 727 of file native_type.cc.

727 {
728 ZoneTextBuffer textBuffer(zone);
729 PrintTo(&textBuffer);
730 return textBuffer.buffer();
731}
void PrintTo(BaseTextBuffer *f) const

◆ variadic_arguments_index()

intptr_t dart::compiler::ffi::NativeFunctionType::variadic_arguments_index ( ) const
inline

Definition at line 476 of file native_type.h.

476 {
477 return variadic_arguments_index_;
478 }

Member Data Documentation

◆ kNoVariadicArguments

constexpr intptr_t dart::compiler::ffi::NativeFunctionType::kNoVariadicArguments = INTPTR_MAX
staticconstexpr

Definition at line 486 of file native_type.h.


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