Progress on dotnet7 runtime hosting with mono

This commit is contained in:
Wojtek Figat
2023-03-22 17:59:46 +01:00
parent 4c4a559125
commit eed2cdfe04
44 changed files with 462 additions and 111 deletions

View File

@@ -17,9 +17,9 @@
#include "Engine/Profiler/ProfilerCPU.h"
#include "Engine/Threading/Threading.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/mono-debug.h>
#include <ThirdParty/mono-2.0/mono/metadata/assembly.h>
#include <ThirdParty/mono-2.0/mono/metadata/tokentype.h>
#include <mono/metadata/mono-debug.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/tokentype.h>
#endif
MAssembly::MAssembly(MDomain* domain, const StringAnsiView& name, const MAssemblyOptions& options)

View File

@@ -10,8 +10,8 @@
#include "Engine/Scripting/Scripting.h"
#include "Engine/Core/Log.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/mono-debug.h>
#include <ThirdParty/mono-2.0/mono/metadata/attrdefs.h>
#include <mono/metadata/mono-debug.h>
#include <mono/metadata/attrdefs.h>
#define GET_CUSTOM_ATTR() (MonoCustomAttrInfo*)(_attrInfo ? _attrInfo : _attrInfo = mono_custom_attrs_from_class(_monoClass))
#endif
#if USE_NETCORE

View File

@@ -20,19 +20,19 @@
#ifdef USE_MONO_AOT_MODULE
#include "Engine/Core/Types/TimeSpan.h"
#endif
#include <ThirdParty/mono-2.0/mono/jit/jit.h>
#include <ThirdParty/mono-2.0/mono/utils/mono-counters.h>
#include <ThirdParty/mono-2.0/mono/utils/mono-logger.h>
#include <ThirdParty/mono-2.0/mono/metadata/appdomain.h>
#include <ThirdParty/mono-2.0/mono/metadata/object.h>
#include <ThirdParty/mono-2.0/mono/metadata/assembly.h>
#include <ThirdParty/mono-2.0/mono/metadata/threads.h>
#include <ThirdParty/mono-2.0/mono/metadata/mono-debug.h>
#include <ThirdParty/mono-2.0/mono/metadata/mono-config.h>
#include <ThirdParty/mono-2.0/mono/metadata/mono-gc.h>
#include <ThirdParty/mono-2.0/mono/metadata/profiler.h>
#include <mono/jit/jit.h>
#include <mono/utils/mono-counters.h>
#include <mono/utils/mono-logger.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/object.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/threads.h>
#include <mono/metadata/mono-debug.h>
#include <mono/metadata/mono-config.h>
#include <mono/metadata/mono-gc.h>
#include <mono/metadata/profiler.h>
#if !USE_MONO_DYNAMIC_LIB
#include <ThirdParty/mono-2.0/mono/utils/mono-dl-fallback.h>
#include <mono/utils/mono-dl-fallback.h>
#endif
#endif
@@ -159,6 +159,7 @@ void MCore::UnloadEngine()
CoreCLR::CallStaticMethodByName<void>(TEXT("Exit"));
MDomains.ClearDelete();
MRootDomain = nullptr;
CoreCLR::ShutdownHostfxr();
}
#elif USE_MONO

View File

@@ -8,7 +8,7 @@
#include "Engine/Debug/Exceptions/ArgumentException.h"
#include "Engine/Debug/Exceptions/Exceptions.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/threads.h>
#include <mono/metadata/threads.h>
#endif
extern MDomain* MActiveDomain;

View File

@@ -4,7 +4,7 @@
#include "MType.h"
#include "MClass.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/mono-debug.h>
#include <mono/metadata/mono-debug.h>
MEvent::MEvent(MonoEvent* monoEvent, const char* name, MClass* parentClass)
: _monoEvent(monoEvent)
@@ -137,7 +137,7 @@ const Array<MObject*>& MEvent::GetAttributes()
const auto length = (uint32)mono_array_length(monoAttributesArray);
_attributes.Resize(length);
for (uint32 i = 0; i < length; i++)
_attributes[i] = mono_array_get(monoAttributesArray, MonoObject *, i);
_attributes[i] = mono_array_get(monoAttributesArray, MonoObject*, i);
mono_custom_attrs_free(attrInfo);
#endif
return _attributes;

View File

@@ -4,8 +4,8 @@
#include "MType.h"
#include "MClass.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/mono-debug.h>
#include <ThirdParty/mono-2.0/mono/metadata/attrdefs.h>
#include <mono/metadata/mono-debug.h>
#include <mono/metadata/attrdefs.h>
MField::MField(MonoClassField* monoField, const char* name, MClass* parentClass)
: _monoField(monoField)

View File

@@ -5,8 +5,8 @@
#include "MClass.h"
#include "Engine/Profiler/ProfilerCPU.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/mono-debug.h>
#include <ThirdParty/mono-2.0/mono/metadata/attrdefs.h>
#include <mono/metadata/mono-debug.h>
#include <mono/metadata/attrdefs.h>
MMethod::MMethod(MonoMethod* monoMethod, MClass* parentClass)
: MMethod(monoMethod, mono_method_get_name(monoMethod), parentClass)

View File

@@ -6,7 +6,7 @@
#include "MClass.h"
#include "MType.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/mono-debug.h>
#include <mono/metadata/mono-debug.h>
MProperty::MProperty(MonoProperty* monoProperty, const char* name, MClass* parentClass)
: _monoProperty(monoProperty)

View File

@@ -4,7 +4,7 @@
#include "Engine/Core/Types/String.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/mono-debug.h>
#include <mono/metadata/mono-debug.h>
#endif
/// <summary>

View File

@@ -3,7 +3,7 @@
#include "MType.h"
#include "MUtils.h"
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/mono-debug.h>
#include <mono/metadata/mono-debug.h>
String MType::ToString() const
{

View File

@@ -11,8 +11,8 @@
#if USE_MONO
#include <ThirdParty/mono-2.0/mono/metadata/object.h>
#include <ThirdParty/mono-2.0/mono/metadata/appdomain.h>
#include <mono/metadata/object.h>
#include <mono/metadata/appdomain.h>
#if USE_NETCORE
#include "Engine/Scripting/DotNet/CoreCLR.h"