forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MonoAPI] Split type and function headers, add MONO_API_FUNCTION macro (
dotnet#65446) * [monoapi] Split type and function headers, add MONO_API_FUNCTION macro The idea is that the function header can be included multiple times with different definitions of MONO_API_FUNCTION in order to make it easier to re-used the definitions for embedding the runtime in late-binding scenarios * rename public mono/mini subdirectory to mono/jit To match how embedders see the tree. Update the runtime to include <mono/jit/jit.h> instead of <mono/mini/jit.h>. No change in public API * Add needed includes to mobile testing host templates * add unstable API comment to the details headers, too * use install(FILES) to copy the headers not other stray files to the include dir * update CODEOWNERS * Remove duplicate definitions of mono_event_get_remove_method This was already duplicated before the header reorganization, e.g. here https://github.com/dotnet/runtime/blob/b9a55b4f52243325359ced26e3d4b31ccacdc381/src/native/public/mono/metadata/class.h#L279-L282
- Loading branch information
1 parent
3f99a86
commit 858221c
Showing
103 changed files
with
3,402 additions
and
3,251 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
*/ | ||
|
||
#define _TESTCASE_ | ||
#include <mono/mini/jit.h> | ||
#include <mono/jit/jit.h> | ||
#include <embed/test-invoke.c> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
*/ | ||
|
||
#define _TESTCASE_ | ||
#include <mono/mini/jit.h> | ||
#include <mono/jit/jit.h> | ||
#include <embed/teste.c> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION | ||
#ifndef MONO_API_FUNCTION | ||
#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" | ||
#endif | ||
|
||
MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init, (const char *file)) | ||
|
||
MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init_version, (const char *root_domain_name, const char *runtime_version)) | ||
|
||
MONO_API_FUNCTION(MonoDomain *, mono_jit_init_version_for_test_only, (const char *root_domain_name, const char *runtime_version)) | ||
|
||
MONO_API_FUNCTION(int, mono_jit_exec, (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])) | ||
MONO_API_FUNCTION(void, mono_jit_cleanup, (MonoDomain *domain)) | ||
|
||
MONO_API_FUNCTION(mono_bool, mono_jit_set_trace_options, (const char* options)) | ||
|
||
MONO_API_FUNCTION(void, mono_set_signal_chaining, (mono_bool chain_signals)) | ||
|
||
MONO_API_FUNCTION(void, mono_set_crash_chaining, (mono_bool chain_signals)) | ||
|
||
/** | ||
* This function is deprecated, use mono_jit_set_aot_mode instead. | ||
*/ | ||
MONO_API_FUNCTION(void, mono_jit_set_aot_only, (mono_bool aot_only)) | ||
|
||
MONO_API_FUNCTION(void, mono_jit_set_aot_mode, (MonoAotMode mode)) | ||
|
||
/* | ||
* Returns whether the runtime was invoked for the purpose of AOT-compiling an | ||
* assembly, i.e. no managed code will run. | ||
*/ | ||
MONO_API_FUNCTION(mono_bool, mono_jit_aot_compiling, (void)) | ||
|
||
MONO_API_FUNCTION(void, mono_set_break_policy, (MonoBreakPolicyFunc policy_callback)) | ||
|
||
MONO_API_FUNCTION(void, mono_jit_parse_options, (int argc, char * argv[])) | ||
|
||
MONO_API_FUNCTION(char*, mono_get_runtime_build_info, (void)) | ||
|
||
MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_set_use_llvm, (mono_bool use_llvm)) | ||
|
||
MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_aot_register_module, (void **aot_info)) | ||
|
||
MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_jit_thread_attach, (MonoDomain *domain)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
#ifndef _MONO_JIT_TYPES_H | ||
#define _MONO_JIT_TYPES_H | ||
|
||
#include <mono/metadata/details/appdomain-types.h> | ||
|
||
MONO_BEGIN_DECLS | ||
|
||
/** | ||
* Allows control over our AOT (Ahead-of-time) compilation mode. | ||
*/ | ||
typedef enum { | ||
/* Disables AOT mode */ | ||
MONO_AOT_MODE_NONE, | ||
/* Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */ | ||
MONO_AOT_MODE_NORMAL, | ||
/* Enables hybrid AOT mode, JIT can still be used for wrappers */ | ||
MONO_AOT_MODE_HYBRID, | ||
/* Enables full AOT mode, JIT is disabled and not allowed, | ||
* equivalent to mono_jit_set_aot_only (true) */ | ||
MONO_AOT_MODE_FULL, | ||
/* Same as full, but use only llvm compiled code */ | ||
MONO_AOT_MODE_LLVMONLY, | ||
/* | ||
* Use interpreter only, no native code is generated | ||
* at runtime. Trampolines are loaded from corlib aot image. | ||
*/ | ||
MONO_AOT_MODE_INTERP, | ||
/* Same as INTERP, but use only llvm compiled code */ | ||
MONO_AOT_MODE_INTERP_LLVMONLY, | ||
/* Use only llvm compiled code, fall back to the interpeter */ | ||
MONO_AOT_MODE_LLVMONLY_INTERP, | ||
/* Same as --interp */ | ||
MONO_AOT_MODE_INTERP_ONLY, | ||
/* Sentinel value used internally by the runtime. We use a large number to avoid clashing with some internal values. */ | ||
MONO_AOT_MODE_LAST = 1000, | ||
} MonoAotMode; | ||
|
||
/* Allow embedders to decide wherther to actually obey breakpoint instructions | ||
* in specific methods (works for both break IL instructions and Debugger.Break () | ||
* method calls). | ||
*/ | ||
typedef enum { | ||
/* the default is to always obey the breakpoint */ | ||
MONO_BREAK_POLICY_ALWAYS, | ||
/* a nop is inserted instead of a breakpoint */ | ||
MONO_BREAK_POLICY_NEVER, | ||
/* the breakpoint is executed only if the program has ben started under | ||
* the debugger (that is if a debugger was attached at the time the method | ||
* was compiled). | ||
*/ | ||
MONO_BREAK_POLICY_ON_DBG | ||
} MonoBreakPolicy; | ||
|
||
typedef MonoBreakPolicy (*MonoBreakPolicyFunc) (MonoMethod *method); | ||
|
||
MONO_END_DECLS | ||
|
||
#endif /* _MONO_JIT_TYPES_H */ |
28 changes: 28 additions & 0 deletions
28
src/native/public/mono/jit/details/mono-private-unstable-functions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
/** | ||
* | ||
* Private unstable APIs. | ||
* | ||
* WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at | ||
* any time. | ||
* | ||
*/ | ||
// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION | ||
#ifndef MONO_API_FUNCTION | ||
#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header" | ||
#endif | ||
|
||
MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_load_aot_data_hook, (MonoLoadAotDataFunc load_func, MonoFreeAotDataFunc free_func, void* user_data)) | ||
|
||
MONO_API_FUNCTION(int, monovm_initialize, (int propertyCount, const char **propertyKeys, const char **propertyValues)) | ||
|
||
MONO_API_FUNCTION(int, monovm_runtimeconfig_initialize, (MonovmRuntimeConfigArguments *arg, MonovmRuntimeConfigArgumentsCleanup cleanup_fn, void *user_data)) | ||
|
||
// The wrapper MonoCoreRuntimeProperties struct can be stack-allocated or freed, but the structs inside it _must_ be heap-allocated and never freed, as they are not copied to avoid extra allocations | ||
MONO_API_FUNCTION(int, monovm_initialize_preparsed, (MonoCoreRuntimeProperties *parsed_properties, int propertyCount, const char **propertyKeys, const char **propertyValues)) | ||
|
||
//#ifdef HOST_WASM | ||
MONO_API_FUNCTION(void, mono_wasm_install_get_native_to_interp_tramp, (MonoWasmGetNativeToInterpTramp cb)) | ||
//#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.