Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
16namespace dart {
17namespace 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
24class 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.
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.
42
43 private:
44 // Native method support.
45 static Dart_NativeFunction NativeLookup(Dart_Handle name,
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();
61};
62
63} // namespace bin
64} // namespace dart
65
66#endif // RUNTIME_BIN_BUILTIN_H_
static Dart_Handle LoadAndCheckLibrary(BuiltinLibraryId id)
Definition builtin.cc:43
static void SetNativeResolver(BuiltinLibraryId id)
Definition builtin.cc:28
struct _Dart_Handle * Dart_Handle
Definition dart_api.h:258
void(* Dart_NativeFunction)(Dart_NativeArguments arguments)
Definition dart_api.h:3198
int argument_count
Definition fuchsia.cc:52
const char *const name
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
Definition globals.h:593