Flutter Engine
The Flutter Engine
third_party
dart-lang
sdk
runtime
bin
builtin.h
Go to the documentation of this file.
1
// Copyright (c) 2012, 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_BIN_BUILTIN_H_
6
#define RUNTIME_BIN_BUILTIN_H_
7
8
#include <
stdio.h
>
9
#include <stdlib.h>
10
11
#include "
include/dart_api.h
"
12
13
#include "
platform/assert.h
"
14
#include "
platform/globals.h
"
15
16
namespace
dart
{
17
namespace
bin {
18
19
#define FUNCTION_NAME(name) Builtin_##name
20
#define REGISTER_FUNCTION(name, count) {""
#name, FUNCTION_NAME(name), count},
21
#define DECLARE_FUNCTION(name, count) \
22
extern void FUNCTION_NAME(name)(Dart_NativeArguments args);
23
24
class
Builtin
{
25
public
:
26
// Note: Changes to this enum should be accompanied with changes to
27
// the builtin_libraries_ array in builtin.cc and builtin_nolib.cc.
28
enum
BuiltinLibraryId
{
29
kInvalidLibrary
= -1,
30
kBuiltinLibrary
= 0,
31
kIOLibrary
,
32
kHttpLibrary
,
33
kCLILibrary
,
34
};
35
36
// Setup native resolver method built in library specified in 'id'.
37
static
void
SetNativeResolver
(
BuiltinLibraryId
id
);
38
39
// Check if built in library specified in 'id' is already loaded, if not
40
// load it.
41
static
Dart_Handle
LoadAndCheckLibrary
(
BuiltinLibraryId
id
);
42
43
private
:
44
// Native method support.
45
static
Dart_NativeFunction
NativeLookup(
Dart_Handle
name
,
46
int
argument_count
,
47
bool
* auto_setup_scope);
48
49
static
const
uint8_t* NativeSymbol(
Dart_NativeFunction
nf);
50
51
static
const
int
num_libs_;
52
53
typedef
struct
{
54
const
char
* url_;
55
bool
has_natives_;
56
} builtin_lib_props;
57
static
builtin_lib_props builtin_libraries_[];
58
59
DISALLOW_ALLOCATION();
60
DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin);
61
};
62
63
}
// namespace bin
64
}
// namespace dart
65
66
#endif
// RUNTIME_BIN_BUILTIN_H_
assert.h
dart::bin::Builtin
Definition:
builtin.h:24
dart::bin::Builtin::LoadAndCheckLibrary
static Dart_Handle LoadAndCheckLibrary(BuiltinLibraryId id)
Definition:
builtin.cc:43
dart::bin::Builtin::SetNativeResolver
static void SetNativeResolver(BuiltinLibraryId id)
Definition:
builtin.cc:28
dart::bin::Builtin::BuiltinLibraryId
BuiltinLibraryId
Definition:
builtin.h:28
dart::bin::Builtin::kBuiltinLibrary
@ kBuiltinLibrary
Definition:
builtin.h:30
dart::bin::Builtin::kIOLibrary
@ kIOLibrary
Definition:
builtin.h:31
dart::bin::Builtin::kInvalidLibrary
@ kInvalidLibrary
Definition:
builtin.h:29
dart::bin::Builtin::kHttpLibrary
@ kHttpLibrary
Definition:
builtin.h:32
dart::bin::Builtin::kCLILibrary
@ kCLILibrary
Definition:
builtin.h:33
dart_api.h
Dart_Handle
struct _Dart_Handle * Dart_Handle
Definition:
dart_api.h:258
Dart_NativeFunction
void(* Dart_NativeFunction)(Dart_NativeArguments arguments)
Definition:
dart_api.h:3207
argument_count
int argument_count
Definition:
fuchsia.cc:52
dart
Definition:
dart_vm.cc:33
dart::name
const char *const name
Definition:
method_recognizer.cc:309
globals.h
stdio.h
Generated on Sun Jun 23 2024 21:55:22 for Flutter Engine by
1.9.4