Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
native_function.h
Go to the documentation of this file.
1// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_NATIVE_FUNCTION_H_
6#define RUNTIME_VM_NATIVE_FUNCTION_H_
7
8#include "vm/allocation.h"
9
10#include "include/dart_api.h"
11
12namespace dart {
13
14// Forward declarations.
15class NativeArguments;
16
17// We have three variants of native functions:
18// - bootstrap natives, which are called directly from stub code. The callee is
19// responsible for safepoint transitions and setting up handle scopes as
20// needed. Only VM-defined natives are bootstrap natives; they cannot be
21// defined by embedders.
22// - no scope natives, which are called through a wrapper function. The wrapper
23// function handles the safepoint transition. The callee is responsible for
24// setting up API scopes as needed.
25// - auto scope natives, which are called through a wrapper function. The
26// wrapper function handles the safepoint transition and sets up an API
27// scope.
28
29typedef void (*NativeFunction)(NativeArguments* arguments);
32
33} // namespace dart
34
35#endif // RUNTIME_VM_NATIVE_FUNCTION_H_
struct _Dart_NativeArguments * Dart_NativeArguments
Definition dart_api.h:3010
void(* Dart_NativeFunction)(Dart_NativeArguments arguments)
Definition dart_api.h:3198
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
void(* NativeFunctionWrapper)(Dart_NativeArguments args, Dart_NativeFunction func)
void(* NativeFunction)(NativeArguments *arguments)