Flutter Engine
The Flutter Engine
abi.h
Go to the documentation of this file.
1// Copyright (c) 2020, 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_COMPILER_FFI_ABI_H_
6#define RUNTIME_VM_COMPILER_FFI_ABI_H_
7
8#if defined(DART_PRECOMPILED_RUNTIME)
9#error "AOT runtime should not use compiler sources (including header files)"
10#endif // defined(DART_PRECOMPILED_RUNTIME)
11
12#include <platform/globals.h>
13
14namespace dart {
15
16namespace compiler {
17
18namespace ffi {
19
20// These ABIs should be kept in sync with
21// pkg/vm/lib/transformations/ffi/abi.dart.
22enum class Abi {
31 kIOSArm,
33 kIOSX64,
45};
46
47const int64_t num_abis = static_cast<int64_t>(Abi::kWindowsX64) + 1;
48
49// We use the integer values of this enum in
50// - runtime/vm/compiler/ffi/native_type.cc
51// - runtime/vm/compiler/frontend/kernel_to_il.cc
52static_assert(static_cast<int64_t>(Abi::kAndroidArm) == 0,
53 "Enum value unexpected.");
54static_assert(static_cast<int64_t>(Abi::kWindowsX64) == 21,
55 "Enum value unexpected.");
56static_assert(num_abis == 22, "Enum value unexpected.");
57
58// The target ABI. Defines sizes and alignment of native types.
60
61extern const char* target_abi_name;
62
63} // namespace ffi
64
65} // namespace compiler
66
67} // namespace dart
68
69#endif // RUNTIME_VM_COMPILER_FFI_ABI_H_
const int64_t num_abis
Definition: abi.h:47
const char * target_abi_name
Definition: abi.cc:92
Abi TargetAbi()
Definition: abi.cc:88
Definition: dart_vm.cc:33