Flutter Engine
The Flutter Engine
native_calling_convention.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_NATIVE_CALLING_CONVENTION_H_
6#define RUNTIME_VM_COMPILER_FFI_NATIVE_CALLING_CONVENTION_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"
15
16namespace dart {
17
18namespace compiler {
19
20namespace ffi {
21
23
24// Calculates native calling convention, is not aware of Dart calling
25// convention constraints.
26//
27// This class is meant to be embedded in a class that is aware of Dart calling
28// convention constraints.
30 public:
32 Zone* zone,
33 const NativeFunctionType& signature);
34
36 return argument_locations_;
37 }
38 const NativeLocation& return_location() const { return return_location_; }
39 bool contains_varargs() const { return contains_varargs_; }
40
41 intptr_t StackTopInBytes() const;
42
43 void PrintTo(BaseTextBuffer* f, bool multi_line = false) const;
45 const char* ToCString(Zone* zone, bool multi_line = false) const;
46#if !defined(FFI_UNIT_TESTS)
47 const char* ToCString(bool multi_line = false) const;
48#endif
49
50 private:
54 : argument_locations_(argument_locations),
55 return_location_(return_location),
56 contains_varargs_(contains_varargs) {}
57
58 const NativeLocations& argument_locations_;
59 const NativeLocation& return_location_;
60 const bool contains_varargs_;
61};
62
63} // namespace ffi
64
65} // namespace compiler
66
67} // namespace dart
68
69#endif // RUNTIME_VM_COMPILER_FFI_NATIVE_CALLING_CONVENTION_H_
void PrintToMultiLine(BaseTextBuffer *f) const
const char * ToCString(Zone *zone, bool multi_line=false) const
static const NativeCallingConvention & FromSignature(Zone *zone, const NativeFunctionType &signature)
void PrintTo(BaseTextBuffer *f, bool multi_line=false) const
Definition: dart_vm.cc:33