Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Typedefs | Functions
native_entry.h File Reference
#include "platform/memory_sanitizer.h"
#include "vm/allocation.h"
#include "vm/exceptions.h"
#include "vm/heap/verifier.h"
#include "vm/log.h"
#include "vm/native_arguments.h"
#include "vm/native_function.h"
#include "vm/runtime_entry.h"

Go to the source code of this file.

Classes

class  dart::NativeEntry
 
class  dart::NativeEntryData
 

Namespaces

namespace  dart
 

Macros

#define TRACE_NATIVE_CALL(format, name)
 
#define DEFINE_NATIVE_ENTRY(name, type_argument_count, argument_count)
 
#define DEFINE_FFI_NATIVE_ENTRY(name, return_type, argument_types)    return_type BootstrapNatives::FN_##name argument_types
 
#define NATIVE_TYPE_ARGUMENT_COUNT(expected)
 
#define GET_NATIVE_TYPE_ARGUMENT(name, value)    AbstractType& name = AbstractType::Handle(value);
 
#define GET_NON_NULL_NATIVE_ARGUMENT(type, name, value)
 
#define GET_NATIVE_ARGUMENT(type, name, value)
 

Typedefs

typedef ObjectPtr(* dart::BootstrapNativeFunction) (Thread *thread, Zone *zone, NativeArguments *arguments)
 

Functions

void dart::DartNativeThrowTypeArgumentCountException (int num_type_args, int num_type_args_expected)
 
void dart::DartNativeThrowArgumentException (const Instance &instance)
 

Macro Definition Documentation

◆ DEFINE_FFI_NATIVE_ENTRY

#define DEFINE_FFI_NATIVE_ENTRY (   name,
  return_type,
  argument_types 
)     return_type BootstrapNatives::FN_##name argument_types

Definition at line 53 of file native_entry.h.

◆ DEFINE_NATIVE_ENTRY

#define DEFINE_NATIVE_ENTRY (   name,
  type_argument_count,
  argument_count 
)
Value:
static ObjectPtr DN_Helper##name(Isolate* isolate, Thread* thread, \
Zone* zone, NativeArguments* arguments); \
ObjectPtr BootstrapNatives::DN_##name(Thread* thread, Zone* zone, \
NativeArguments* arguments) { \
TRACE_NATIVE_CALL("%s", "" #name); \
ASSERT(arguments->NativeArgCount() == argument_count); \
/* Note: a longer type arguments vector may be passed */ \
ASSERT(arguments->NativeTypeArgCount() >= type_argument_count); \
return DN_Helper##name(thread->isolate(), thread, zone, arguments); \
} \
static ObjectPtr DN_Helper##name(Isolate* isolate, Thread* thread, \
Zone* zone, NativeArguments* arguments)
int argument_count
Definition: fuchsia.cc:52
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

Definition at line 39 of file native_entry.h.

◆ GET_NATIVE_ARGUMENT

#define GET_NATIVE_ARGUMENT (   type,
  name,
  value 
)
Value:
const Instance& __##name##_instance__ = \
Instance::CheckedHandle(zone, value); \
type& name = type::Handle(zone); \
if (!__##name##_instance__.IsNull()) { \
if (!__##name##_instance__.Is##type()) { \
DartNativeThrowArgumentException(__##name##_instance__); \
} \
} \
name ^= value;
#define __
GLenum type
uint8_t value

Definition at line 84 of file native_entry.h.

◆ GET_NATIVE_TYPE_ARGUMENT

#define GET_NATIVE_TYPE_ARGUMENT (   name,
  value 
)     AbstractType& name = AbstractType::Handle(value);

Definition at line 69 of file native_entry.h.

◆ GET_NON_NULL_NATIVE_ARGUMENT

#define GET_NON_NULL_NATIVE_ARGUMENT (   type,
  name,
  value 
)
Value:
const Instance& __##name##_instance__ = \
Instance::CheckedHandle(zone, value); \
if (!__##name##_instance__.Is##type()) { \
DartNativeThrowArgumentException(__##name##_instance__); \
} \
const type& name = type::Cast(__##name##_instance__);

Definition at line 74 of file native_entry.h.

◆ NATIVE_TYPE_ARGUMENT_COUNT

#define NATIVE_TYPE_ARGUMENT_COUNT (   expected)
Value:
int __num_type_arguments = arguments->NativeTypeArgCount(); \
if (__num_type_arguments != expected) { \
DartNativeThrowTypeArgumentCountException(__num_type_arguments, expected); \
}

Definition at line 63 of file native_entry.h.

◆ TRACE_NATIVE_CALL

#define TRACE_NATIVE_CALL (   format,
  name 
)
Value:
do { \
} while (0)

Definition at line 30 of file native_entry.h.