Remove deprecated mono runtime backend

Old `mono` backend was not maintained for since 1.7 (July 2023)
`dotnet` backend still can run `mono` on AOT platforms but with the latest .NET features.
This commit is contained in:
2026-06-03 16:35:06 +02:00
parent a544cbcfde
commit e450658834
250 changed files with 193 additions and 44908 deletions
-17
View File
@@ -1,17 +0,0 @@
## Mono
Custom fork: [https://github.com/FlaxEngine/mono](https://github.com/FlaxEngine/mono) with custom features for C# assemblies hot-reloading at runtime without domain unload (more: [https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/](https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/)).
Startup docs about building mono: [https://www.mono-project.com/docs/compiling-mono/](https://www.mono-project.com/docs/compiling-mono/)
### Notes
Some useful notes and tips for devs:
* Use `-monolog` to print Mono logs to Flax logs
* When working with mono fork set `localRepoPath` to local repo location in `Source\Tools\Flax.Build\Deps\Dependencies\mono.cs`
* To update mono deps when developing/updating use `.\Development\Scripts\Windows\CallBuildTool.bat -log -ReBuildDeps -verbose -depsToBuild=mono -platform=Windows`, then build engine and run it
* `MONO_GC_DEBUG=check-remset-consistency` - it will do additional checks at each collection to see if there are any missing write barriers
* `MONO_GC_DEBUG=nursery-canaries` - it might catch some buffer overflows in case of problems in code.
* `MONO_GC_DEBUG=<log-level>:<log-file>` - will print GC debug to the log file (eg. `4:sgen-gc`).
* Methods `mono_custom_attrs_from_property` and `mono_custom_attrs_get_attr` are internally cached
* If C++ mono call a method in c# that will throw an error, error will be handled but, not completly. Calling relase domain will return random `Access memory violation`. First search for error in c# code. No workaround yet.
+1 -2
View File
@@ -4,7 +4,7 @@
"Major": 1,
"Minor": 13,
"Revision": 0,
"Build": 7003
"Build": 7004
},
"Company": "Flax",
"Copyright": "Copyright (c) 2012-2026 Wojciech Figat. All rights reserved.",
@@ -14,7 +14,6 @@
"UseCSharp": true,
"UseLargeWorlds": false,
"UseReverseZ": true,
"UseDotNet": true,
"Windows": {
"UseSDL": false,
},
@@ -160,7 +160,7 @@ namespace FlaxEditor.Content
}
else
{
_parameters = Utils.GetEmptyArray<ScriptMemberInfo.Parameter>();
_parameters = Array.Empty<ScriptMemberInfo.Parameter>();
}
}
@@ -283,9 +283,9 @@ namespace FlaxEditor.Content
{
if (!_asset)
{
_parameters = Utils.GetEmptyArray<ScriptMemberInfo>();
_methods = Utils.GetEmptyArray<ScriptMemberInfo>();
_attributes = Utils.GetEmptyArray<Attribute>();
_parameters = Array.Empty<ScriptMemberInfo>();
_methods = Array.Empty<ScriptMemberInfo>();
_attributes = Array.Empty<Attribute>();
return;
}
if (_parameters != null)
@@ -303,7 +303,7 @@ namespace FlaxEditor.Content
_parameters[i] = new ScriptMemberInfo(new VisualScriptParameterInfo(this, parameters[i]));
}
else
_parameters = Utils.GetEmptyArray<ScriptMemberInfo>();
_parameters = Array.Empty<ScriptMemberInfo>();
// Cache Visual Script methods info
var methodsCount = _asset.GetMethodsCount();
@@ -314,7 +314,7 @@ namespace FlaxEditor.Content
_methods[i] = new ScriptMemberInfo(new VisualScriptMethodInfo(this, i));
}
else
_methods = Utils.GetEmptyArray<ScriptMemberInfo>();
_methods = Array.Empty<ScriptMemberInfo>();
// Cache Visual Script attributes
{
@@ -525,7 +525,7 @@ namespace FlaxEditor.Content
var baseType = BaseType;
if (baseType)
return baseType.GetProperties(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
@@ -30,13 +30,6 @@ bool DeployDataStep::Perform(CookingData& data)
Platform::Sleep(10);
}
FileSystem::CreateDirectory(contentDir);
const String dstMono = data.DataOutputPath / TEXT("Mono");
#if USE_NETCORE
{
// Remove old Mono files
FileSystem::DeleteDirectory(dstMono);
FileSystem::DeleteFile(data.DataOutputPath / TEXT("MonoPosixHelper.dll"));
}
String dstDotnet = data.DataOutputPath / TEXT("Dotnet");
const DotNetAOTModes aotMode = data.Tools->UseAOT();
const bool usAOT = aotMode != DotNetAOTModes::None && aotMode != DotNetAOTModes::NoDotnet;
@@ -386,23 +379,6 @@ bool DeployDataStep::Perform(CookingData& data)
}
}
}
#else
if (!FileSystem::DirectoryExists(dstMono))
{
// Deploy Mono files (from platform data folder)
const String srcMono = depsRoot / TEXT("Mono");
if (!FileSystem::DirectoryExists(srcMono))
{
data.Error(TEXT("Missing Mono runtime data files."));
return true;
}
if (FileSystem::CopyDirectory(dstMono, srcMono))
{
data.Error(TEXT("Failed to copy Mono runtime data files."));
return true;
}
}
#endif
// Deploy engine data for the target platform
if (data.Tools->OnDeployBinaries(data))
@@ -52,16 +52,15 @@ void OnAssemblyLoaded(MAssembly* assembly);
void OnAssemblyUnloading(MAssembly* assembly);
void OnBinaryModuleLoaded(BinaryModule* module);
MTypeObject* CustomEditorsUtil::GetCustomEditor(MTypeObject* refType)
MType* CustomEditorsUtil::GetCustomEditor(MType* type)
{
if (!refType)
if (!type)
return nullptr;
MType* type = INTERNAL_TYPE_OBJECT_GET(refType);
Entry result;
if (Cache.TryGet(type, result))
{
if (result.CustomEditorType)
return INTERNAL_TYPE_GET_OBJECT(result.CustomEditorType);
return result.CustomEditorType;
MClass* editor = result.CustomEditor ? result.CustomEditor : result.DefaultEditor;
if (editor)
return MUtils::GetType(editor);
@@ -127,12 +126,8 @@ void OnAssemblyLoaded(MAssembly* assembly)
continue;
// Check if attribute references a valid class
MTypeObject* refType = nullptr;
customEditorTypeField->GetValue(attribute, &refType);
if (refType == nullptr)
continue;
MType* type = INTERNAL_TYPE_OBJECT_GET(refType);
MType* type = nullptr;
customEditorTypeField->GetValue(attribute, &type);
if (type == nullptr)
continue;
MClass* typeClass = MCore::Type::GetClass(type);
@@ -12,6 +12,6 @@ class CustomEditorsUtil
public:
#if USE_CSHARP
static MTypeObject* GetCustomEditor(MTypeObject* refType);
static MType* GetCustomEditor(MType* type);
#endif
};
@@ -679,7 +679,7 @@ namespace FlaxEditor.CustomEditors.Editors
return asArray;
if (Values[0] is List<Tag> asList)
return asList.ToArray();
return Utils.GetEmptyArray<Tag>();
return Array.Empty<Tag>();
}
set
{
+1 -1
View File
@@ -103,7 +103,7 @@ namespace FlaxEditor.GUI.Drag
return results;
}
}
return Utils.GetEmptyArray<ScriptType>();
return Array.Empty<ScriptType>();
}
}
}
+1 -1
View File
@@ -101,7 +101,7 @@ public class DragControlType<U> : DragHelper<ScriptType, U> where U : DragEventA
return results;
}
}
return Utils.GetEmptyArray<ScriptType>();
return Array.Empty<ScriptType>();
}
}
+1 -1
View File
@@ -103,7 +103,7 @@ namespace FlaxEditor.GUI.Drag
return results.ToArray();
}
}
return Utils.GetEmptyArray<Script>();
return Array.Empty<Script>();
}
/// <summary>
@@ -146,12 +146,12 @@ namespace FlaxEditor.GUI.Timeline.Tracks
/// <summary>
/// The event parameters data sizes collection.
/// </summary>
public int[] EventParamsSizes = Utils.GetEmptyArray<int>();
public int[] EventParamsSizes = Array.Empty<int>();
/// <summary>
/// The event parameters types collection.
/// </summary>
public Type[] EventParamsTypes = Utils.GetEmptyArray<Type>();
public Type[] EventParamsTypes = Array.Empty<Type>();
/// <summary>
/// The event key data.
@@ -380,7 +380,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
}
else
{
EventParamsTypes = Utils.GetEmptyArray<Type>();
EventParamsTypes = Array.Empty<Type>();
}
OnEventParamsChanged();
}
@@ -526,7 +526,7 @@ DEFINE_INTERNAL_CALL(void) EditorInternal_SetAnimationTime(AnimatedModel* animat
animatedModel->GraphInstance.State[0].Animation.TimePosition = time;
}
DEFINE_INTERNAL_CALL(MTypeObject*) CustomEditorsUtilInternal_GetCustomEditor(MTypeObject* targetType)
DEFINE_INTERNAL_CALL(MType*) CustomEditorsUtilInternal_GetCustomEditor(MType* targetType)
{
return CustomEditorsUtil::GetCustomEditor(targetType);
}
@@ -381,9 +381,6 @@ namespace FlaxEditor.Modules
Thread.Sleep(0);
_workerThread.Join(1000);
#if !USE_NETCORE
_workerThread.Abort(); // Deprecated in .NET 7
#endif
_workerThread = null;
}
@@ -584,7 +584,6 @@ namespace FlaxEditor.Modules.SourceCodeEditing
var codeBase = Utils.GetAssemblyLocation(assembly);
if (string.IsNullOrEmpty(codeBase))
return true;
#if USE_NETCORE
if (assembly.ManifestModule.FullyQualifiedName == "<In Memory Module>")
return false;
@@ -592,11 +591,6 @@ namespace FlaxEditor.Modules.SourceCodeEditing
string repositoryUrl = assembly.GetCustomAttributes<AssemblyMetadataAttribute>().FirstOrDefault(x => x.Key == "RepositoryUrl")?.Value ?? "";
if (repositoryUrl != "https://github.com/dotnet/runtime")
return true;
#else
// Skip assemblies from in-build Mono directory
if (!codeBase.Contains("/Mono/lib/mono/"))
return true;
#endif
return false;
}
+6 -6
View File
@@ -112,37 +112,37 @@ namespace FlaxEditor.Scripting
/// <inheritdoc />
public object[] GetAttributes(bool inherit)
{
return Utils.GetEmptyArray<object>();
return Array.Empty<object>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetMembers(string name, MemberTypes type, BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetMembers(BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetFields(BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetProperties(BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
public ScriptMemberInfo[] GetMethods(BindingFlags bindingAttr)
{
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <inheritdoc />
+12 -12
View File
@@ -447,7 +447,7 @@ namespace FlaxEditor.Scripting
{
var parameters = methodInfo.GetParameters();
if (parameters.Length == 0)
return Utils.GetEmptyArray<Parameter>();
return Array.Empty<Parameter>();
var result = new Parameter[parameters.Length];
for (int i = 0; i < result.Length; i++)
{
@@ -593,7 +593,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetAttributes(inherit);
return Utils.GetEmptyArray<object>();
return Array.Empty<object>();
}
/// <summary>
@@ -1116,7 +1116,7 @@ namespace FlaxEditor.Scripting
return _managed.GetCustomAttributes(inherit);
if (_custom != null)
return _custom.GetAttributes(inherit);
return Utils.GetEmptyArray<object>();
return Array.Empty<object>();
}
/// <summary>
@@ -1191,12 +1191,12 @@ namespace FlaxEditor.Scripting
if (_managed != null)
{
managedMembers = _managed.GetMember(name, type, bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
managedMembers = null;
if (_custom != null)
return _custom.GetMembers(name, type, bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1218,7 +1218,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetMembers(name, type, bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1282,12 +1282,12 @@ namespace FlaxEditor.Scripting
if (_managed != null)
{
managedMembers = _managed.GetMembers(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
managedMembers = null;
if (_custom != null)
return _custom.GetMembers(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1307,7 +1307,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetMembers(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1327,7 +1327,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetFields(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1365,7 +1365,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetProperties(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
@@ -1403,7 +1403,7 @@ namespace FlaxEditor.Scripting
}
if (_custom != null)
return _custom.GetMethods(bindingAttr);
return Utils.GetEmptyArray<ScriptMemberInfo>();
return Array.Empty<ScriptMemberInfo>();
}
/// <summary>
+3 -15
View File
@@ -141,10 +141,10 @@ int32 ScriptsBuilder::GetCompilationsCount()
String ScriptsBuilder::GetBuildToolPath()
{
#if USE_NETCORE && (PLATFORM_LINUX || PLATFORM_MAC)
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build");
#else
#if PLATFORM_WINDOWS_FAMILY
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build.exe");
#else
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build");
#endif
}
@@ -244,18 +244,6 @@ bool ScriptsBuilder::RunBuildTool(const StringView& args, const StringView& work
// Prepare build options
StringBuilder cmdLine(args.Length() + buildToolPath.Length() + 200);
#if !USE_NETCORE && (PLATFORM_LINUX || PLATFORM_MAC)
const String monoPath = Globals::MonoPath / TEXT("bin/mono");
if (!FileSystem::FileExists(monoPath))
{
Log::FileNotFoundException(monoPath).SetLevel(LogType::Fatal);
return true;
}
const String monoPath = TEXT("mono");
cmdLine.Append(monoPath);
cmdLine.Append(TEXT(" "));
// TODO: Set env var for the mono MONO_GC_PARAMS=nursery-size64m to boost build performance -> profile it
#endif
cmdLine.Append(buildToolPath);
// Call build tool
+3 -3
View File
@@ -39,8 +39,8 @@ namespace FlaxEditor.Surface
DefaultValues = new object[]
{
"State",
Utils.GetEmptyArray<byte>(),
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
Array.Empty<byte>(),
},
Size = new Float2(100, 0),
},
@@ -54,7 +54,7 @@ namespace FlaxEditor.Surface
Size = new Float2(100, 0),
DefaultValues = new object[]
{
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
},
},
}
@@ -875,7 +875,7 @@ namespace FlaxEditor.Surface.Archetypes
byte[] value;
if (Transitions.Count == 0)
{
value = Utils.GetEmptyArray<byte>();
value = Array.Empty<byte>();
}
else
{
@@ -1807,7 +1807,7 @@ namespace FlaxEditor.Surface.Archetypes
get => _ruleGraph;
set
{
_ruleGraph = value ?? Utils.GetEmptyArray<byte>();
_ruleGraph = value ?? Array.Empty<byte>();
SourceState.SaveTransitions();
}
}
@@ -1849,7 +1849,7 @@ namespace FlaxEditor.Surface.Archetypes
DestinationState = destination;
_data = data;
_data.Destination = destination.ID;
_ruleGraph = ruleGraph ?? Utils.GetEmptyArray<byte>();
_ruleGraph = ruleGraph ?? Array.Empty<byte>();
}
/// <summary>
@@ -784,7 +784,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
"Locomotion",
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
3,
true,
true,
@@ -818,8 +818,8 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
"State",
Utils.GetEmptyArray<byte>(),
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
Array.Empty<byte>(),
},
},
new NodeArchetype
@@ -1089,7 +1089,7 @@ namespace FlaxEditor.Surface.Archetypes
Size = new Float2(100, 0),
DefaultValues = new object[]
{
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
},
},
new NodeArchetype
@@ -445,7 +445,7 @@ namespace FlaxEditor.Surface.Archetypes
var decorator = Context.SpawnNode(19, 3, Location, new object[]
{
nodeType.TypeName,
Utils.GetEmptyArray<byte>(),
Array.Empty<byte>(),
});
// Add decorator to the node
@@ -646,7 +646,7 @@ namespace FlaxEditor.Surface.Archetypes
return new[] { uint.Parse(id[0]) };
}
}
return Utils.GetEmptyArray<uint>();
return Array.Empty<uint>();
}
}
@@ -949,7 +949,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
string.Empty, // Type Name
Utils.GetEmptyArray<byte>(), // Instance Data
Array.Empty<byte>(), // Instance Data
null, // List of Decorator Nodes IDs
},
Size = new Float2(100, 0),
@@ -967,7 +967,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
typeof(BehaviorTreeRootNode).FullName, // Root node
Utils.GetEmptyArray<byte>(), // Instance Data
Array.Empty<byte>(), // Instance Data
},
Size = new Float2(100, 0),
Elements = new[]
@@ -984,7 +984,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
string.Empty, // Type Name
Utils.GetEmptyArray<byte>(), // Instance Data
Array.Empty<byte>(), // Instance Data
},
Size = new Float2(100, 0),
},
@@ -1,5 +1,6 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using FlaxEditor.GUI;
using FlaxEditor.Scripting;
@@ -84,7 +85,7 @@ namespace FlaxEditor.Surface.Archetypes
const int firstBox = 2;
const int maxBoxes = 40;
bool isInvalid = false;
var data = Utils.GetEmptyArray<byte>();
var data = Array.Empty<byte>();
if (valueBox.HasAnyConnection)
{
@@ -216,7 +217,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Returns one of the input values based on the enum value",
Flags = NodeFlags.VisualScriptGraph | NodeFlags.AnimGraph,
Size = new Float2(160, 60),
DefaultValues = new object[] { Utils.GetEmptyArray<byte>() },
DefaultValues = new object[] { Array.Empty<byte>() },
ConnectionsHints = ConnectionsHint.Enum,
Elements = new[]
{
+3 -2
View File
@@ -1,5 +1,6 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using FlaxEditor.GUI;
using FlaxEditor.Scripting;
@@ -140,7 +141,7 @@ namespace FlaxEditor.Surface.Archetypes
const int firstBox = 2;
const int maxBoxes = 40;
bool isInvalid = false;
var data = Utils.GetEmptyArray<byte>();
var data = Array.Empty<byte>();
if (valueBox.HasAnyConnection)
{
@@ -285,7 +286,7 @@ namespace FlaxEditor.Surface.Archetypes
Description = "Performs the flow logic branch based on the enum value",
Flags = NodeFlags.VisualScriptGraph,
Size = new Float2(160, 60),
DefaultValues = new object[] { Utils.GetEmptyArray<byte>() },
DefaultValues = new object[] { Array.Empty<byte>() },
ConnectionsHints = ConnectionsHint.Enum,
Elements = new[]
{
+7 -7
View File
@@ -574,7 +574,7 @@ namespace FlaxEditor.Surface.Archetypes
if (_parameters.Length == 0 && methodInfo.ValueType.IsVoid)
{
// Skip allocations if method is void and parameter-less
Values[2] = Utils.GetEmptyArray<byte>();
Values[2] = Array.Empty<byte>();
}
else
{
@@ -714,7 +714,7 @@ namespace FlaxEditor.Surface.Archetypes
method.Name, // Method name
parametersCount, // Method parameters count
false, // Is Pure?
Utils.GetEmptyArray<byte>(), // Cached function signature data
Array.Empty<byte>(), // Cached function signature data
// Default value for parameters (27 entries)
// @formatter:off
null,null,null,null,null,null,null,null,null,null,
@@ -810,7 +810,7 @@ namespace FlaxEditor.Surface.Archetypes
signature.IsStatic = reader.ReadBoolean(); // Is Static
signature.ReturnType = VariantUtils.ReadVariantScriptType(reader); // Return type
var parametersCount = reader.ReadInt32(); // Parameters count
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Utils.GetEmptyArray<SignatureParamInfo>();
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Array.Empty<SignatureParamInfo>();
for (int i = 0; i < parametersCount; i++)
{
ref var param = ref signature.Params[i];
@@ -831,7 +831,7 @@ namespace FlaxEditor.Surface.Archetypes
signature.IsStatic = reader.ReadBoolean(); // Is Static
signature.ReturnType = VariantUtils.ReadVariantScriptType(reader); // Return type
var parametersCount = reader.ReadInt32(); // Parameters count
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Utils.GetEmptyArray<SignatureParamInfo>();
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Array.Empty<SignatureParamInfo>();
for (int i = 0; i < parametersCount; i++)
{
ref var param = ref signature.Params[i];
@@ -2489,7 +2489,7 @@ namespace FlaxEditor.Surface.Archetypes
{
string.Empty, // Overriden method name
0, // Overriden method parameters count
Utils.GetEmptyArray<byte>(), // Cached function signature data
Array.Empty<byte>(), // Cached function signature data
},
},
new NodeArchetype
@@ -2507,7 +2507,7 @@ namespace FlaxEditor.Surface.Archetypes
string.Empty, // Method name
0, // Method parameters count
false, // Is Pure?
Utils.GetEmptyArray<byte>(), // Cached function signature data
Array.Empty<byte>(), // Cached function signature data
// Default value for parameters (27 entries)
// @formatter:off
@@ -2546,7 +2546,7 @@ namespace FlaxEditor.Surface.Archetypes
Size = new Float2(240, 20),
DefaultValues = new object[]
{
Utils.GetEmptyArray<byte>(), // Function signature data
Array.Empty<byte>(), // Function signature data
},
},
new NodeArchetype
+3 -3
View File
@@ -156,7 +156,7 @@ namespace FlaxEditor.Surface.Archetypes
if (fieldsLength == 0)
{
// Skip allocations if structure is empty
Values[1] = Utils.GetEmptyArray<byte>();
Values[1] = Array.Empty<byte>();
}
else
{
@@ -471,7 +471,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
string.Empty, // Typename
Utils.GetEmptyArray<byte>(), // Cached structure layout data
Array.Empty<byte>(), // Cached structure layout data
},
Elements = new[]
{
@@ -591,7 +591,7 @@ namespace FlaxEditor.Surface.Archetypes
DefaultValues = new object[]
{
string.Empty, // Typename
Utils.GetEmptyArray<byte>(), // Cached structure layout data
Array.Empty<byte>(), // Cached structure layout data
},
Elements = new[]
{
+2 -2
View File
@@ -56,8 +56,8 @@ namespace FlaxEditor.Surface
private object Creator(Type type)
{
var ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, Utils.GetEmptyArray<Type>(), null);
return ctor.Invoke(Utils.GetEmptyArray<object>());
var ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, Array.Empty<Type>(), null);
return ctor.Invoke(Array.Empty<object>());
}
}
+1 -1
View File
@@ -1484,7 +1484,7 @@ namespace FlaxEditor.Surface.Elements
protected override void OnAttributesChanged()
{
OnCurrentTypeChanged();
_editor?.UpdateAttributes(this, _attributes ?? Utils.GetEmptyArray<object>(), _defaultValueEditor);
_editor?.UpdateAttributes(this, _attributes ?? Array.Empty<object>(), _defaultValueEditor);
}
/// <inheritdoc />
+2 -2
View File
@@ -91,7 +91,7 @@ namespace FlaxEditor.Surface
}
}
}
return Utils.GetEmptyArray<Attribute>();
return Array.Empty<Attribute>();
}
/// <summary>
@@ -106,7 +106,7 @@ namespace FlaxEditor.Surface
var json = FlaxEngine.Json.JsonSerializer.Serialize(attributes);
return Encoding.Unicode.GetBytes(json);
}
return Utils.GetEmptyArray<byte>();
return Array.Empty<byte>();
}
/// <summary>
+1 -1
View File
@@ -237,7 +237,7 @@ namespace FlaxEditor.Surface
surfaceParameters.Remove(surfaceParameter);
surfaceParameters.Add(surfaceParameter);
}
var attributes = surfaceParameter?.Meta.GetAttributes() ?? FlaxEngine.Utils.GetEmptyArray<Attribute>();
var attributes = surfaceParameter?.Meta.GetAttributes() ?? Array.Empty<Attribute>();
data[i] = new GraphParameterData(null, index++, parameter.Name, parameter.IsPublic, ToType(parameter.ParameterType), attributes, parameter);
i++;
}
+1 -1
View File
@@ -136,9 +136,9 @@ namespace FlaxEditor.Windows
{
"Used third party software:",
"",
"Mono Project - www.mono-project.com",
#if USE_NETCORE
".NET - www.dotnet.microsoft.com",
"Mono Project - www.mono-project.com",
#endif
#if PLATFORM_SDL
"Simple DirectMedia Layer - www.libsdl.org",
@@ -502,7 +502,7 @@ namespace FlaxEditor.Windows.Assets
{
Name = $"{name} (in {member.DeclaringType.Name})",
TooltipText = Editor.Instance.CodeDocs.GetTooltip(member),
Tag = new object[] { name, parameters.Length, Utils.GetEmptyArray<byte>() },
Tag = new object[] { name, parameters.Length, Array.Empty<byte>() },
// Do some basic sorting based on if the method is defined directly in the script base class
SortScore = member.DeclaringType == member.Type.ReflectedType ? 1 : 0,
};
+4 -4
View File
@@ -559,7 +559,7 @@ namespace FlaxEngine
/// </summary>
public LinearCurve()
{
Keyframes = Utils.GetEmptyArray<Keyframe>();
Keyframes = Array.Empty<Keyframe>();
}
/// <summary>
@@ -655,7 +655,7 @@ namespace FlaxEngine
if (end - start <= Mathf.Epsilon)
{
// Erase the curve
Keyframes = Utils.GetEmptyArray<Keyframe>();
Keyframes = Array.Empty<Keyframe>();
return;
}
@@ -866,7 +866,7 @@ namespace FlaxEngine
/// </summary>
public BezierCurve()
{
Keyframes = Utils.GetEmptyArray<Keyframe>();
Keyframes = Array.Empty<Keyframe>();
}
/// <summary>
@@ -970,7 +970,7 @@ namespace FlaxEngine
if (end - start <= Mathf.Epsilon)
{
// Erase the curve
Keyframes = Utils.GetEmptyArray<Keyframe>();
Keyframes = Array.Empty<Keyframe>();
return;
}
@@ -79,13 +79,6 @@ DEFINE_INTERNAL_CALL(AnimGraphImpulse*) AnimGraphInternal_GetOutputImpulseData(I
#endif
void AnimGraphExecutor::initRuntime()
{
ADD_INTERNAL_CALL("FlaxEngine.AnimationGraph::Internal_HasConnection", &AnimGraphInternal_HasConnection);
ADD_INTERNAL_CALL("FlaxEngine.AnimationGraph::Internal_GetInputValue", &AnimGraphInternal_GetInputValue);
ADD_INTERNAL_CALL("FlaxEngine.AnimationGraph::Internal_GetOutputImpulseData", &AnimGraphInternal_GetOutputImpulseData);
}
void AnimGraphExecutor::ProcessGroupCustom(Box* boxBase, Node* nodeBase, Value& value)
{
#if USE_CSHARP
@@ -813,11 +813,6 @@ private:
static ThreadLocal<AnimGraphContext*> Context;
public:
/// <summary>
/// Initializes the managed runtime calls.
/// </summary>
static void initRuntime();
/// <summary>
/// Initializes a new instance of the <see cref="AnimGraphExecutor"/> class.
/// </summary>
@@ -365,7 +365,7 @@ namespace FlaxEngine.Collections
public T[] ToArray()
{
if (Count == 0)
return Utils.GetEmptyArray<T>();
return Array.Empty<T>();
var result = new T[Count];
if (_backItem > _frontItem)
-4
View File
@@ -27,11 +27,7 @@
#include "Engine/Utilities/Crc.h"
#include "Engine/Utilities/StringConverter.h"
#if USE_NETCORE
#define MANAGED_GC_HANDLE AsUint64
#else
#define MANAGED_GC_HANDLE AsUint
#endif
#define AsEnum AsUint64
namespace
+1 -1
View File
@@ -54,7 +54,7 @@ struct CommandData
// Use Xml docs reader used by Editor to get tooltips
auto getXmlInternal = DebugCommands::TypeInitializer.GetClass()->GetMethod("GetXmlInternal", 2);
void* params[2] = { INTERNAL_TYPE_GET_OBJECT(mclass->GetType()), MUtils::ToString(name) };
void* params[2] = { mclass->GetType(), MUtils::ToString(name) };
Help = MUtils::ToString((MString*)getXmlInternal->Invoke(nullptr, params, nullptr));
}
}
@@ -27,15 +27,7 @@ namespace Log
/// </summary>
/// <param name="additionalInfo">Additional information that help describe error</param>
CLRInnerException(const String& additionalInfo)
: Exception(String::Format(TEXT("Current {0} CLR method has thrown an inner exception"),
#if USE_MONO
TEXT("Mono")
#elif USE_NETCORE
TEXT(".NET Core")
#else
TEXT("Unknown engine")
#endif
), additionalInfo)
: Exception(TEXT("Current .NET method has thrown an inner exception"), additionalInfo)
{
}
};
-5
View File
@@ -144,10 +144,6 @@ bool CommandLine::Parse(const Char* cmdLine)
PARSE_BOOL_SWITCH("-novsync ", NoVSync);
PARSE_BOOL_SWITCH("-nolog ", NoLog);
PARSE_BOOL_SWITCH("-std ", Std);
#if !BUILD_RELEASE
PARSE_ARG_SWITCH("-debug ", DebuggerAddress);
PARSE_BOOL_SWITCH("-debugwait ", WaitForDebugger);
#endif
#if PLATFORM_HAS_HEADLESS_MODE
PARSE_BOOL_SWITCH("-headless ", Headless);
#endif
@@ -159,7 +155,6 @@ bool CommandLine::Parse(const Char* cmdLine)
PARSE_BOOL_SWITCH("-nvidia ", NVIDIA);
PARSE_BOOL_SWITCH("-amd ", AMD);
PARSE_BOOL_SWITCH("-intel ", Intel);
PARSE_BOOL_SWITCH("-monolog ", MonoLog);
PARSE_BOOL_SWITCH("-mute ", Mute);
PARSE_BOOL_SWITCH("-lowdpi ", LowDPI);
-19
View File
@@ -50,20 +50,6 @@ public:
/// </summary>
Nullable<bool> Std;
#if !BUILD_RELEASE
/// <summary>
/// -debug !ip:port! (Mono debugger address)
/// </summary>
Nullable<String> DebuggerAddress;
/// <summary>
/// -debugwait (instructs Mono debugger to wait for client attach for 5 seconds)
/// </summary>
Nullable<bool> WaitForDebugger;
#endif
#if PLATFORM_HAS_HEADLESS_MODE
/// <summary>
@@ -113,11 +99,6 @@ public:
/// </summary>
Nullable<bool> Intel;
/// <summary>
/// -monolog (enables advanced debugging for Mono runtime)
/// </summary>
Nullable<bool> MonoLog;
/// <summary>
/// -mute (disables audio playback and uses Null Audio Backend)
/// </summary>
-23
View File
@@ -636,21 +636,6 @@ void EngineImpl::InitPaths()
#endif
#if USE_EDITOR
Globals::EngineContentFolder = Globals::StartupFolder / TEXT("Content");
#if USE_MONO
#if PLATFORM_WINDOWS
Globals::MonoPath = Globals::StartupFolder / TEXT("Source/Platforms/Editor/Windows/Mono");
#elif PLATFORM_LINUX
Globals::MonoPath = Globals::StartupFolder / TEXT("Source/Platforms/Editor/Linux/Mono");
#elif PLATFORM_MAC
Globals::MonoPath = Globals::StartupFolder / TEXT("Source/Platforms/Editor/Mac/Mono");
#else
#error "Please specify the Mono data location for Editor on this platform."
#endif
#endif
#else
#if USE_MONO
Globals::MonoPath = Globals::StartupFolder / TEXT("Mono");
#endif
#endif
Globals::ProjectContentFolder = Globals::ProjectFolder / TEXT("Content");
#if USE_EDITOR
@@ -658,14 +643,6 @@ void EngineImpl::InitPaths()
Globals::ProjectCacheFolder = Globals::ProjectFolder / TEXT("Cache");
#endif
#if USE_MONO
// We must ensure that engine is located in folder which path contains only ANSI characters
// Why? Mono lib must have etc and lib folders at ANSI path
// But project can be located on Unicode path
if (!Globals::StartupFolder.IsANSI())
Platform::Fatal(TEXT("Cannot start application in directory which name contains non-ANSI characters."));
#endif
#if !PLATFORM_SWITCH && !FLAX_TESTS
// Setup directories
if (FileSystem::DirectoryExists(Globals::TemporaryFolder))
-3
View File
@@ -15,9 +15,6 @@ String Globals::EngineContentFolder;
String Globals::ProjectSourceFolder;
#endif
String Globals::ProjectContentFolder;
#if USE_MONO
String Globals::MonoPath;
#endif
PRAGMA_DISABLE_DEPRECATION_WARNINGS;
bool Globals::FatalErrorOccurred;
bool Globals::IsRequestingExit;
-5
View File
@@ -46,11 +46,6 @@ public:
// Project content directory path.
API_FIELD(ReadOnly) static String ProjectContentFolder;
#if USE_MONO
// Mono library folder path.
API_FIELD(ReadOnly) static String MonoPath;
#endif
public:
// True if fatal error occurred (engine is exiting).
// [Deprecated in v1.10]
+2 -2
View File
@@ -452,7 +452,7 @@ enum class InternalBufferType
VB2 = 2,
};
MArray* Mesh::DownloadBuffer(bool forceGpu, MTypeObject* resultType, int32 typeI)
MArray* Mesh::DownloadBuffer(bool forceGpu, MType* resultType, int32 typeI)
{
// [Deprecated in v1.10]
ScopeLock lock(GetModelBase()->Locker);
@@ -480,7 +480,7 @@ MArray* Mesh::DownloadBuffer(bool forceGpu, MTypeObject* resultType, int32 typeI
auto count = GetVertexCount();
// Convert into managed array
MArray* result = MCore::Array::New(MCore::Type::GetClass(INTERNAL_TYPE_OBJECT_GET(resultType)), count);
MArray* result = MCore::Array::New(MCore::Type::GetClass(resultType), count);
void* managedArrayPtr = MCore::Array::GetAddress(result);
switch ((InternalBufferType)typeI)
{
+1 -1
View File
@@ -171,7 +171,7 @@ private:
#if !COMPILE_WITHOUT_CSHARP
API_FUNCTION(NoProxy) bool UpdateMeshUInt(int32 vertexCount, int32 triangleCount, const MArray* verticesObj, const MArray* trianglesObj, const MArray* normalsObj, const MArray* tangentsObj, const MArray* uvObj, const MArray* colorsObj);
API_FUNCTION(NoProxy) bool UpdateMeshUShort(int32 vertexCount, int32 triangleCount, const MArray* verticesObj, const MArray* trianglesObj, const MArray* normalsObj, const MArray* tangentsObj, const MArray* uvObj, const MArray* colorsObj);
API_FUNCTION(NoProxy) MArray* DownloadBuffer(bool forceGpu, MTypeObject* resultType, int32 typeI);
API_FUNCTION(NoProxy) MArray* DownloadBuffer(bool forceGpu, MType* resultType, int32 typeI);
#if USE_EDITOR
API_FUNCTION(NoProxy) Array<Vector3> GetCollisionProxyPoints() const;
#endif
+2 -2
View File
@@ -886,7 +886,7 @@ bool MeshBase::UpdateTrianglesUShort(int32 triangleCount, const MArray* triangle
return ::UpdateTriangles<uint16>(this, triangleCount, trianglesObj);
}
MArray* MeshBase::DownloadIndexBuffer(bool forceGpu, MTypeObject* resultType, bool use16Bit)
MArray* MeshBase::DownloadIndexBuffer(bool forceGpu, MType* resultType, bool use16Bit)
{
ScopeLock lock(GetModelBase()->Locker);
@@ -903,7 +903,7 @@ MArray* MeshBase::DownloadIndexBuffer(bool forceGpu, MTypeObject* resultType, bo
auto indexStride = indexStream.GetStride();
// Convert into managed array
MArray* result = MCore::Array::New(MCore::Type::GetClass(INTERNAL_TYPE_OBJECT_GET(resultType)), indexCount);
MArray* result = MCore::Array::New(MCore::Type::GetClass(resultType), indexCount);
void* managedArrayPtr = MCore::Array::GetAddress(result);
if (use16Bit)
{
+1 -1
View File
@@ -453,7 +453,7 @@ private:
#if !COMPILE_WITHOUT_CSHARP
API_FUNCTION(NoProxy) bool UpdateTrianglesUInt(int32 triangleCount, const MArray* trianglesObj);
API_FUNCTION(NoProxy) bool UpdateTrianglesUShort(int32 triangleCount, const MArray* trianglesObj);
API_FUNCTION(NoProxy) MArray* DownloadIndexBuffer(bool forceGpu, MTypeObject* resultType, bool use16Bit);
API_FUNCTION(NoProxy) MArray* DownloadIndexBuffer(bool forceGpu, MType* resultType, bool use16Bit);
API_FUNCTION(NoProxy) bool DownloadData(int32 count, MeshBufferType* types, API_PARAM(Out) BytesContainer& buffer0, API_PARAM(Out) BytesContainer& buffer1, API_PARAM(Out) BytesContainer& buffer2, API_PARAM(Out) BytesContainer& buffer3, API_PARAM(Out) GPUVertexLayout*& layout0, API_PARAM(Out) GPUVertexLayout*& layout1, API_PARAM(Out) GPUVertexLayout*& layout2, API_PARAM(Out) GPUVertexLayout*& layout3, bool forceGpu) const;
#endif
};
@@ -426,7 +426,7 @@ enum class InternalBufferType
VB0 = 0,
};
MArray* SkinnedMesh::DownloadBuffer(bool forceGpu, MTypeObject* resultType, int32 typeI)
MArray* SkinnedMesh::DownloadBuffer(bool forceGpu, MType* resultType, int32 typeI)
{
// [Deprecated in v1.10]
ScopeLock lock(GetModelBase()->Locker);
@@ -445,7 +445,7 @@ MArray* SkinnedMesh::DownloadBuffer(bool forceGpu, MTypeObject* resultType, int3
auto count = GetVertexCount();
// Convert into managed array
MArray* result = MCore::Array::New(MCore::Type::GetClass(INTERNAL_TYPE_OBJECT_GET(resultType)), count);
MArray* result = MCore::Array::New(MCore::Type::GetClass(resultType), count);
void* managedArrayPtr = MCore::Array::GetAddress(result);
switch ((InternalBufferType)typeI)
{
+1 -1
View File
@@ -149,6 +149,6 @@ private:
#if !COMPILE_WITHOUT_CSHARP
API_FUNCTION(NoProxy) bool UpdateMeshUInt(int32 vertexCount, int32 triangleCount, const MArray* verticesObj, const MArray* trianglesObj, const MArray* blendIndicesObj, const MArray* blendWeightsObj, const MArray* normalsObj, const MArray* tangentsObj, const MArray* uvObj, const MArray* colorsObj);
API_FUNCTION(NoProxy) bool UpdateMeshUShort(int32 vertexCount, int32 triangleCount, const MArray* verticesObj, const MArray* trianglesObj, const MArray* blendIndicesObj, const MArray* blendWeightsObj, const MArray* normalsObj, const MArray* tangentsObj, const MArray* uvObj, const MArray* colorsObj);
API_FUNCTION(NoProxy) MArray* DownloadBuffer(bool forceGpu, MTypeObject* resultType, int32 typeI);
API_FUNCTION(NoProxy) MArray* DownloadBuffer(bool forceGpu, MType* resultType, int32 typeI);
#endif
};
@@ -142,7 +142,7 @@ namespace FlaxEngine
if (initData.GenerateMipsLinear)
t.GenerateMips |= 2;
}
var emptyArray = Utils.GetEmptyArray<byte>();
var emptyArray = Array.Empty<byte>();
fixed (byte* data13 = (initData.Mips.Length > 13 ? initData.Mips[13].Data : emptyArray))
fixed (byte* data12 = (initData.Mips.Length > 12 ? initData.Mips[12].Data : emptyArray))
fixed (byte* data11 = (initData.Mips.Length > 11 ? initData.Mips[11].Data : emptyArray))
+2 -2
View File
@@ -298,7 +298,7 @@ namespace FlaxEngine
length++;
}
if (length == 0)
return Utils.GetEmptyArray<T>();
return Array.Empty<T>();
var output = new T[length];
length = 0;
for (int i = 0; i < count; i++)
@@ -324,7 +324,7 @@ namespace FlaxEngine
length++;
}
if (length == 0)
return Utils.GetEmptyArray<T>();
return Array.Empty<T>();
var output = new T[length];
length = 0;
for (int i = 0; i < count; i++)
+1 -1
View File
@@ -32,7 +32,7 @@ namespace FlaxEngine
set
{
if (value == null)
value = Utils.GetEmptyArray<BezierCurve<Transform>.Keyframe>();
value = Array.Empty<BezierCurve<Transform>.Keyframe>();
_keyframes = null;
Internal_SetKeyframes(__unmanagedPtr, value, System.Runtime.CompilerServices.Unsafe.SizeOf<BezierCurve<Transform>.Keyframe>());
}
+1 -14
View File
@@ -21,16 +21,6 @@
// Use in-built cultures info tables from mono
#include "CultureInfo.Tables.h"
#if USE_MONO
typedef struct
{
MonoObject obj;
MonoBoolean is_read_only;
gint32 lcid;
//...
} MonoCultureInfo;
#endif
namespace
{
const CultureInfoEntry* FindEntry(const StringAnsiView& name)
@@ -182,10 +172,7 @@ void* MUtils::ToManaged(const CultureInfo& value)
CultureInfo MUtils::ToNative(void* value)
{
int32 lcid = 127;
#if USE_MONO
if (value)
lcid = static_cast<MonoCultureInfo*>(value)->lcid;
#elif USE_CSHARP
#if USE_CSHARP
PROFILE_MEM(Localization);
const MClass* klass = GetBinaryModuleCorlib()->Assembly->GetClass("System.Globalization.CultureInfo");
if (value && klass)
@@ -54,7 +54,6 @@ namespace FlaxEngine
}
}
#if USE_NETCORE
/// <summary>
/// Specifies a options for an asset reference picker in the editor. Allows to customize view or provide custom value assign policy.
/// </summary>
@@ -71,5 +70,4 @@ namespace FlaxEngine
{
}
}
#endif
}
@@ -9,10 +9,6 @@
#include "Engine/Scripting/ManagedCLR/MException.h"
#include "Engine/Scripting/ManagedCLR/MUtils.h"
#include "Engine/Scripting/ManagedCLR/MCore.h"
#if USE_MONO
#include "Engine/Scripting/ManagedCLR/MClass.h"
#include "Engine/Scripting/ManagedCLR/MField.h"
#endif
#include "Engine/Scripting/Internal/InternalCalls.h"
#include "Engine/Core/ObjectsRemovalService.h"
#include "Engine/Profiler/Profiler.h"
@@ -24,17 +20,6 @@
#if !COMPILE_WITHOUT_CSHARP
#if USE_MONO
DEFINE_INTERNAL_CALL(MObject*) UtilsInternal_ExtractArrayFromList(MObject* obj)
{
MClass* klass = MCore::Object::GetClass(obj);
MField* field = klass->GetField("_items");
MObject* o;
field->GetValue(obj, &o);
return o;
}
#endif
DEFINE_INTERNAL_CALL(void) PlatformInternal_MemoryCopy(void* dst, const void* src, uint64 size)
{
Platform::MemoryCopy(dst, src, size);
@@ -195,9 +180,9 @@ DEFINE_INTERNAL_CALL(bool) ScriptingInternal_HasGameModulesLoaded()
return Scripting::HasGameModulesLoaded();
}
DEFINE_INTERNAL_CALL(bool) ScriptingInternal_IsTypeFromGameScripts(MTypeObject* type)
DEFINE_INTERNAL_CALL(bool) ScriptingInternal_IsTypeFromGameScripts(MType* type)
{
return Scripting::IsTypeFromGameScripts(MUtils::GetClass(INTERNAL_TYPE_OBJECT_GET(type)));
return Scripting::IsTypeFromGameScripts(MUtils::GetClass(type));
}
DEFINE_INTERNAL_CALL(void) ScriptingInternal_FlushRemovedObjects()
@@ -207,37 +192,11 @@ DEFINE_INTERNAL_CALL(void) ScriptingInternal_FlushRemovedObjects()
#endif
void registerFlaxEngineInternalCalls()
{
AnimGraphExecutor::initRuntime();
#if USE_CSHARP
ADD_INTERNAL_CALL("FlaxEngine.Utils::MemoryCopy", &PlatformInternal_MemoryCopy);
ADD_INTERNAL_CALL("FlaxEngine.Utils::MemoryClear", &PlatformInternal_MemoryClear);
ADD_INTERNAL_CALL("FlaxEngine.Utils::MemoryCompare", &PlatformInternal_MemoryCompare);
#if USE_MONO
ADD_INTERNAL_CALL("FlaxEngine.Utils::Internal_ExtractArrayFromList", &UtilsInternal_ExtractArrayFromList);
#endif
ADD_INTERNAL_CALL("FlaxEngine.DebugLogHandler::Internal_LogWrite", &DebugLogHandlerInternal_LogWrite);
ADD_INTERNAL_CALL("FlaxEngine.DebugLogHandler::Internal_Log", &DebugLogHandlerInternal_Log);
ADD_INTERNAL_CALL("FlaxEngine.DebugLogHandler::Internal_LogException", &DebugLogHandlerInternal_LogException);
#endif
}
class ScriptingInternal
{
public:
static void InitRuntime()
{
// Scripting API
ADD_INTERNAL_CALL("FlaxEngine.Scripting::HasGameModulesLoaded", &ScriptingInternal_HasGameModulesLoaded);
ADD_INTERNAL_CALL("FlaxEngine.Scripting::IsTypeFromGameScripts", &ScriptingInternal_IsTypeFromGameScripts);
ADD_INTERNAL_CALL("FlaxEngine.Scripting::FlushRemovedObjects", &ScriptingInternal_FlushRemovedObjects);
// Profiler API
ADD_INTERNAL_CALL("FlaxEngine.Profiler::BeginEvent", &ProfilerInternal_BeginEvent);
ADD_INTERNAL_CALL("FlaxEngine.Profiler::EndEvent", &ProfilerInternal_EndEvent);
ADD_INTERNAL_CALL("FlaxEngine.Profiler::BeginEventGPU", &ProfilerInternal_BeginEventGPU);
ADD_INTERNAL_CALL("FlaxEngine.Profiler::EndEventGPU", &ProfilerInternal_EndEventGPU);
}
};
@@ -36,11 +36,8 @@ struct FLAXENGINE_API VTableFunctionInjector
#if USE_CSHARP
#if USE_NETCORE
#define ADD_INTERNAL_CALL(fullName, method)
#define DEFINE_INTERNAL_CALL(returnType) extern "C" DLLEXPORT returnType
#else
extern "C" FLAXENGINE_API void mono_add_internal_call(const char* name, const void* method);
#define ADD_INTERNAL_CALL(fullName, method) mono_add_internal_call(fullName, (const void*)method)
#define DEFINE_INTERNAL_CALL(returnType) static returnType
#endif
@@ -84,7 +81,6 @@ extern "C" FLAXENGINE_API void mono_add_internal_call(const char* name, const vo
#else
#define ADD_INTERNAL_CALL(fullName, method)
#define DEFINE_INTERNAL_CALL(returnType) static returnType
#define INTERNAL_CALL_CHECK(obj)
#define INTERNAL_CALL_CHECK_EXP(expression)
@@ -1,50 +0,0 @@
// Copyright (c) Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Core/Collections/BitArray.h"
#include "Engine/Scripting/ManagedCLR/MCore.h"
#if USE_CSHARP
struct ManagedBitArray
{
template<typename AllocationType = HeapAllocation>
static MObject* ToManaged(const BitArray<AllocationType>& data)
{
#if 0
// TODO: use actual System.Collections.BitArray for BitArray interop
MClass* bitArrayClass = Assemblies::Corlib().Assembly->GetClass("System.Collections.BitArray");
CHECK_RETURN(bitArrayClass, nullptr);
MonoMethodDesc* desc = mono_method_desc_new(":.ctor(int)", 0);
MonoMethod* bitArrayCtor = mono_method_desc_search_in_class(desc, bitArrayClass->GetNative());
mono_method_desc_free(desc);
CHECK_RETURN(bitArrayCtor, nullptr);
MObject* instance = MCore::Object::New(bitArrayClass);
CHECK_RETURN(instance, nullptr);
int32 length = data.Count();
void* params[1];
params[0] = &length;
mono_runtime_invoke(bitArrayCtor, instance, params, nullptr);
const MField* arrayField = bitArrayClass->GetField("m_array");
CHECK_RETURN(arrayField, nullptr);
MArray* array = nullptr;
arrayField->GetValue(instance, &array);
CHECK_RETURN(array, nullptr);
const int32 arrayLength = MCore::Array::GetLength(array);
//mono_value_copy_array(array, 0, (void*)data.Get(), arrayLength);
int32* arrayPtr = mono_array_addr(array, int32, 0);
//Platform::MemoryCopy(mono_array_addr_with_size(array, sizeof(int32), 0), data.Get(), data.Count() / sizeof(byte));
Platform::MemoryCopy(arrayPtr, data.Get(), length / sizeof(BitArray<AllocationType>::ItemType));
return instance;
#else
// Convert into bool[]
MArray* array = MCore::Array::New(MCore::TypeCache::Boolean, data.Count());
bool* arrayPtr = MCore::Array::GetAddress<bool>(array);
for (int32 i = 0; i < data.Count(); i++)
arrayPtr[i] = data[i];
return (MObject*)array;
#endif
}
};
#endif
@@ -3,7 +3,7 @@
#include "ManagedDictionary.h"
#if USE_CSHARP
Dictionary<ManagedDictionary::KeyValueType, MTypeObject*> ManagedDictionary::CachedTypes;
Dictionary<ManagedDictionary::KeyValueType, MType*> ManagedDictionary::CachedTypes;
#if !USE_MONO_AOT
ManagedDictionary::MakeGenericTypeThunk ManagedDictionary::MakeGenericType;
ManagedDictionary::CreateInstanceThunk ManagedDictionary::CreateInstance;
@@ -33,13 +33,13 @@ public:
private:
friend class Scripting;
static Dictionary<KeyValueType, MTypeObject*> CachedTypes;
static Dictionary<KeyValueType, MType*> CachedTypes;
#if !USE_MONO_AOT
typedef MTypeObject* (*MakeGenericTypeThunk)(MObject* instance, MTypeObject* genericType, MArray* genericArgs, MObject** exception);
typedef MType* (*MakeGenericTypeThunk)(MObject* instance, MType* genericType, MArray* genericArgs, MObject** exception);
static MakeGenericTypeThunk MakeGenericType;
typedef MObject* (*CreateInstanceThunk)(MObject* instance, MTypeObject* type, void* arr, MObject** exception);
typedef MObject* (*CreateInstanceThunk)(MObject* instance, MType* type, void* arr, MObject** exception);
static CreateInstanceThunk CreateInstance;
typedef void (*AddDictionaryItemThunk)(MObject* instance, MObject* dictionary, MObject* key, MObject* value, MObject** exception);
@@ -154,23 +154,19 @@ public:
return result;
}
static MTypeObject* GetClass(MType* keyType, MType* valueType)
static MType* GetClass(MType* keyType, MType* valueType)
{
// Check if the generic type was generated earlier
KeyValueType cacheKey = { keyType, valueType };
MTypeObject* dictionaryType;
MType* dictionaryType;
if (CachedTypes.TryGet(cacheKey, dictionaryType))
return dictionaryType;
MTypeObject* genericType = MUtils::GetType(StdTypesContainer::Instance()->DictionaryClass);
#if USE_NETCORE
MType* genericType = MUtils::GetType(StdTypesContainer::Instance()->DictionaryClass);
MArray* genericArgs = MCore::Array::New(MCore::TypeCache::IntPtr, 2);
#else
MArray* genericArgs = MCore::Array::New(MCore::TypeCache::Object, 2);
#endif
MTypeObject** genericArgsPtr = MCore::Array::GetAddress<MTypeObject*>(genericArgs);
genericArgsPtr[0] = INTERNAL_TYPE_GET_OBJECT(keyType);
genericArgsPtr[1] = INTERNAL_TYPE_GET_OBJECT(valueType);
MType** genericArgsPtr = MCore::Array::GetAddress<MType*>(genericArgs);
genericArgsPtr[0] = keyType;
genericArgsPtr[1] = valueType;
MObject* exception = nullptr;
#if !USE_MONO_AOT
@@ -179,7 +175,7 @@ public:
void* params[2];
params[0] = genericType;
params[1] = genericArgs;
dictionaryType = (MTypeObject*)MakeGenericType->Invoke(nullptr, params, &exception);
dictionaryType = (MType*)MakeGenericType->Invoke(nullptr, params, &exception);
#endif
if (exception)
{
@@ -194,7 +190,7 @@ public:
static ManagedDictionary New(MType* keyType, MType* valueType)
{
ManagedDictionary result;
MTypeObject* dictionaryType = GetClass(keyType, valueType);
MType* dictionaryType = GetClass(keyType, valueType);
if (!dictionaryType)
return result;
+5 -38
View File
@@ -23,10 +23,7 @@ public:
typedef Dictionary<StringAnsiView, MClass*> ClassesDictionary;
private:
#if USE_MONO
MonoAssembly* _monoAssembly = nullptr;
MonoImage* _monoImage = nullptr;
#elif USE_NETCORE
#if USE_NETCORE
void* _handle = nullptr;
StringAnsi _fullname;
#endif
@@ -167,17 +164,10 @@ public:
return _domain;
}
#if USE_MONO
FORCE_INLINE MonoAssembly* GetMonoAssembly() const
{
return _monoAssembly;
}
FORCE_INLINE MonoImage* GetMonoImage() const
{
return _monoImage;
}
#elif USE_NETCORE
#if USE_NETCORE
/// <summary>
/// Gets the native handle.
/// </summary>
FORCE_INLINE void* GetHandle() const
{
return _handle;
@@ -193,15 +183,6 @@ public:
/// <returns>True if cannot load, otherwise false</returns>
bool Load(const String& assemblyPath, const StringView& nativePath = StringView::Empty);
#if USE_MONO
/// <summary>
/// Loads assembly for domain.
/// </summary>
/// <param name="monoImage">The assembly image.</param>
/// <returns>True if cannot load, otherwise false.</returns>
bool Load(MonoImage* monoImage);
#endif
/// <summary>
/// Cleanup data. Caller must ensure not to use any types from this assembly after it has been unloaded.
/// </summary>
@@ -216,20 +197,6 @@ public:
/// <returns>The class object or null if failed to find it.</returns>
MClass* GetClass(const StringAnsiView& typeName) const;
#if USE_MONO
/// <summary>
/// Converts an internal mono representation of a class into engine class.
/// </summary>
/// <param name="monoClass">The Mono class.</param>
/// <returns>The class object.</returns>
MClass* GetClass(MonoClass* monoClass) const;
/// <summary>
/// Gets the native of the assembly (for the current domain). Can be used to pass to the scripting backend as a parameter.
/// </summary>
MonoReflectionAssembly* GetNative() const;
#endif
/// <summary>
/// Gets the classes lookup cache. Performs full initialization if not cached. The result cache contains all classes from the assembly.
/// </summary>
+4 -14
View File
@@ -13,10 +13,7 @@ class FLAXENGINE_API MClass
{
friend MCore;
private:
#if USE_MONO
MonoClass* _monoClass;
mutable void* _attrInfo = nullptr;
#elif USE_NETCORE
#if USE_NETCORE
void* _handle;
StringAnsiView _name;
StringAnsiView _namespace;
@@ -54,9 +51,7 @@ private:
int32 _isGeneric : 1;
public:
#if USE_MONO
MClass(const MAssembly* parentAssembly, MonoClass* monoClass, const StringAnsi& fullname);
#elif USE_NETCORE
#if USE_NETCORE
MClass(MAssembly* parentAssembly, void* handle, const char* name, const char* fullname, const char* namespace_, MTypeAttributes typeAttributes);
#endif
@@ -98,15 +93,10 @@ public:
return _namespace;
}
#if USE_MONO
#if USE_NETCORE
/// <summary>
/// Gets the Mono class handle.
/// Gets the native class handle.
/// </summary>
FORCE_INLINE MonoClass* GetNative() const
{
return _monoClass;
}
#elif USE_NETCORE
FORCE_INLINE void* GetNative() const
{
return _handle;
@@ -174,10 +174,6 @@ public:
static MTypes GetType(MType* type);
static bool IsPointer(MType* type);
static bool IsReference(MType* type);
#if USE_MONO
static MTypeObject* GetObject(MType* type);
static MType* Get(MTypeObject* type);
#endif
};
/// <summary>
@@ -21,9 +21,6 @@ public:
typedef Dictionary<StringAnsi, MAssembly*> AssembliesDictionary;
private:
#if USE_MONO
MonoDomain* _monoDomain;
#endif
StringAnsi _domainName;
AssembliesDictionary _assemblies;
@@ -34,16 +31,6 @@ public:
}
public:
#if USE_MONO
/// <summary>
/// Gets native domain class.
/// </summary>
FORCE_INLINE MonoDomain* GetNative() const
{
return _monoDomain;
}
#endif
/// <summary>
/// Gets current domain name
/// </summary>
+2 -17
View File
@@ -13,10 +13,7 @@ class FLAXENGINE_API MEvent
friend MCore;
protected:
#if USE_MONO
MonoEvent* _monoEvent;
StringAnsi _name;
#elif USE_NETCORE
#if USE_NETCORE
void* _handle;
StringAnsiView _name;
#else
@@ -34,9 +31,7 @@ protected:
mutable Array<MObject*, ArenaAllocation> _attributes;
public:
#if USE_MONO
explicit MEvent(MonoEvent* monoEvent, const char* name, MClass* parentClass);
#elif USE_NETCORE
#if USE_NETCORE
MEvent(MClass* parentClass, void* handle, const char* name);
#endif
@@ -88,16 +83,6 @@ public:
return GetAddMethod()->IsStatic();
}
#if USE_MONO
/// <summary>
/// Gets the Mono event handle.
/// </summary>
FORCE_INLINE MonoEvent* GetNative() const
{
return _monoEvent;
}
#endif
public:
/// <summary>
/// Checks if event has an attribute of the specified type.
+2 -18
View File
@@ -15,11 +15,7 @@ class FLAXENGINE_API MField
friend MCore;
protected:
#if USE_MONO
MonoClassField* _monoField;
MonoType* _monoType;
StringAnsi _name;
#elif USE_NETCORE
#if USE_NETCORE
void* _handle;
void* _type;
int32 _fieldOffset;
@@ -38,9 +34,7 @@ protected:
mutable Array<MObject*, ArenaAllocation> _attributes;
public:
#if USE_MONO
explicit MField(MonoClassField* monoField, const char* name, MClass* parentClass);
#elif USE_NETCORE
#if USE_NETCORE
MField(MClass* parentClass, void* handle, const char* name, void* type, int fieldOffset, MFieldAttributes attributes);
#endif
@@ -87,16 +81,6 @@ public:
return _isStatic != 0;
}
#if USE_MONO
/// <summary>
/// Gets mono field handle.
/// </summary>
FORCE_INLINE MonoClassField* GetNative() const
{
return _monoField;
}
#endif
public:
/// <summary>
/// Retrieves value currently set in the field on the specified object instance. If field is static object instance can be null.
+2 -18
View File
@@ -20,10 +20,7 @@ class FLAXENGINE_API MMethod
friend MCore;
protected:
#if USE_MONO
MonoMethod* _monoMethod;
StringAnsi _name;
#elif USE_NETCORE
#if USE_NETCORE
void* _handle;
StringAnsiView _name;
int32 _paramsCount;
@@ -49,10 +46,7 @@ protected:
mutable Array<MObject*, ArenaAllocation> _attributes;
public:
#if USE_MONO
explicit MMethod(MonoMethod* monoMethod, MClass* parentClass);
explicit MMethod(MonoMethod* monoMethod, const char* name, MClass* parentClass);
#elif USE_NETCORE
#if USE_NETCORE
MMethod(MClass* parentClass, StringAnsiView name, void* handle, int32 paramsCount, MMethodAttributes attributes);
#endif
@@ -166,16 +160,6 @@ public:
return _isStatic != 0;
}
#if USE_MONO
/// <summary>
/// Gets the Mono method handle.
/// </summary>
FORCE_INLINE MonoMethod* GetNative() const
{
return _monoMethod;
}
#endif
public:
/// <summary>
/// Checks if method has an attribute of the specified type.
@@ -16,10 +16,7 @@ class FLAXENGINE_API MProperty
friend MCore;
protected:
#if USE_MONO
MonoProperty* _monoProperty;
StringAnsi _name;
#elif USE_NETCORE
#if USE_NETCORE
void* _handle;
StringAnsiView _name;
#else
@@ -37,9 +34,7 @@ protected:
mutable Array<MObject*, ArenaAllocation> _attributes;
public:
#if USE_MONO
explicit MProperty(MonoProperty* monoProperty, const char* name, MClass* parentClass);
#elif USE_NETCORE
#if USE_NETCORE
MProperty(MClass* parentClass, const char* name, void* handle, void* getterHandle, void* setterHandle, MMethodAttributes getterAttributes, MMethodAttributes setterAttributes);
#endif
+14 -24
View File
@@ -24,6 +24,8 @@
#include "Engine/Utilities/StringConverter.h"
#include "Engine/Content/Asset.h"
#define MANAGED_GC_HANDLE AsUint64
#if USE_CSHARP
namespace
@@ -145,7 +147,7 @@ MString* MUtils::ToString(const StringView& str, MDomain* domain)
return MCore::String::New(str.Get(), len, domain);
}
ScriptingTypeHandle MUtils::UnboxScriptingTypeHandle(MTypeObject* value)
ScriptingTypeHandle MUtils::UnboxScriptingTypeHandle(MType* value)
{
MClass* klass = GetClass(value);
if (!klass)
@@ -157,13 +159,12 @@ ScriptingTypeHandle MUtils::UnboxScriptingTypeHandle(MTypeObject* value)
return typeHandle;
}
MTypeObject* MUtils::BoxScriptingTypeHandle(const ScriptingTypeHandle& value)
MType* MUtils::BoxScriptingTypeHandle(const ScriptingTypeHandle& value)
{
MTypeObject* result = nullptr;
MType* result = nullptr;
if (value)
{
MType* mType = value.GetType().ManagedClass->GetType();
result = INTERNAL_TYPE_GET_OBJECT(mType);
result = value.GetType().ManagedClass->GetType();
}
return result;
}
@@ -290,7 +291,7 @@ VariantType MUtils::UnboxVariantType(MType* type)
return VariantType();
}
MTypeObject* MUtils::BoxVariantType(const VariantType& value)
MType* MUtils::BoxVariantType(const VariantType& value)
{
if (value.Type == VariantType::Null)
return nullptr;
@@ -300,8 +301,7 @@ MTypeObject* MUtils::BoxVariantType(const VariantType& value)
LOG(Error, "Invalid native type to box {0}", value);
return nullptr;
}
MType* mType = klass->GetType();
return INTERNAL_TYPE_GET_OBJECT(mType);
return klass->GetType();
}
Variant MUtils::UnboxVariant(MObject* value)
@@ -614,11 +614,7 @@ MObject* MUtils::BoxVariant(const Variant& value)
case VariantType::Guid:
return MCore::Object::Box((void*)&value.AsData, stdTypes.GuidClass);
case VariantType::String:
#if USE_NETCORE
return (MObject*)MUtils::ToString((StringView)value);
#else
return (MObject*)MUtils::ToString((StringView)value);
#endif
case VariantType::Quaternion:
return MCore::Object::Box((void*)&value.AsData, stdTypes.QuaternionClass);
case VariantType::BoundingSphere:
@@ -803,11 +799,7 @@ MObject* MUtils::BoxVariant(const Variant& value)
return nullptr;
}
case VariantType::ManagedObject:
#if USE_NETCORE
return value.AsUint64 ? MCore::GCHandle::GetTarget(value.AsUint64) : nullptr;
#else
return value.AsUint ? MCore::GCHandle::GetTarget(value.AsUint) : nullptr;
#endif
return value.MANAGED_GC_HANDLE ? MCore::GCHandle::GetTarget(value.MANAGED_GC_HANDLE) : nullptr;
case VariantType::Typename:
{
const auto klass = Scripting::FindClass((StringAnsiView)value);
@@ -832,12 +824,11 @@ StringAnsiView MUtils::GetClassFullname(MObject* obj)
return StringAnsiView::Empty;
}
MClass* MUtils::GetClass(MTypeObject* type)
MClass* MUtils::GetClass(MType* type)
{
if (type == nullptr)
return nullptr;
MType* mType = INTERNAL_TYPE_OBJECT_GET(type);
return MCore::Type::GetClass(mType);
return MCore::Type::GetClass(type);
}
MClass* MUtils::GetClass(const VariantType& value)
@@ -1020,7 +1011,7 @@ MClass* MUtils::GetClass(const Variant& value)
return GetClass(value.Type);
}
MTypeObject* MUtils::GetType(MObject* object)
MType* MUtils::GetType(MObject* object)
{
if (!object)
return nullptr;
@@ -1028,12 +1019,11 @@ MTypeObject* MUtils::GetType(MObject* object)
return GetType(klass);
}
MTypeObject* MUtils::GetType(MClass* klass)
MType* MUtils::GetType(MClass* klass)
{
if (!klass)
return nullptr;
MType* type = klass->GetType();
return INTERNAL_TYPE_GET_OBJECT(type);
return klass->GetType();
}
BytesContainer MUtils::LinkArray(MArray* arrayObj)
+6 -19
View File
@@ -35,10 +35,10 @@ namespace MUtils
extern FLAXENGINE_API MString* ToString(const StringView& str);
extern FLAXENGINE_API MString* ToString(const StringView& str, MDomain* domain);
extern FLAXENGINE_API ScriptingTypeHandle UnboxScriptingTypeHandle(MTypeObject* value);
extern FLAXENGINE_API MTypeObject* BoxScriptingTypeHandle(const ScriptingTypeHandle& value);
extern FLAXENGINE_API ScriptingTypeHandle UnboxScriptingTypeHandle(MType* value);
extern FLAXENGINE_API MType* BoxScriptingTypeHandle(const ScriptingTypeHandle& value);
extern FLAXENGINE_API VariantType UnboxVariantType(MType* type);
extern FLAXENGINE_API MTypeObject* BoxVariantType(const VariantType& value);
extern FLAXENGINE_API MType* BoxVariantType(const VariantType& value);
extern FLAXENGINE_API Variant UnboxVariant(MObject* value);
extern FLAXENGINE_API MObject* BoxVariant(const Variant& value);
}
@@ -406,7 +406,7 @@ namespace MUtils
extern FLAXENGINE_API MClass* GetClass(MObject* object);
// Returns the class of the provided type.
extern FLAXENGINE_API MClass* GetClass(MTypeObject* type);
extern FLAXENGINE_API MClass* GetClass(MType* type);
// Returns the class of the provided VariantType value.
extern FLAXENGINE_API MClass* GetClass(const VariantType& value);
@@ -415,10 +415,10 @@ namespace MUtils
extern FLAXENGINE_API MClass* GetClass(const Variant& value);
// Returns the type of the provided object.
extern FLAXENGINE_API MTypeObject* GetType(MObject* object);
extern FLAXENGINE_API MType* GetType(MObject* object);
// Returns the type of the provided class.
extern FLAXENGINE_API MTypeObject* GetType(MClass* klass);
extern FLAXENGINE_API MType* GetType(MClass* klass);
/// <summary>
/// Boxes the native value into the managed object.
@@ -579,7 +579,6 @@ namespace MUtils
return ToArray(Span<String>(data.Get(), data.Count()), MCore::TypeCache::String);
}
#if USE_NETCORE
/// <summary>
/// Allocates new boolean array and copies data from the given unmanaged data container. The managed runtime is responsible for releasing the returned array data.
/// </summary>
@@ -607,18 +606,6 @@ namespace MUtils
arr[i] = data[i];
return arr;
}
#else
FORCE_INLINE bool* ToBoolArray(const Array<bool>& data)
{
return nullptr;
}
template<typename AllocationType = HeapAllocation>
FORCE_INLINE bool* ToBoolArray(const BitArray<AllocationType>& data)
{
return nullptr;
}
#endif
extern void* VariantToManagedArgPtr(Variant& value, MType* type, bool& failed);
extern bool VariantTypeEquals(const VariantType& type, MType* mType, bool isOut = false);
@@ -104,12 +104,8 @@ namespace PluginManagerImpl
continue;
// Check if attribute references a valid class
MTypeObject* refType = nullptr;
typeField->GetValue(attribute, &refType);
if (refType == nullptr)
continue;
MType* type = INTERNAL_TYPE_OBJECT_GET(refType);
MType* type = nullptr;
typeField->GetValue(attribute, &type);
if (type == nullptr)
continue;
MClass* typeClass = MCore::Type::GetClass(type);
+5 -3
View File
@@ -2298,7 +2298,7 @@ bool InitHostfxr()
// Setup debugger
{
int32 debuggerLogLevel = 0;
if (CommandLine::Options.MonoLog.IsTrue() || DOTNET_HOST_MONO_DEBUG)
if (DOTNET_HOST_MONO_DEBUG)
{
LOG(Info, "Using detailed Mono logging");
mono_trace_set_level_string("debug");
@@ -2309,9 +2309,10 @@ bool InitHostfxr()
mono_trace_set_level_string("warning");
}
#if MONO_DEBUG_ENABLE && !PLATFORM_SWITCH
#if 0
StringAnsi debuggerIp = "127.0.0.1";
uint16 debuggerPort = 41000 + Platform::GetCurrentProcessId() % 1000;
// Old DebuggerAddress arg: '-debug !ip:port! (Mono debugger address)'
if (CommandLine::Options.DebuggerAddress.HasValue())
{
const auto& address = CommandLine::Options.DebuggerAddress.GetValue();
@@ -2327,8 +2328,9 @@ bool InitHostfxr()
}
}
bool waitForDebugger = true;
char buffer[150];
sprintf(buffer, "--debugger-agent=transport=dt_socket,address=%s:%d,embedding=1,server=y,suspend=%s,loglevel=%d", debuggerIp.Get(), debuggerPort, CommandLine::Options.WaitForDebugger ? "y,timeout=5000" : "n", debuggerLogLevel);
sprintf(buffer, "--debugger-agent=transport=dt_socket,address=%s:%d,embedding=1,server=y,suspend=%s,loglevel=%d", debuggerIp.Get(), debuggerPort, waitForDebugger ? "y,timeout=5000" : "n", debuggerLogLevel);
const char* options[] = {
"--soft-breakpoints",
File diff suppressed because it is too large Load Diff
@@ -15,7 +15,6 @@ public class Scripting : EngineModule
if (EngineConfiguration.WithCSharp(options))
{
if (EngineConfiguration.WithDotNet(options))
{
void AddFrameworkDefines(string template, int major, int latestMinor)
{
@@ -45,12 +44,6 @@ public class Scripting : EngineModule
options.CompileEnv.PreprocessorDefinitions.Add("MCORE_MAIN_MODULE_NAME=" + fileName);
}
}
else
{
// Mono
options.PrivateDependencies.Add("mono");
options.ScriptingAPI.Defines.Add("USE_MONO");
}
}
options.PrivateDependencies.Add("Utilities");
+1 -6
View File
@@ -36,8 +36,6 @@
#include "Engine/Profiler/ProfilerCPU.h"
#include "Engine/Profiler/ProfilerMemory.h"
extern void registerFlaxEngineInternalCalls();
class ScriptingService : public EngineService
{
public:
@@ -203,9 +201,6 @@ bool ScriptingService::Init()
domain->SetCurrentDomain(true);
_scriptsDomain = domain;
// Add internal calls
registerFlaxEngineInternalCalls();
// Load assemblies
if (Scripting::Load())
{
@@ -269,7 +264,7 @@ void ScriptingService::Update()
}
_objectsLocker.Unlock();
#if defined(USE_NETCORE) && !USE_EDITOR
#if USE_NETCORE && !USE_EDITOR
// Force GC to run in background periodically to avoid large blocking collections causing hitches
if (Time::Update.TicksCount % 60 == 0)
{
+7 -26
View File
@@ -135,12 +135,8 @@ ScriptingObject* ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandl
MObject* ScriptingObject::GetManagedInstance() const
{
#if USE_NETCORE
const MGCHandle handle = Platform::AtomicRead((int64*)&_gcHandle);
#elif USE_MONO
const MGCHandle handle = Platform::AtomicRead((int32*)&_gcHandle);
#endif
#if USE_CSHARP
const MGCHandle handle = Platform::AtomicRead((int64*)&_gcHandle);
return handle ? MCore::GCHandle::GetTarget(handle) : nullptr;
#else
return nullptr;
@@ -251,7 +247,7 @@ ScriptingObject* ScriptingObject::ToNative(MObject* obj)
#if USE_CSHARP
if (obj)
{
#if USE_MONO || USE_MONO_AOT || DOTNET_HOST_MONO
#if USE_MONO_AOT || DOTNET_HOST_MONO
const auto ptrField = MCore::Object::GetClass(obj)->GetField(ScriptingObject_unmanagedPtr);
CHECK_RETURN(ptrField, nullptr);
ptrField->GetValue(obj, &ptr);
@@ -549,12 +545,11 @@ PersistentScriptingObject::PersistentScriptingObject(const SpawnParams& params)
#if USE_CSHARP
DEFINE_INTERNAL_CALL(MObject*) ObjectInternal_Create1(MTypeObject* type)
DEFINE_INTERNAL_CALL(MObject*) ObjectInternal_Create1(MType* mType)
{
// Peek class for that type (handle generic class cases)
if (!type)
if (!mType)
DebugLog::ThrowArgumentNull("type");
MType* mType = INTERNAL_TYPE_OBJECT_GET(type);
const MTypes mTypeType = MCore::Type::GetType(mType);
if (mTypeType == MTypes::GenericInst)
{
@@ -717,7 +712,7 @@ DEFINE_INTERNAL_CALL(MString*) ObjectInternal_GetTypeName(ScriptingObject* obj)
return MUtils::ToString(obj->GetType().Fullname);
}
DEFINE_INTERNAL_CALL(MObject*) ObjectInternal_FindObject(Guid* id, MTypeObject* type, bool skipLog = false)
DEFINE_INTERNAL_CALL(MObject*) ObjectInternal_FindObject(Guid* id, MType* type, bool skipLog = false)
{
if (!id->IsValid())
return nullptr;
@@ -759,7 +754,7 @@ DEFINE_INTERNAL_CALL(MObject*) ObjectInternal_FindObject(Guid* id, MTypeObject*
return nullptr;
}
DEFINE_INTERNAL_CALL(MObject*) ObjectInternal_TryFindObject(Guid* id, MTypeObject* type)
DEFINE_INTERNAL_CALL(MObject*) ObjectInternal_TryFindObject(Guid* id, MType* type)
{
ScriptingObject* obj = Scripting::TryFindObject(*id);
if (obj && !obj->Is(MUtils::GetClass(type)))
@@ -773,7 +768,7 @@ DEFINE_INTERNAL_CALL(void) ObjectInternal_ChangeID(ScriptingObject* obj, Guid* i
obj->ChangeID(*id);
}
DEFINE_INTERNAL_CALL(void*) ObjectInternal_GetUnmanagedInterface(ScriptingObject* obj, MTypeObject* type)
DEFINE_INTERNAL_CALL(void*) ObjectInternal_GetUnmanagedInterface(ScriptingObject* obj, MType* type)
{
if (obj && type)
{
@@ -815,20 +810,6 @@ class ScriptingObjectInternal
public:
static void InitRuntime()
{
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_Create1", &ObjectInternal_Create1);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_Create2", &ObjectInternal_Create2);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_ManagedInstanceCreated", &ObjectInternal_ManagedInstanceCreated);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_ManagedInstanceDeleted", &ObjectInternal_ManagedInstanceDeleted);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_Destroy", &ObjectInternal_Destroy);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_DestroyNow", &ObjectInternal_DestroyNow);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_GetTypeName", &ObjectInternal_GetTypeName);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_FindObject", &ObjectInternal_FindObject);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_TryFindObject", &ObjectInternal_TryFindObject);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_ChangeID", &ObjectInternal_ChangeID);
ADD_INTERNAL_CALL("FlaxEngine.Object::Internal_GetUnmanagedInterface", &ObjectInternal_GetUnmanagedInterface);
ADD_INTERNAL_CALL("FlaxEngine.Object::FromUnmanagedPtr", &ObjectInternal_FromUnmanagedPtr);
ADD_INTERNAL_CALL("FlaxEngine.Object::MapObjectID", &ObjectInternal_MapObjectID);
ADD_INTERNAL_CALL("FlaxEngine.Object::RemapObjectID", &ObjectInternal_RemapObjectID);
}
static ScriptingObject* Spawn(const ScriptingObjectSpawnParams& params)
+1 -50
View File
@@ -24,7 +24,6 @@ class MDomain;
// No Scripting
#define USE_CSHARP 0
#define USE_MONO 0
#define USE_NETCORE 0
// Dummy types declarations
@@ -32,61 +31,18 @@ typedef struct CSharpObject MObject;
typedef struct CSharpArray MArray;
typedef struct CSharpString MString;
typedef struct CSharpType MType;
typedef MType MTypeObject;
typedef unsigned int MGCHandle;
#define INTERNAL_TYPE_GET_OBJECT(type) (type)
#define INTERNAL_TYPE_OBJECT_GET(type) (type)
#else
#ifndef USE_MONO_AOT
// No AOT by default
#define USE_MONO_AOT 0
#define USE_MONO_AOT_MODE MONO_AOT_MODE_NONE
#endif
#if COMPILE_WITH_MONO
// Mono scripting
#define USE_CSHARP 1
#define USE_MONO 1
#define USE_NETCORE 0
// Enables/disables profiling managed world via Mono
#define USE_MONO_PROFILER (COMPILE_WITH_PROFILER)
// Enable/disable mono debugging
#define MONO_DEBUG_ENABLE (!BUILD_RELEASE)
// Mono types declarations
typedef struct _MonoClass MonoClass;
typedef struct _MonoDomain MonoDomain;
typedef struct _MonoImage MonoImage;
typedef struct _MonoAssembly MonoAssembly;
typedef struct _MonoMethod MonoMethod;
typedef struct _MonoProperty MonoProperty;
typedef struct _MonoObject MonoObject;
typedef struct _MonoEvent MonoEvent;
typedef struct _MonoType MonoType;
typedef struct _MonoString MonoString;
typedef struct _MonoArray MonoArray;
typedef struct _MonoReflectionType MonoReflectionType;
typedef struct _MonoReflectionAssembly MonoReflectionAssembly;
typedef struct _MonoException MonoException;
typedef struct _MonoClassField MonoClassField;
typedef MonoObject MObject;
typedef MonoArray MArray;
typedef MonoString MString;
typedef MonoType MType;
typedef MonoReflectionType MTypeObject;
typedef unsigned int MGCHandle;
#define INTERNAL_TYPE_GET_OBJECT(type) MCore::Type::GetObject(type)
#define INTERNAL_TYPE_OBJECT_GET(type) MCore::Type::Get(type)
#else
// .NET scripting
#define USE_CSHARP 1
#define USE_MONO 0
#define USE_NETCORE 1
// Dotnet types declarations
@@ -94,12 +50,7 @@ typedef struct DotNetObject MObject;
typedef struct DotNetArray MArray;
typedef struct DotNetString MString;
typedef struct DotNetType MType;
typedef MType MTypeObject;
typedef unsigned long long MGCHandle;
#define INTERNAL_TYPE_GET_OBJECT(type) (type)
#define INTERNAL_TYPE_OBJECT_GET(type) (type)
#endif
// Enables using single (root) app domain for the user scripts
#define USE_SCRIPTING_SINGLE_DOMAIN 1
+2 -2
View File
@@ -133,7 +133,7 @@ void UIControl::Deserialize(DeserializeStream& stream, ISerializeModifier* modif
#if !COMPILE_WITHOUT_CSHARP
PROFILE_MEM(UI);
MTypeObject* typeObj = nullptr;
MType* typeObj = nullptr;
const auto controlMember = stream.FindMember("Control");
if (controlMember != stream.MemberEnd())
{
@@ -141,7 +141,7 @@ void UIControl::Deserialize(DeserializeStream& stream, ISerializeModifier* modif
const MClass* type = Scripting::FindClass(controlType);
if (type != nullptr)
{
typeObj = INTERNAL_TYPE_GET_OBJECT(type->GetType());
typeObj = type->GetType();
}
else
{
+2 -26
View File
@@ -91,16 +91,14 @@ namespace FlaxEngine
/// <summary>
/// Gets the empty array of the given type (shared one).
/// [Deprecated in v1.13]
/// </summary>
/// <typeparam name="T">The type.</typeparam>
/// <returns>The empty array object.</returns>
[Obsolete("Use Array.Empty instead.")]
public static T[] GetEmptyArray<T>()
{
#if USE_NETCORE
return Array.Empty<T>();
#else
return Enumerable.Empty<T>() as T[];
#endif
}
/// <summary>
@@ -190,11 +188,7 @@ namespace FlaxEngine
/// <returns>List of assemblies</returns>
public static Assembly[] GetAssemblies()
{
#if USE_NETCORE
return AssemblyLoadContext.Default.Assemblies.Concat(NativeInterop.scriptingAssemblyLoadContext.Assemblies).ToArray();
#else
return AppDomain.CurrentDomain.GetAssemblies();
#endif
}
/// <summary>
@@ -235,24 +229,14 @@ namespace FlaxEngine
/// <returns>Path in the filesystem</returns>
public static string GetAssemblyLocation(Assembly assembly)
{
#if USE_NETCORE
var location = assembly.Location;
if (!string.IsNullOrEmpty(location))
return location;
if (Interop.NativeInterop.AssemblyLocations.TryGetValue(assembly.FullName, out location))
return location;
return null;
#else
return assembly.Location;
#endif
}
#if USE_MONO
internal static T[] ExtractArrayFromList<T>(List<T> list)
{
return list != null ? (T[])Internal_ExtractArrayFromList(list) : null;
}
#else
private class ExtractArrayFromListContext<T>
{
public static FieldInfo itemsField;
@@ -271,7 +255,6 @@ namespace FlaxEngine
return (T[])ExtractArrayFromListContext<T>.itemsField.GetValue(list); // boxing is slower;
}
#endif
internal static Float2[] ConvertCollection(Vector2[] v)
{
@@ -354,13 +337,6 @@ namespace FlaxEngine
return result;
}
#if USE_NETCORE
#else
[LibraryImport("FlaxEngine", EntryPoint = "UtilsInternal_ExtractArrayFromList")]
[return: MarshalUsing(typeof(FlaxEngine.SystemArrayMarshaller))]
internal static partial Array Internal_ExtractArrayFromList([MarshalUsing(typeof(FlaxEngine.GCHandleMarshaller))] object list);
#endif
/// <summary>
/// Reads the color from the binary stream.
/// </summary>
-1440
View File
File diff suppressed because it is too large Load Diff
-36
View File
@@ -1,36 +0,0 @@
// Wrapper for mono/mono/eglib/glib.h to mock the types for embedding
#ifndef _GLIB_H_
#define _GLIB_H_
#include <stdint.h>
#include <limits.h>
/*
* Basic data types
*/
typedef int gint;
typedef unsigned int guint;
typedef short gshort;
typedef unsigned short gushort;
typedef long glong;
typedef unsigned long gulong;
typedef void * gpointer;
typedef const void * gconstpointer;
typedef char gchar;
typedef unsigned char guchar;
/* Types defined in terms of the stdint.h */
typedef int8_t gint8;
typedef uint8_t guint8;
typedef int16_t gint16;
typedef uint16_t guint16;
typedef int32_t gint32;
typedef uint32_t guint32;
typedef int64_t gint64;
typedef uint64_t guint64;
typedef float gfloat;
typedef double gdouble;
typedef int32_t gboolean;
#endif
-107
View File
@@ -1,107 +0,0 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
using Flax.Build;
using Flax.Build.NativeCpp;
/// <summary>
/// https://www.mono-project.com/
/// </summary>
public class mono : EngineDepsModule
{
/// <inheritdoc />
public override void Init()
{
base.Init();
LicenseType = LicenseTypes.Custom;
LicenseFilePath = "LICENSE";
}
/// <inheritdoc />
public override void Setup(BuildOptions options)
{
base.Setup(options);
var depsRoot = options.DepsFolder;
options.PublicIncludePaths.Add(Path.Combine(Globals.EngineRoot, @"Source\ThirdParty\mono-2.0"));
switch (options.Platform.Target)
{
case TargetPlatform.Windows:
case TargetPlatform.UWP:
case TargetPlatform.XboxOne:
case TargetPlatform.XboxScarlett:
{
bool useDynamicLinking = false;
if (useDynamicLinking)
{
// Dynamic linking (requires mono-2.0-sgen.dll to deploy side-by-side with the Flax)
options.PublicDefinitions.Add("USE_MONO_DYNAMIC_LIB");
options.OutputFiles.Add(Path.Combine(depsRoot, "mono-2.0-sgen.lib"));
options.DependencyFiles.Add(Path.Combine(depsRoot, "mono-2.0-sgen.dll"));
options.OptionalDependencyFiles.Add(Path.Combine(depsRoot, "mono-2.0-sgen.pdb"));
}
else
{
// Static linking
options.OutputFiles.Add(Path.Combine(depsRoot, "libmono-static.lib"));
var debugSymbolsLibs = new[]
{
"libmonoruntime",
"libmonoutils",
"libmini",
"eglib",
};
foreach (var debugSymbol in debugSymbolsLibs)
options.OptionalDependencyFiles.Add(Path.Combine(depsRoot, debugSymbol + ".pdb"));
// Additional dependencies required by Mono on Windows-based platforms
options.OutputFiles.Add("Mswsock.lib");
options.OutputFiles.Add("ws2_32.lib");
options.OutputFiles.Add("psapi.lib");
options.OutputFiles.Add("version.lib");
options.OutputFiles.Add("winmm.lib");
options.OutputFiles.Add("Bcrypt.lib");
}
options.DependencyFiles.Add(Path.Combine(depsRoot, "MonoPosixHelper.dll"));
break;
}
case TargetPlatform.Linux:
options.PublicDefinitions.Add("USE_MONO_DYNAMIC_LIB");
options.DependencyFiles.Add(Path.Combine(depsRoot, "libmonosgen-2.0.so"));
options.Libraries.Add(Path.Combine(depsRoot, "libmonosgen-2.0.so"));
break;
case TargetPlatform.PS4:
case TargetPlatform.PS5:
options.OutputFiles.Add(Path.Combine(depsRoot, "libmono.a"));
options.OutputFiles.Add(Path.Combine(depsRoot, "libmonoruntime.a"));
options.OutputFiles.Add(Path.Combine(depsRoot, "libmonoutils.a"));
options.OutputFiles.Add(Path.Combine(depsRoot, "mono.a"));
break;
case TargetPlatform.Android:
options.PublicDefinitions.Add("USE_MONO_DYNAMIC_LIB");
options.DependencyFiles.Add(Path.Combine(depsRoot, "libmonosgen-2.0.so"));
options.Libraries.Add(Path.Combine(depsRoot, "libmonosgen-2.0.so"));
break;
case TargetPlatform.Switch:
options.OutputFiles.Add(Path.Combine(depsRoot, "libmonosgen-2.0.a"));
break;
case TargetPlatform.Mac:
options.PublicDefinitions.Add("USE_MONO_DYNAMIC_LIB");
options.DependencyFiles.Add(Path.Combine(depsRoot, "libmonosgen-2.0.1.dylib"));
options.Libraries.Add(Path.Combine(depsRoot, "libmonosgen-2.0.1.dylib"));
break;
default: throw new InvalidPlatformException(options.Platform.Target);
}
}
/// <inheritdoc />
public override void GetFilesToDeploy(List<string> files)
{
base.GetFilesToDeploy(files);
files.AddRange(Directory.GetFiles(FolderPath, "*.h", SearchOption.AllDirectories));
}
}
-345
View File
@@ -1,345 +0,0 @@
/* GENERATED FILE, DO NOT EDIT. Edit cil-opcodes.xml instead and run "make opcode.def" to regenerate. */
OPDEF(CEE_NOP, "nop", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x00, NEXT)
OPDEF(CEE_BREAK, "break", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x01, ERROR)
OPDEF(CEE_LDARG_0, "ldarg.0", Pop0, Push1, InlineNone, 0, 1, 0xFF, 0x02, NEXT)
OPDEF(CEE_LDARG_1, "ldarg.1", Pop0, Push1, InlineNone, 1, 1, 0xFF, 0x03, NEXT)
OPDEF(CEE_LDARG_2, "ldarg.2", Pop0, Push1, InlineNone, 2, 1, 0xFF, 0x04, NEXT)
OPDEF(CEE_LDARG_3, "ldarg.3", Pop0, Push1, InlineNone, 3, 1, 0xFF, 0x05, NEXT)
OPDEF(CEE_LDLOC_0, "ldloc.0", Pop0, Push1, InlineNone, 0, 1, 0xFF, 0x06, NEXT)
OPDEF(CEE_LDLOC_1, "ldloc.1", Pop0, Push1, InlineNone, 1, 1, 0xFF, 0x07, NEXT)
OPDEF(CEE_LDLOC_2, "ldloc.2", Pop0, Push1, InlineNone, 2, 1, 0xFF, 0x08, NEXT)
OPDEF(CEE_LDLOC_3, "ldloc.3", Pop0, Push1, InlineNone, 3, 1, 0xFF, 0x09, NEXT)
OPDEF(CEE_STLOC_0, "stloc.0", Pop1, Push0, InlineNone, 0, 1, 0xFF, 0x0A, NEXT)
OPDEF(CEE_STLOC_1, "stloc.1", Pop1, Push0, InlineNone, 1, 1, 0xFF, 0x0B, NEXT)
OPDEF(CEE_STLOC_2, "stloc.2", Pop1, Push0, InlineNone, 2, 1, 0xFF, 0x0C, NEXT)
OPDEF(CEE_STLOC_3, "stloc.3", Pop1, Push0, InlineNone, 3, 1, 0xFF, 0x0D, NEXT)
OPDEF(CEE_LDARG_S, "ldarg.s", Pop0, Push1, ShortInlineVar, 0, 1, 0xFF, 0x0E, NEXT)
OPDEF(CEE_LDARGA_S, "ldarga.s", Pop0, PushI, ShortInlineVar, 0, 1, 0xFF, 0x0F, NEXT)
OPDEF(CEE_STARG_S, "starg.s", Pop1, Push0, ShortInlineVar, 0, 1, 0xFF, 0x10, NEXT)
OPDEF(CEE_LDLOC_S, "ldloc.s", Pop0, Push1, ShortInlineVar, 0, 1, 0xFF, 0x11, NEXT)
OPDEF(CEE_LDLOCA_S, "ldloca.s", Pop0, PushI, ShortInlineVar, 0, 1, 0xFF, 0x12, NEXT)
OPDEF(CEE_STLOC_S, "stloc.s", Pop1, Push0, ShortInlineVar, 0, 1, 0xFF, 0x13, NEXT)
OPDEF(CEE_LDNULL, "ldnull", Pop0, PushRef, InlineNone, 0, 1, 0xFF, 0x14, NEXT)
OPDEF(CEE_LDC_I4_M1, "ldc.i4.m1", Pop0, PushI, InlineNone, -1, 1, 0xFF, 0x15, NEXT)
OPDEF(CEE_LDC_I4_0, "ldc.i4.0", Pop0, PushI, InlineNone, 0, 1, 0xFF, 0x16, NEXT)
OPDEF(CEE_LDC_I4_1, "ldc.i4.1", Pop0, PushI, InlineNone, 1, 1, 0xFF, 0x17, NEXT)
OPDEF(CEE_LDC_I4_2, "ldc.i4.2", Pop0, PushI, InlineNone, 2, 1, 0xFF, 0x18, NEXT)
OPDEF(CEE_LDC_I4_3, "ldc.i4.3", Pop0, PushI, InlineNone, 3, 1, 0xFF, 0x19, NEXT)
OPDEF(CEE_LDC_I4_4, "ldc.i4.4", Pop0, PushI, InlineNone, 4, 1, 0xFF, 0x1A, NEXT)
OPDEF(CEE_LDC_I4_5, "ldc.i4.5", Pop0, PushI, InlineNone, 5, 1, 0xFF, 0x1B, NEXT)
OPDEF(CEE_LDC_I4_6, "ldc.i4.6", Pop0, PushI, InlineNone, 6, 1, 0xFF, 0x1C, NEXT)
OPDEF(CEE_LDC_I4_7, "ldc.i4.7", Pop0, PushI, InlineNone, 7, 1, 0xFF, 0x1D, NEXT)
OPDEF(CEE_LDC_I4_8, "ldc.i4.8", Pop0, PushI, InlineNone, 8, 1, 0xFF, 0x1E, NEXT)
OPDEF(CEE_LDC_I4_S, "ldc.i4.s", Pop0, PushI, ShortInlineI, 0, 1, 0xFF, 0x1F, NEXT)
OPDEF(CEE_LDC_I4, "ldc.i4", Pop0, PushI, InlineI, 0, 1, 0xFF, 0x20, NEXT)
OPDEF(CEE_LDC_I8, "ldc.i8", Pop0, PushI8, InlineI8, 0, 1, 0xFF, 0x21, NEXT)
OPDEF(CEE_LDC_R4, "ldc.r4", Pop0, PushR4, ShortInlineR, 0, 1, 0xFF, 0x22, NEXT)
OPDEF(CEE_LDC_R8, "ldc.r8", Pop0, PushR8, InlineR, 0, 1, 0xFF, 0x23, NEXT)
OPDEF(CEE_UNUSED99, "unused99", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x24, NEXT)
OPDEF(CEE_DUP, "dup", Pop1, Push1+Push1, InlineNone, 0, 1, 0xFF, 0x25, NEXT)
OPDEF(CEE_POP, "pop", Pop1, Push0, InlineNone, 0, 1, 0xFF, 0x26, NEXT)
OPDEF(CEE_JMP, "jmp", Pop0, Push0, InlineMethod, 0, 1, 0xFF, 0x27, CALL)
OPDEF(CEE_CALL, "call", VarPop, VarPush, InlineMethod, 0, 1, 0xFF, 0x28, CALL)
OPDEF(CEE_CALLI, "calli", VarPop, VarPush, InlineSig, 0, 1, 0xFF, 0x29, CALL)
OPDEF(CEE_RET, "ret", VarPop, Push0, InlineNone, 0, 1, 0xFF, 0x2A, RETURN)
OPDEF(CEE_BR_S, "br.s", Pop0, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2B, BRANCH)
OPDEF(CEE_BRFALSE_S, "brfalse.s", PopI, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2C, COND_BRANCH)
OPDEF(CEE_BRTRUE_S, "brtrue.s", PopI, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2D, COND_BRANCH)
OPDEF(CEE_BEQ_S, "beq.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2E, COND_BRANCH)
OPDEF(CEE_BGE_S, "bge.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2F, COND_BRANCH)
OPDEF(CEE_BGT_S, "bgt.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x30, COND_BRANCH)
OPDEF(CEE_BLE_S, "ble.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x31, COND_BRANCH)
OPDEF(CEE_BLT_S, "blt.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x32, COND_BRANCH)
OPDEF(CEE_BNE_UN_S, "bne.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x33, COND_BRANCH)
OPDEF(CEE_BGE_UN_S, "bge.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x34, COND_BRANCH)
OPDEF(CEE_BGT_UN_S, "bgt.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x35, COND_BRANCH)
OPDEF(CEE_BLE_UN_S, "ble.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x36, COND_BRANCH)
OPDEF(CEE_BLT_UN_S, "blt.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x37, COND_BRANCH)
OPDEF(CEE_BR, "br", Pop0, Push0, InlineBrTarget, 0, 1, 0xFF, 0x38, BRANCH)
OPDEF(CEE_BRFALSE, "brfalse", PopI, Push0, InlineBrTarget, 0, 1, 0xFF, 0x39, COND_BRANCH)
OPDEF(CEE_BRTRUE, "brtrue", PopI, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3A, COND_BRANCH)
OPDEF(CEE_BEQ, "beq", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3B, COND_BRANCH)
OPDEF(CEE_BGE, "bge", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3C, COND_BRANCH)
OPDEF(CEE_BGT, "bgt", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3D, COND_BRANCH)
OPDEF(CEE_BLE, "ble", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3E, COND_BRANCH)
OPDEF(CEE_BLT, "blt", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3F, COND_BRANCH)
OPDEF(CEE_BNE_UN, "bne.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x40, COND_BRANCH)
OPDEF(CEE_BGE_UN, "bge.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x41, COND_BRANCH)
OPDEF(CEE_BGT_UN, "bgt.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x42, COND_BRANCH)
OPDEF(CEE_BLE_UN, "ble.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x43, COND_BRANCH)
OPDEF(CEE_BLT_UN, "blt.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x44, COND_BRANCH)
OPDEF(CEE_SWITCH, "switch", PopI, Push0, InlineSwitch, 0, 1, 0xFF, 0x45, COND_BRANCH)
OPDEF(CEE_LDIND_I1, "ldind.i1", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x46, NEXT)
OPDEF(CEE_LDIND_U1, "ldind.u1", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x47, NEXT)
OPDEF(CEE_LDIND_I2, "ldind.i2", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x48, NEXT)
OPDEF(CEE_LDIND_U2, "ldind.u2", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x49, NEXT)
OPDEF(CEE_LDIND_I4, "ldind.i4", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x4A, NEXT)
OPDEF(CEE_LDIND_U4, "ldind.u4", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x4B, NEXT)
OPDEF(CEE_LDIND_I8, "ldind.i8", PopI, PushI8, InlineNone, 0, 1, 0xFF, 0x4C, NEXT)
OPDEF(CEE_LDIND_I, "ldind.i", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x4D, NEXT)
OPDEF(CEE_LDIND_R4, "ldind.r4", PopI, PushR4, InlineNone, 0, 1, 0xFF, 0x4E, NEXT)
OPDEF(CEE_LDIND_R8, "ldind.r8", PopI, PushR8, InlineNone, 0, 1, 0xFF, 0x4F, NEXT)
OPDEF(CEE_LDIND_REF, "ldind.ref", PopI, PushRef, InlineNone, 0, 1, 0xFF, 0x50, NEXT)
OPDEF(CEE_STIND_REF, "stind.ref", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x51, NEXT)
OPDEF(CEE_STIND_I1, "stind.i1", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x52, NEXT)
OPDEF(CEE_STIND_I2, "stind.i2", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x53, NEXT)
OPDEF(CEE_STIND_I4, "stind.i4", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x54, NEXT)
OPDEF(CEE_STIND_I8, "stind.i8", PopI+PopI8, Push0, InlineNone, 0, 1, 0xFF, 0x55, NEXT)
OPDEF(CEE_STIND_R4, "stind.r4", PopI+PopR4, Push0, InlineNone, 0, 1, 0xFF, 0x56, NEXT)
OPDEF(CEE_STIND_R8, "stind.r8", PopI+PopR8, Push0, InlineNone, 0, 1, 0xFF, 0x57, NEXT)
OPDEF(CEE_ADD, "add", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x58, NEXT)
OPDEF(CEE_SUB, "sub", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x59, NEXT)
OPDEF(CEE_MUL, "mul", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5A, NEXT)
OPDEF(CEE_DIV, "div", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5B, NEXT)
OPDEF(CEE_DIV_UN, "div.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5C, NEXT)
OPDEF(CEE_REM, "rem", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5D, NEXT)
OPDEF(CEE_REM_UN, "rem.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5E, NEXT)
OPDEF(CEE_AND, "and", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5F, NEXT)
OPDEF(CEE_OR, "or", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x60, NEXT)
OPDEF(CEE_XOR, "xor", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x61, NEXT)
OPDEF(CEE_SHL, "shl", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x62, NEXT)
OPDEF(CEE_SHR, "shr", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x63, NEXT)
OPDEF(CEE_SHR_UN, "shr.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x64, NEXT)
OPDEF(CEE_NEG, "neg", Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x65, NEXT)
OPDEF(CEE_NOT, "not", Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x66, NEXT)
OPDEF(CEE_CONV_I1, "conv.i1", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x67, NEXT)
OPDEF(CEE_CONV_I2, "conv.i2", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x68, NEXT)
OPDEF(CEE_CONV_I4, "conv.i4", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x69, NEXT)
OPDEF(CEE_CONV_I8, "conv.i8", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0x6A, NEXT)
OPDEF(CEE_CONV_R4, "conv.r4", Pop1, PushR4, InlineNone, 0, 1, 0xFF, 0x6B, NEXT)
OPDEF(CEE_CONV_R8, "conv.r8", Pop1, PushR8, InlineNone, 0, 1, 0xFF, 0x6C, NEXT)
OPDEF(CEE_CONV_U4, "conv.u4", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x6D, NEXT)
OPDEF(CEE_CONV_U8, "conv.u8", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0x6E, NEXT)
OPDEF(CEE_CALLVIRT, "callvirt", VarPop, VarPush, InlineMethod, 0, 1, 0xFF, 0x6F, CALL)
OPDEF(CEE_CPOBJ, "cpobj", PopI+PopI, Push0, InlineType, 0, 1, 0xFF, 0x70, NEXT)
OPDEF(CEE_LDOBJ, "ldobj", PopI, Push1, InlineType, 0, 1, 0xFF, 0x71, NEXT)
OPDEF(CEE_LDSTR, "ldstr", Pop0, PushRef, InlineString, 0, 1, 0xFF, 0x72, NEXT)
OPDEF(CEE_NEWOBJ, "newobj", VarPop, PushRef, InlineMethod, 0, 1, 0xFF, 0x73, CALL)
OPDEF(CEE_CASTCLASS, "castclass", PopRef, PushRef, InlineType, 0, 1, 0xFF, 0x74, NEXT)
OPDEF(CEE_ISINST, "isinst", PopRef, PushI, InlineType, 0, 1, 0xFF, 0x75, NEXT)
OPDEF(CEE_CONV_R_UN, "conv.r.un", Pop1, PushR8, InlineNone, 0, 1, 0xFF, 0x76, NEXT)
OPDEF(CEE_UNUSED58, "unused58", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x77, NEXT)
OPDEF(CEE_UNUSED1, "unused1", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x78, NEXT)
OPDEF(CEE_UNBOX, "unbox", PopRef, PushI, InlineType, 0, 1, 0xFF, 0x79, NEXT)
OPDEF(CEE_THROW, "throw", PopRef, Push0, InlineNone, 0, 1, 0xFF, 0x7A, ERROR)
OPDEF(CEE_LDFLD, "ldfld", PopRef, Push1, InlineField, 0, 1, 0xFF, 0x7B, NEXT)
OPDEF(CEE_LDFLDA, "ldflda", PopRef, PushI, InlineField, 0, 1, 0xFF, 0x7C, NEXT)
OPDEF(CEE_STFLD, "stfld", PopRef+Pop1, Push0, InlineField, 0, 1, 0xFF, 0x7D, NEXT)
OPDEF(CEE_LDSFLD, "ldsfld", Pop0, Push1, InlineField, 0, 1, 0xFF, 0x7E, NEXT)
OPDEF(CEE_LDSFLDA, "ldsflda", Pop0, PushI, InlineField, 0, 1, 0xFF, 0x7F, NEXT)
OPDEF(CEE_STSFLD, "stsfld", Pop1, Push0, InlineField, 0, 1, 0xFF, 0x80, NEXT)
OPDEF(CEE_STOBJ, "stobj", PopI+Pop1, Push0, InlineType, 0, 1, 0xFF, 0x81, NEXT)
OPDEF(CEE_CONV_OVF_I1_UN, "conv.ovf.i1.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x82, NEXT)
OPDEF(CEE_CONV_OVF_I2_UN, "conv.ovf.i2.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x83, NEXT)
OPDEF(CEE_CONV_OVF_I4_UN, "conv.ovf.i4.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x84, NEXT)
OPDEF(CEE_CONV_OVF_I8_UN, "conv.ovf.i8.un", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0x85, NEXT)
OPDEF(CEE_CONV_OVF_U1_UN, "conv.ovf.u1.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x86, NEXT)
OPDEF(CEE_CONV_OVF_U2_UN, "conv.ovf.u2.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x87, NEXT)
OPDEF(CEE_CONV_OVF_U4_UN, "conv.ovf.u4.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x88, NEXT)
OPDEF(CEE_CONV_OVF_U8_UN, "conv.ovf.u8.un", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0x89, NEXT)
OPDEF(CEE_CONV_OVF_I_UN, "conv.ovf.i.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x8A, NEXT)
OPDEF(CEE_CONV_OVF_U_UN, "conv.ovf.u.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x8B, NEXT)
OPDEF(CEE_BOX, "box", Pop1, PushRef, InlineType, 0, 1, 0xFF, 0x8C, NEXT)
OPDEF(CEE_NEWARR, "newarr", PopI, PushRef, InlineType, 0, 1, 0xFF, 0x8D, NEXT)
OPDEF(CEE_LDLEN, "ldlen", PopRef, PushI, InlineNone, 0, 1, 0xFF, 0x8E, NEXT)
OPDEF(CEE_LDELEMA, "ldelema", PopRef+PopI, PushI, InlineType, 0, 1, 0xFF, 0x8F, NEXT)
OPDEF(CEE_LDELEM_I1, "ldelem.i1", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x90, NEXT)
OPDEF(CEE_LDELEM_U1, "ldelem.u1", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x91, NEXT)
OPDEF(CEE_LDELEM_I2, "ldelem.i2", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x92, NEXT)
OPDEF(CEE_LDELEM_U2, "ldelem.u2", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x93, NEXT)
OPDEF(CEE_LDELEM_I4, "ldelem.i4", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x94, NEXT)
OPDEF(CEE_LDELEM_U4, "ldelem.u4", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x95, NEXT)
OPDEF(CEE_LDELEM_I8, "ldelem.i8", PopRef+PopI, PushI8, InlineNone, 0, 1, 0xFF, 0x96, NEXT)
OPDEF(CEE_LDELEM_I, "ldelem.i", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x97, NEXT)
OPDEF(CEE_LDELEM_R4, "ldelem.r4", PopRef+PopI, PushR4, InlineNone, 0, 1, 0xFF, 0x98, NEXT)
OPDEF(CEE_LDELEM_R8, "ldelem.r8", PopRef+PopI, PushR8, InlineNone, 0, 1, 0xFF, 0x99, NEXT)
OPDEF(CEE_LDELEM_REF, "ldelem.ref", PopRef+PopI, PushRef, InlineNone, 0, 1, 0xFF, 0x9A, NEXT)
OPDEF(CEE_STELEM_I, "stelem.i", PopRef+PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x9B, NEXT)
OPDEF(CEE_STELEM_I1, "stelem.i1", PopRef+PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x9C, NEXT)
OPDEF(CEE_STELEM_I2, "stelem.i2", PopRef+PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x9D, NEXT)
OPDEF(CEE_STELEM_I4, "stelem.i4", PopRef+PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x9E, NEXT)
OPDEF(CEE_STELEM_I8, "stelem.i8", PopRef+PopI+PopI8, Push0, InlineNone, 0, 1, 0xFF, 0x9F, NEXT)
OPDEF(CEE_STELEM_R4, "stelem.r4", PopRef+PopI+PopR4, Push0, InlineNone, 0, 1, 0xFF, 0xA0, NEXT)
OPDEF(CEE_STELEM_R8, "stelem.r8", PopRef+PopI+PopR8, Push0, InlineNone, 0, 1, 0xFF, 0xA1, NEXT)
OPDEF(CEE_STELEM_REF, "stelem.ref", PopRef+PopI+PopRef, Push0, InlineNone, 0, 1, 0xFF, 0xA2, NEXT)
OPDEF(CEE_LDELEM, "ldelem", PopRef+PopI, Push1, InlineType, 0, 1, 0xFF, 0xA3, NEXT)
OPDEF(CEE_STELEM, "stelem", PopRef+PopI+Pop1, Push0, InlineType, 0, 1, 0xFF, 0xA4, NEXT)
OPDEF(CEE_UNBOX_ANY, "unbox.any", PopRef, Push1, InlineType, 0, 1, 0xFF, 0xA5, NEXT)
OPDEF(CEE_UNUSED5, "unused5", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xA6, NEXT)
OPDEF(CEE_UNUSED6, "unused6", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xA7, NEXT)
OPDEF(CEE_UNUSED7, "unused7", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xA8, NEXT)
OPDEF(CEE_UNUSED8, "unused8", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xA9, NEXT)
OPDEF(CEE_UNUSED9, "unused9", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAA, NEXT)
OPDEF(CEE_UNUSED10, "unused10", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAB, NEXT)
OPDEF(CEE_UNUSED11, "unused11", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAC, NEXT)
OPDEF(CEE_UNUSED12, "unused12", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAD, NEXT)
OPDEF(CEE_UNUSED13, "unused13", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAE, NEXT)
OPDEF(CEE_UNUSED14, "unused14", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAF, NEXT)
OPDEF(CEE_UNUSED15, "unused15", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xB0, NEXT)
OPDEF(CEE_UNUSED16, "unused16", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xB1, NEXT)
OPDEF(CEE_UNUSED17, "unused17", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xB2, NEXT)
OPDEF(CEE_CONV_OVF_I1, "conv.ovf.i1", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB3, NEXT)
OPDEF(CEE_CONV_OVF_U1, "conv.ovf.u1", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB4, NEXT)
OPDEF(CEE_CONV_OVF_I2, "conv.ovf.i2", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB5, NEXT)
OPDEF(CEE_CONV_OVF_U2, "conv.ovf.u2", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB6, NEXT)
OPDEF(CEE_CONV_OVF_I4, "conv.ovf.i4", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB7, NEXT)
OPDEF(CEE_CONV_OVF_U4, "conv.ovf.u4", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB8, NEXT)
OPDEF(CEE_CONV_OVF_I8, "conv.ovf.i8", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0xB9, NEXT)
OPDEF(CEE_CONV_OVF_U8, "conv.ovf.u8", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0xBA, NEXT)
OPDEF(CEE_UNUSED50, "unused50", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBB, NEXT)
OPDEF(CEE_UNUSED18, "unused18", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBC, NEXT)
OPDEF(CEE_UNUSED19, "unused19", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBD, NEXT)
OPDEF(CEE_UNUSED20, "unused20", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBE, NEXT)
OPDEF(CEE_UNUSED21, "unused21", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBF, NEXT)
OPDEF(CEE_UNUSED22, "unused22", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC0, NEXT)
OPDEF(CEE_UNUSED23, "unused23", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC1, NEXT)
OPDEF(CEE_REFANYVAL, "refanyval", Pop1, PushI, InlineType, 0, 1, 0xFF, 0xC2, NEXT)
OPDEF(CEE_CKFINITE, "ckfinite", Pop1, PushR8, InlineNone, 0, 1, 0xFF, 0xC3, NEXT)
OPDEF(CEE_UNUSED24, "unused24", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC4, NEXT)
OPDEF(CEE_UNUSED25, "unused25", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC5, NEXT)
OPDEF(CEE_MKREFANY, "mkrefany", PopI, Push1, InlineType, 0, 1, 0xFF, 0xC6, NEXT)
OPDEF(CEE_UNUSED59, "unused59", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC7, NEXT)
OPDEF(CEE_UNUSED60, "unused60", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC8, NEXT)
OPDEF(CEE_UNUSED61, "unused61", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC9, NEXT)
OPDEF(CEE_UNUSED62, "unused62", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCA, NEXT)
OPDEF(CEE_UNUSED63, "unused63", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCB, NEXT)
OPDEF(CEE_UNUSED64, "unused64", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCC, NEXT)
OPDEF(CEE_UNUSED65, "unused65", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCD, NEXT)
OPDEF(CEE_UNUSED66, "unused66", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCE, NEXT)
OPDEF(CEE_UNUSED67, "unused67", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCF, NEXT)
OPDEF(CEE_LDTOKEN, "ldtoken", Pop0, PushI, InlineTok, 0, 1, 0xFF, 0xD0, NEXT)
OPDEF(CEE_CONV_U2, "conv.u2", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD1, NEXT)
OPDEF(CEE_CONV_U1, "conv.u1", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD2, NEXT)
OPDEF(CEE_CONV_I, "conv.i", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD3, NEXT)
OPDEF(CEE_CONV_OVF_I, "conv.ovf.i", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD4, NEXT)
OPDEF(CEE_CONV_OVF_U, "conv.ovf.u", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD5, NEXT)
OPDEF(CEE_ADD_OVF, "add.ovf", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xD6, NEXT)
OPDEF(CEE_ADD_OVF_UN, "add.ovf.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xD7, NEXT)
OPDEF(CEE_MUL_OVF, "mul.ovf", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xD8, NEXT)
OPDEF(CEE_MUL_OVF_UN, "mul.ovf.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xD9, NEXT)
OPDEF(CEE_SUB_OVF, "sub.ovf", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xDA, NEXT)
OPDEF(CEE_SUB_OVF_UN, "sub.ovf.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xDB, NEXT)
OPDEF(CEE_ENDFINALLY, "endfinally", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xDC, RETURN)
OPDEF(CEE_LEAVE, "leave", Pop0, Push0, InlineBrTarget, 0, 1, 0xFF, 0xDD, BRANCH)
OPDEF(CEE_LEAVE_S, "leave.s", Pop0, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0xDE, BRANCH)
OPDEF(CEE_STIND_I, "stind.i", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0xDF, NEXT)
OPDEF(CEE_CONV_U, "conv.u", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xE0, NEXT)
OPDEF(CEE_UNUSED26, "unused26", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE1, NEXT)
OPDEF(CEE_UNUSED27, "unused27", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE2, NEXT)
OPDEF(CEE_UNUSED28, "unused28", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE3, NEXT)
OPDEF(CEE_UNUSED29, "unused29", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE4, NEXT)
OPDEF(CEE_UNUSED30, "unused30", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE5, NEXT)
OPDEF(CEE_UNUSED31, "unused31", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE6, NEXT)
OPDEF(CEE_UNUSED32, "unused32", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE7, NEXT)
OPDEF(CEE_UNUSED33, "unused33", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE8, NEXT)
OPDEF(CEE_UNUSED34, "unused34", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE9, NEXT)
OPDEF(CEE_UNUSED35, "unused35", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEA, NEXT)
OPDEF(CEE_UNUSED36, "unused36", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEB, NEXT)
OPDEF(CEE_UNUSED37, "unused37", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEC, NEXT)
OPDEF(CEE_UNUSED38, "unused38", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xED, NEXT)
OPDEF(CEE_UNUSED39, "unused39", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEE, NEXT)
OPDEF(CEE_UNUSED40, "unused40", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEF, NEXT)
OPDEF(CEE_UNUSED41, "unused41", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF0, NEXT)
OPDEF(CEE_UNUSED42, "unused42", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF1, NEXT)
OPDEF(CEE_UNUSED43, "unused43", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF2, NEXT)
OPDEF(CEE_UNUSED44, "unused44", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF3, NEXT)
OPDEF(CEE_UNUSED45, "unused45", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF4, NEXT)
OPDEF(CEE_UNUSED46, "unused46", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF5, NEXT)
OPDEF(CEE_UNUSED47, "unused47", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF6, NEXT)
OPDEF(CEE_UNUSED48, "unused48", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF7, NEXT)
OPDEF(CEE_PREFIX7, "prefix7", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF8, META)
OPDEF(CEE_PREFIX6, "prefix6", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF9, META)
OPDEF(CEE_PREFIX5, "prefix5", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFA, META)
OPDEF(CEE_PREFIX4, "prefix4", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFB, META)
OPDEF(CEE_PREFIX3, "prefix3", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFC, META)
OPDEF(CEE_PREFIX2, "prefix2", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFD, META)
OPDEF(CEE_PREFIX1, "prefix1", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFE, META)
OPDEF(CEE_PREFIXREF, "prefixref", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFF, META)
OPDEF(CEE_ARGLIST, "arglist", Pop0, PushI, InlineNone, 0, 2, 0xFE, 0x00, NEXT)
OPDEF(CEE_CEQ, "ceq", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x01, NEXT)
OPDEF(CEE_CGT, "cgt", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x02, NEXT)
OPDEF(CEE_CGT_UN, "cgt.un", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x03, NEXT)
OPDEF(CEE_CLT, "clt", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x04, NEXT)
OPDEF(CEE_CLT_UN, "clt.un", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x05, NEXT)
OPDEF(CEE_LDFTN, "ldftn", Pop0, PushI, InlineMethod, 0, 2, 0xFE, 0x06, NEXT)
OPDEF(CEE_LDVIRTFTN, "ldvirtftn", PopRef, PushI, InlineMethod, 0, 2, 0xFE, 0x07, NEXT)
OPDEF(CEE_UNUSED56, "unused56", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x08, NEXT)
OPDEF(CEE_LDARG, "ldarg", Pop0, Push1, InlineVar, 0, 2, 0xFE, 0x09, NEXT)
OPDEF(CEE_LDARGA, "ldarga", Pop0, PushI, InlineVar, 0, 2, 0xFE, 0x0A, NEXT)
OPDEF(CEE_STARG, "starg", Pop1, Push0, InlineVar, 0, 2, 0xFE, 0x0B, NEXT)
OPDEF(CEE_LDLOC, "ldloc", Pop0, Push1, InlineVar, 0, 2, 0xFE, 0x0C, NEXT)
OPDEF(CEE_LDLOCA, "ldloca", Pop0, PushI, InlineVar, 0, 2, 0xFE, 0x0D, NEXT)
OPDEF(CEE_STLOC, "stloc", Pop1, Push0, InlineVar, 0, 2, 0xFE, 0x0E, NEXT)
OPDEF(CEE_LOCALLOC, "localloc", PopI, PushI, InlineNone, 0, 2, 0xFE, 0x0F, NEXT)
OPDEF(CEE_UNUSED57, "unused57", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x10, NEXT)
OPDEF(CEE_ENDFILTER, "endfilter", PopI, Push0, InlineNone, 0, 2, 0xFE, 0x11, RETURN)
OPDEF(CEE_UNALIGNED_, "unaligned.", Pop0, Push0, ShortInlineI, 0, 2, 0xFE, 0x12, META)
OPDEF(CEE_VOLATILE_, "volatile.", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x13, META)
OPDEF(CEE_TAIL_, "tail.", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x14, META)
OPDEF(CEE_INITOBJ, "initobj", PopI, Push0, InlineType, 0, 2, 0xFE, 0x15, NEXT)
OPDEF(CEE_CONSTRAINED_, "constrained.", Pop0, Push0, InlineType, 0, 2, 0xFE, 0x16, META)
OPDEF(CEE_CPBLK, "cpblk", PopI+PopI+PopI, Push0, InlineNone, 0, 2, 0xFE, 0x17, NEXT)
OPDEF(CEE_INITBLK, "initblk", PopI+PopI+PopI, Push0, InlineNone, 0, 2, 0xFE, 0x18, NEXT)
OPDEF(CEE_NO_, "no.", Pop0, Push0, ShortInlineI, 0, 2, 0xFE, 0x19, NEXT)
OPDEF(CEE_RETHROW, "rethrow", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x1A, ERROR)
OPDEF(CEE_UNUSED, "unused", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x1B, NEXT)
OPDEF(CEE_SIZEOF, "sizeof", Pop0, PushI, InlineType, 0, 2, 0xFE, 0x1C, NEXT)
OPDEF(CEE_REFANYTYPE, "refanytype", Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x1D, NEXT)
OPDEF(CEE_READONLY_, "readonly.", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x1E, META)
OPDEF(CEE_UNUSED53, "unused53", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x1F, NEXT)
OPDEF(CEE_UNUSED54, "unused54", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x20, NEXT)
OPDEF(CEE_UNUSED55, "unused55", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x21, NEXT)
OPDEF(CEE_UNUSED70, "unused70", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x22, NEXT)
OPDEF(CEE_ILLEGAL, "illegal", Pop0, Push0, InlineNone, 0, 2, 0x00, 0x00, META)
OPDEF(CEE_ENDMAC, "endmac", Pop0, Push0, InlineNone, 0, 2, 0x00, 0x00, META)
OPDEF(CEE_MONO_ICALL, "mono_icall", VarPop, VarPush, InlineI, 0, 2, 0xF0, 0x00, NEXT)
OPDEF(CEE_MONO_OBJADDR, "mono_objaddr", Pop1, PushI, InlineNone, 0, 2, 0xF0, 0x01, NEXT)
OPDEF(CEE_MONO_LDPTR, "mono_ldptr", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x02, NEXT)
OPDEF(CEE_MONO_VTADDR, "mono_vtaddr", Pop1, PushI, InlineNone, 0, 2, 0xF0, 0x03, NEXT)
OPDEF(CEE_MONO_NEWOBJ, "mono_newobj", Pop0, PushRef, InlineType, 0, 2, 0xF0, 0x04, NEXT)
OPDEF(CEE_MONO_RETOBJ, "mono_retobj", PopI, Push0, InlineType, 0, 2, 0xF0, 0x05, RETURN)
OPDEF(CEE_MONO_LDNATIVEOBJ, "mono_ldnativeobj", PopI, Push1, InlineType, 0, 2, 0xF0, 0x06, RETURN)
OPDEF(CEE_MONO_CISINST, "mono_cisinst", PopRef, Push1, InlineType, 0, 2, 0xF0, 0x07, NEXT)
OPDEF(CEE_MONO_CCASTCLASS, "mono_ccastclass", PopRef, Push1, InlineType, 0, 2, 0xF0, 0x08, NEXT)
OPDEF(CEE_MONO_SAVE_LMF, "mono_save_lmf", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x09, NEXT)
OPDEF(CEE_MONO_RESTORE_LMF, "mono_restore_lmf", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x0A, NEXT)
OPDEF(CEE_MONO_CLASSCONST, "mono_classconst", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x0B, NEXT)
OPDEF(CEE_MONO_NOT_TAKEN, "mono_not_taken", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x0C, NEXT)
OPDEF(CEE_MONO_TLS, "mono_tls", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x0D, NEXT)
OPDEF(CEE_MONO_ICALL_ADDR, "mono_icall_addr", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x0E, NEXT)
OPDEF(CEE_MONO_DYN_CALL, "mono_dyn_call", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x0F, NEXT)
OPDEF(CEE_MONO_MEMORY_BARRIER, "mono_memory_barrier", Pop0, Push0, InlineI, 0, 2, 0xF0, 0x10, NEXT)
OPDEF(CEE_UNUSED71, "unused71", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x11, NEXT)
OPDEF(CEE_UNUSED72, "unused72", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x12, NEXT)
OPDEF(CEE_MONO_JIT_ICALL_ADDR, "mono_jit_icall_addr", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x13, NEXT)
OPDEF(CEE_MONO_LDPTR_INT_REQ_FLAG, "mono_ldptr_int_req_flag", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x14, NEXT)
OPDEF(CEE_MONO_LDPTR_CARD_TABLE, "mono_ldptr_card_table", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x15, NEXT)
OPDEF(CEE_MONO_LDPTR_NURSERY_START, "mono_ldptr_nursery_start", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x16, NEXT)
OPDEF(CEE_MONO_LDPTR_NURSERY_BITS, "mono_ldptr_nursery_bits", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x17, NEXT)
OPDEF(CEE_MONO_CALLI_EXTRA_ARG, "mono_calli_extra_arg", VarPop, VarPush, InlineSig, 0, 2, 0xF0, 0x18, CALL)
OPDEF(CEE_MONO_LDDOMAIN, "mono_lddomain", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x19, NEXT)
OPDEF(CEE_MONO_ATOMIC_STORE_I4, "mono_atomic_store_i4", PopI+PopI, Push0, InlineI, 0, 2, 0xF0, 0x1A, NEXT)
OPDEF(CEE_MONO_GET_LAST_ERROR, "mono_get_last_error", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x1B, NEXT)
OPDEF(CEE_MONO_GET_RGCTX_ARG, "mono_get_rgctx_arg", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x1C, NEXT)
OPDEF(CEE_MONO_LDPTR_PROFILER_ALLOCATION_COUNT, "mono_ldptr_profiler_allocation_count", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x1D, NEXT)
OPDEF(CEE_MONO_LD_DELEGATE_METHOD_PTR, "mono_ld_delegate_method_ptr", Pop1, PushI, InlineNone, 0, 2, 0xF0, 0x1E, NEXT)
#ifndef OPALIAS
#define _MONO_CIL_OPALIAS_DEFINED_
#define OPALIAS(a,s,r)
#endif
OPALIAS(CEE_BRNULL, "brnull", CEE_BRFALSE)
OPALIAS(CEE_BRNULL_S, "brnull.s", CEE_BRFALSE_S)
OPALIAS(CEE_BRZERO, "brzero", CEE_BRFALSE)
OPALIAS(CEE_BRZERO_S, "brzero.s", CEE_BRFALSE_S)
OPALIAS(CEE_BRINST, "brinst", CEE_BRTRUE)
OPALIAS(CEE_BRINST_S, "brinst.s", CEE_BRTRUE_S)
OPALIAS(CEE_LDIND_U8, "ldind.u8", CEE_LDIND_I8)
OPALIAS(CEE_LDELEM_U8, "ldelem.u8", CEE_LDELEM_I8)
OPALIAS(CEE_LDX_I4_MIX, "ldc.i4.M1", CEE_LDC_I4_M1)
OPALIAS(CEE_ENDFAULT, "endfault", CEE_ENDFINALLY)
#ifdef _MONO_CIL_OPALIAS_DEFINED_
#undef OPALIAS
#undef _MONO_CIL_OPALIAS_DEFINED_
#endif
-113
View File
@@ -1,113 +0,0 @@
/**
* \file
* Author:
* Dietmar Maurer (dietmar@ximian.com)
*
* (C) 2001, 2002, 2003 Ximian, Inc.
*/
#ifndef _MONO_JIT_JIT_H_
#define _MONO_JIT_JIT_H_
#include <mono/metadata/appdomain.h>
MONO_BEGIN_DECLS
MONO_API MonoDomain *
mono_jit_init (const char *file);
MONO_API MonoDomain *
mono_jit_init_version (const char *root_domain_name, const char *runtime_version);
MONO_API int
mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly,
int argc, char *argv[]);
MONO_API void
mono_jit_cleanup (MonoDomain *domain);
MONO_API mono_bool
mono_jit_set_trace_options (const char* options);
MONO_API void
mono_set_signal_chaining (mono_bool chain_signals);
MONO_API void
mono_set_crash_chaining (mono_bool chain_signals);
/**
* This function is deprecated, use mono_jit_set_aot_mode instead.
*/
MONO_API void
mono_jit_set_aot_only (mono_bool aot_only);
/**
* 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,
/* Uses Interpreter, JIT is disabled and not allowed,
* equivalent to "--full-aot --interpreter" */
MONO_AOT_MODE_INTERP,
/* Same as INTERP, but use only llvm compiled code */
MONO_AOT_MODE_INTERP_LLVMONLY,
/* 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;
MONO_API 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 mono_bool
mono_jit_aot_compiling (void);
/* 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_API void mono_set_break_policy (MonoBreakPolicyFunc policy_callback);
MONO_API void
mono_jit_parse_options (int argc, char * argv[]);
MONO_API char* mono_get_runtime_build_info (void);
MONO_API MONO_RT_EXTERNAL_ONLY void
mono_set_use_llvm (mono_bool use_llvm);
MONO_API MONO_RT_EXTERNAL_ONLY void
mono_aot_register_module (void **aot_info);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoDomain* mono_jit_thread_attach (MonoDomain *domain);
MONO_END_DECLS
#endif
-70
View File
@@ -1,70 +0,0 @@
/**
* \file
* Copyright 2014 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#ifndef __MONO_METADATA_ABI_DETAILS_H__
#define __MONO_METADATA_ABI_DETAILS_H__
#include <config.h>
#include <glib.h>
/*
* This file defines macros to compute sizes/alignments/field offsets which depend on
* the ABI. It is needed during cross compiling since the generated code needs to
* contain offsets which correspond to the ABI of the target, not the host.
* It defines the following macros:
* - MONO_ABI_SIZEOF(type) for every basic type
* - MONO_ABI_ALIGNOF(type) for every basic type
* - MONO_STRUCT_OFFSET(struct, field) for various runtime structures
* When not cross compiling, these correspond to the host ABI (i.e. sizeof/offsetof).
* When cross compiling, these are defined in a generated header file which is
* generated by the offsets tool in tools/offsets-tool. The name of the file
* is given by the --with-cross-offsets= configure argument.
*/
typedef enum {
MONO_ALIGN_gint8,
MONO_ALIGN_gint16,
MONO_ALIGN_gint32,
MONO_ALIGN_gint64,
MONO_ALIGN_float,
MONO_ALIGN_double,
MONO_ALIGN_gpointer,
MONO_ALIGN_COUNT
} CoreTypeAlign;
int mono_abi_alignment (CoreTypeAlign type);
#define MONO_ABI_ALIGNOF(type) mono_abi_alignment (MONO_ALIGN_ ## type)
#define MONO_ABI_SIZEOF(type) (MONO_STRUCT_SIZE (type))
#define MONO_CURRENT_ABI_SIZEOF(type) ((int)sizeof(type))
#undef DECL_OFFSET2
#define DECL_OFFSET(struct,field) MONO_OFFSET_ ## struct ## _ ## field = -1,
#define DECL_OFFSET2(struct,field,offset) MONO_OFFSET_ ## struct ## _ ## field = offset,
#define DECL_ALIGN2(type,size)
#define DECL_SIZE(type) MONO_SIZEOF_ ##type = -1,
#define DECL_SIZE2(type,size) MONO_SIZEOF_ ##type = size,
enum {
#include "object-offsets.h"
};
#ifdef USED_CROSS_COMPILER_OFFSETS
#define MONO_STRUCT_OFFSET(struct,field) MONO_OFFSET_ ## struct ## _ ## field
#define MONO_STRUCT_SIZE(struct) MONO_SIZEOF_ ## struct
#else
#if defined(HAS_CROSS_COMPILER_OFFSETS) || defined(MONO_CROSS_COMPILE)
#define MONO_STRUCT_OFFSET(struct,field) (MONO_OFFSET_ ## struct ## _ ## field == -1, G_STRUCT_OFFSET (struct,field))
#define MONO_STRUCT_SIZE(struct) (MONO_SIZEOF_ ## struct == -1, (int)sizeof(struct))
#else
#define MONO_STRUCT_OFFSET(struct,field) G_STRUCT_OFFSET (struct,field)
#define MONO_STRUCT_SIZE(struct) ((int)sizeof(struct))
#endif
#endif
// #define MONO_SIZEOF_MonoObject (2 * MONO_ABI_SIZEOF(gpointer))
#define MONO_SIZEOF_MonoObject (2 * MONO_SIZEOF_gpointer)
#endif
@@ -1,136 +0,0 @@
/**
* \file
* Appdomain-related icalls.
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#ifndef __MONO_METADATA_APPDOMAIN_ICALLS_H__
#define __MONO_METADATA_APPDOMAIN_ICALLS_H__
#include <mono/metadata/appdomain.h>
#include <mono/metadata/handle.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/icalls.h>
#include "reflection-internals.h"
ICALL_EXPORT
MonoAppDomainHandle
ves_icall_System_AppDomain_getCurDomain (MonoError *error);
ICALL_EXPORT
MonoAppDomainHandle
ves_icall_System_AppDomain_getRootDomain (MonoError *error);
ICALL_EXPORT
MonoAppDomainHandle
ves_icall_System_AppDomain_createDomain (MonoStringHandle friendly_name,
MonoAppDomainSetupHandle setup,
MonoError *error);
ICALL_EXPORT
MonoObjectHandle
ves_icall_System_AppDomain_GetData (MonoAppDomainHandle ad,
MonoStringHandle name,
MonoError* error);
ICALL_EXPORT
MonoReflectionAssemblyHandle
ves_icall_System_AppDomain_LoadAssemblyRaw (MonoAppDomainHandle ad,
MonoArrayHandle raw_assembly,
MonoArrayHandle raw_symbol_store,
MonoObjectHandle evidence,
MonoBoolean refonly,
MonoError *error);
ICALL_EXPORT
void
ves_icall_System_AppDomain_SetData (MonoAppDomainHandle ad,
MonoStringHandle name,
MonoObjectHandle data,
MonoError *error);
ICALL_EXPORT
MonoAppDomainSetupHandle
ves_icall_System_AppDomain_getSetup (MonoAppDomainHandle ad,
MonoError *error);
ICALL_EXPORT
MonoStringHandle
ves_icall_System_AppDomain_getFriendlyName (MonoAppDomainHandle ad,
MonoError *error);
ICALL_EXPORT
MonoArrayHandle
ves_icall_System_AppDomain_GetAssemblies (MonoAppDomainHandle ad,
MonoBoolean refonly,
MonoError *error);
ICALL_EXPORT
MonoReflectionAssemblyHandle
ves_icall_System_Reflection_Assembly_LoadFile_internal (MonoStringHandle fname,
MonoError *error);
ICALL_EXPORT
MonoReflectionAssemblyHandle
ves_icall_System_Reflection_Assembly_LoadFrom (MonoStringHandle fname,
MonoBoolean refonly,
MonoError *error);
ICALL_EXPORT
MonoReflectionAssemblyHandle
ves_icall_System_AppDomain_LoadAssembly (MonoAppDomainHandle ad,
MonoStringHandle assRef,
MonoObjectHandle evidence,
MonoBoolean refonly,
MonoError *error);
ICALL_EXPORT
gboolean
ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id, MonoError *error);
ICALL_EXPORT
void
ves_icall_System_AppDomain_InternalUnload (gint32 domain_id,
MonoError *error);
ICALL_EXPORT
void
ves_icall_System_AppDomain_DoUnhandledException (MonoExceptionHandle exc, MonoError *error);
ICALL_EXPORT
gint32
ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomainHandle ad,
MonoReflectionAssemblyHandle refass,
MonoArrayHandle args,
MonoError *error);
ICALL_EXPORT
MonoAppDomainHandle
ves_icall_System_AppDomain_InternalSetDomain (MonoAppDomainHandle ad, MonoError *error);
ICALL_EXPORT
MonoAppDomainHandle
ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid, MonoError *error);
ICALL_EXPORT
void
ves_icall_System_AppDomain_InternalPushDomainRef (MonoAppDomainHandle ad, MonoError *error);
ICALL_EXPORT
void
ves_icall_System_AppDomain_InternalPushDomainRefByID (gint32 domain_id, MonoError *error);
ICALL_EXPORT
void
ves_icall_System_AppDomain_InternalPopDomainRef (MonoError *error);
ICALL_EXPORT
MonoAppContextHandle
ves_icall_System_AppDomain_InternalGetContext (MonoError *error);
ICALL_EXPORT
MonoAppContextHandle
ves_icall_System_AppDomain_InternalGetDefaultContext (MonoError *error);
ICALL_EXPORT
MonoAppContextHandle
ves_icall_System_AppDomain_InternalSetContext (MonoAppContextHandle mc, MonoError *error);
ICALL_EXPORT
MonoStringHandle
ves_icall_System_AppDomain_InternalGetProcessGuid (MonoStringHandle newguid, MonoError *error);
ICALL_EXPORT
MonoBoolean
ves_icall_System_CLRConfig_CheckThrowUnobservedTaskExceptions (MonoError *error);
#endif /*__MONO_METADATA_APPDOMAIN_ICALLS_H__*/
-231
View File
@@ -1,231 +0,0 @@
/**
* \file
* AppDomain functions
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
*
* (C) 2001 Ximian, Inc.
*/
#ifndef _MONO_METADATA_APPDOMAIN_H_
#define _MONO_METADATA_APPDOMAIN_H_
#include <mono/utils/mono-publib.h>
#include <mono/utils/mono-forward.h>
#include <mono/metadata/object.h>
#include <mono/metadata/reflection.h>
MONO_BEGIN_DECLS
typedef void (*MonoThreadStartCB) (intptr_t tid, void* stack_start,
void* func);
typedef void (*MonoThreadAttachCB) (intptr_t tid, void* stack_start);
typedef struct _MonoAppDomain MonoAppDomain;
typedef void (*MonoDomainFunc) (MonoDomain *domain, void* user_data);
MONO_API MonoDomain*
mono_init (const char *filename);
MONO_API MonoDomain *
mono_init_from_assembly (const char *domain_name, const char *filename);
MONO_API MonoDomain *
mono_init_version (const char *domain_name, const char *version);
MONO_API MonoDomain*
mono_get_root_domain (void);
MONO_API MONO_RT_EXTERNAL_ONLY void
mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
MonoThreadAttachCB attach_cb);
MONO_API void
mono_runtime_cleanup (MonoDomain *domain);
MONO_API void
mono_install_runtime_cleanup (MonoDomainFunc func);
MONO_API void
mono_runtime_quit (void);
MONO_API void
mono_runtime_set_shutting_down (void);
MONO_API mono_bool
mono_runtime_is_shutting_down (void);
MONO_API const char*
mono_check_corlib_version (void);
MONO_API MonoDomain *
mono_domain_create (void);
MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
mono_domain_create_appdomain (char *friendly_name, char *configuration_file);
MONO_API MONO_RT_EXTERNAL_ONLY void
mono_domain_set_config (MonoDomain *domain, const char *base_dir, const char *config_file_name);
MONO_API MonoDomain *
mono_domain_get (void);
MONO_API MonoDomain *
mono_domain_get_by_id (int32_t domainid);
MONO_API int32_t
mono_domain_get_id (MonoDomain *domain);
MONO_API const char *
mono_domain_get_friendly_name (MonoDomain *domain);
MONO_API mono_bool
mono_domain_set (MonoDomain *domain, mono_bool force);
MONO_API void
mono_domain_set_internal (MonoDomain *domain);
MONO_API MONO_RT_EXTERNAL_ONLY void
mono_domain_unload (MonoDomain *domain);
MONO_API void
mono_domain_try_unload (MonoDomain *domain, MonoObject **exc);
MONO_API mono_bool
mono_domain_is_unloading (MonoDomain *domain);
MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
mono_domain_from_appdomain (MonoAppDomain *appdomain);
MONO_API void
mono_domain_foreach (MonoDomainFunc func, void* user_data);
MONO_API MonoAssembly *
mono_domain_assembly_open (MonoDomain *domain, const char *name);
MONO_API mono_bool
mono_domain_finalize (MonoDomain *domain, uint32_t timeout);
MONO_API void
mono_domain_free (MonoDomain *domain, mono_bool force);
MONO_API mono_bool
mono_domain_has_type_resolve (MonoDomain *domain);
MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly *
mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb);
MONO_API mono_bool
mono_domain_owns_vtable_slot (MonoDomain *domain, void* vtable_slot);
MONO_API MONO_RT_EXTERNAL_ONLY void
mono_context_init (MonoDomain *domain);
MONO_API MONO_RT_EXTERNAL_ONLY void
mono_context_set (MonoAppContext *new_context);
MONO_API MonoAppContext *
mono_context_get (void);
MONO_API int32_t
mono_context_get_id (MonoAppContext *context);
MONO_API int32_t
mono_context_get_domain_id (MonoAppContext *context);
MONO_API MonoJitInfo *
mono_jit_info_table_find (MonoDomain *domain, void* addr);
/* MonoJitInfo accessors */
MONO_API void*
mono_jit_info_get_code_start (MonoJitInfo* ji);
MONO_API int
mono_jit_info_get_code_size (MonoJitInfo* ji);
MONO_API MonoMethod*
mono_jit_info_get_method (MonoJitInfo* ji);
MONO_API MonoImage*
mono_get_corlib (void);
MONO_API MonoClass*
mono_get_object_class (void);
MONO_API MonoClass*
mono_get_byte_class (void);
MONO_API MonoClass*
mono_get_void_class (void);
MONO_API MonoClass*
mono_get_boolean_class (void);
MONO_API MonoClass*
mono_get_sbyte_class (void);
MONO_API MonoClass*
mono_get_int16_class (void);
MONO_API MonoClass*
mono_get_uint16_class (void);
MONO_API MonoClass*
mono_get_int32_class (void);
MONO_API MonoClass*
mono_get_uint32_class (void);
MONO_API MonoClass*
mono_get_intptr_class (void);
MONO_API MonoClass*
mono_get_uintptr_class (void);
MONO_API MonoClass*
mono_get_int64_class (void);
MONO_API MonoClass*
mono_get_uint64_class (void);
MONO_API MonoClass*
mono_get_single_class (void);
MONO_API MonoClass*
mono_get_double_class (void);
MONO_API MonoClass*
mono_get_char_class (void);
MONO_API MonoClass*
mono_get_string_class (void);
MONO_API MonoClass*
mono_get_enum_class (void);
MONO_API MonoClass*
mono_get_array_class (void);
MONO_API MonoClass*
mono_get_thread_class (void);
MONO_API MonoClass*
mono_get_exception_class (void);
MONO_API void
mono_security_enable_core_clr (void);
typedef mono_bool (*MonoCoreClrPlatformCB) (const char *image_name);
MONO_API void
mono_security_set_core_clr_platform_callback (MonoCoreClrPlatformCB callback);
MONO_END_DECLS
#endif /* _MONO_METADATA_APPDOMAIN_H_ */
@@ -1,90 +0,0 @@
/**
* \file
* Copyright 2015 Xamarin Inc
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#ifndef __MONO_METADATA_ASSEMBLY_INTERNALS_H__
#define __MONO_METADATA_ASSEMBLY_INTERNALS_H__
#include <glib.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/metadata-internals.h>
/* Flag bits for mono_assembly_names_equal_flags (). */
typedef enum {
/* Default comparison: all fields must match */
MONO_ANAME_EQ_NONE = 0x0,
/* Don't compare public key token */
MONO_ANAME_EQ_IGNORE_PUBKEY = 0x1,
/* Don't compare the versions */
MONO_ANAME_EQ_IGNORE_VERSION = 0x2,
/* When comparing simple names, ignore case differences */
MONO_ANAME_EQ_IGNORE_CASE = 0x4,
MONO_ANAME_EQ_MASK = 0x7
} MonoAssemblyNameEqFlags;
void
mono_assembly_name_free_internal (MonoAssemblyName *aname);
gboolean
mono_assembly_names_equal_flags (MonoAssemblyName *l, MonoAssemblyName *r, MonoAssemblyNameEqFlags flags);
gboolean
mono_assembly_get_assemblyref_checked (MonoImage *image, int index, MonoAssemblyName *aname, MonoError *error);
MONO_API MonoImage* mono_assembly_load_module_checked (MonoAssembly *assembly, uint32_t idx, MonoError *error);
MonoAssembly * mono_assembly_open_a_lot (const char *filename, MonoImageOpenStatus *status, MonoAssemblyContextKind asmctx);
MonoAssembly* mono_assembly_load_full_nosearch (MonoAssemblyName *aname,
const char *basedir,
MonoAssemblyContextKind asmctx,
MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_load_with_partial_name_internal (const char *name, MonoImageOpenStatus *status);
typedef gboolean (*MonoAssemblyAsmCtxFromPathFunc) (const char *absfname, MonoAssembly *requesting_assembly, gpointer user_data, MonoAssemblyContextKind *out_asmctx);
void mono_install_assembly_asmctx_from_path_hook (MonoAssemblyAsmCtxFromPathFunc func, gpointer user_data);
/* If predicate returns true assembly should be loaded, if false ignore it. */
typedef gboolean (*MonoAssemblyCandidatePredicate)(MonoAssembly *, gpointer);
MonoAssembly* mono_assembly_open_predicate (const char *filename,
MonoAssemblyContextKind asmctx,
MonoAssemblyCandidatePredicate pred,
gpointer user_data,
MonoAssembly *requesting_assembly,
MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_load_from_predicate (MonoImage *image, const char *fname,
MonoAssemblyContextKind asmctx,
MonoAssemblyCandidatePredicate pred,
gpointer user_data,
MonoImageOpenStatus *status);
/* MonoAssemblyCandidatePredicate that compares the assembly name (name, version,
* culture, public key token) of the candidate with the wanted name, if the
* wanted name has a public key token (if not present, always return true).
* Pass the wanted MonoAssemblyName* as the user_data.
*/
gboolean
mono_assembly_candidate_predicate_sn_same_name (MonoAssembly *candidate, gpointer wanted_name);
MonoAssembly*
mono_assembly_binding_applies_to_image (MonoImage* image, MonoImageOpenStatus *status);
MonoAssembly*
mono_assembly_load_from_assemblies_path (gchar **assemblies_path, MonoAssemblyName *aname, MonoAssemblyContextKind asmctx);
MONO_PROFILER_API MonoAssemblyName*
mono_assembly_get_name_internal (MonoAssembly *assembly);
MONO_PROFILER_API MonoImage*
mono_assembly_get_image_internal (MonoAssembly *assembly);
#endif /* __MONO_METADATA_ASSEMBLY_INTERNALS_H__ */
-131
View File
@@ -1,131 +0,0 @@
/**
* \file
*/
#ifndef _MONONET_METADATA_ASSEMBLY_H_
#define _MONONET_METADATA_ASSEMBLY_H_
#include <mono/utils/mono-error.h>
#include <mono/metadata/image.h>
MONO_BEGIN_DECLS
MONO_API void mono_assemblies_init (void);
MONO_API void mono_assemblies_cleanup (void);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoAssembly *mono_assembly_open (const char *filename,
MonoImageOpenStatus *status);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoAssembly *mono_assembly_open_full (const char *filename,
MonoImageOpenStatus *status,
mono_bool refonly);
MONO_API MonoAssembly* mono_assembly_load (MonoAssemblyName *aname,
const char *basedir,
MonoImageOpenStatus *status);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoAssembly* mono_assembly_load_full (MonoAssemblyName *aname,
const char *basedir,
MonoImageOpenStatus *status,
mono_bool refonly);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoAssembly* mono_assembly_load_from (MonoImage *image, const char *fname,
MonoImageOpenStatus *status);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoAssembly* mono_assembly_load_from_full (MonoImage *image, const char *fname,
MonoImageOpenStatus *status,
mono_bool refonly);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoAssembly* mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoAssembly* mono_assembly_loaded (MonoAssemblyName *aname);
MONO_API MonoAssembly* mono_assembly_loaded_full (MonoAssemblyName *aname, mono_bool refonly);
MONO_API void mono_assembly_get_assemblyref (MonoImage *image, int index, MonoAssemblyName *aname);
MONO_API void mono_assembly_load_reference (MonoImage *image, int index);
MONO_API void mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status);
MONO_API MONO_RT_EXTERNAL_ONLY MonoImage* mono_assembly_load_module (MonoAssembly *assembly, uint32_t idx);
MONO_API void mono_assembly_close (MonoAssembly *assembly);
MONO_API void mono_assembly_setrootdir (const char *root_dir);
MONO_API MONO_CONST_RETURN char *mono_assembly_getrootdir (void);
MONO_API char *mono_native_getrootdir (void);
MONO_API void mono_assembly_foreach (MonoFunc func, void* user_data);
MONO_API void mono_assembly_set_main (MonoAssembly *assembly);
MONO_API MonoAssembly *mono_assembly_get_main (void);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoImage *mono_assembly_get_image (MonoAssembly *assembly);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoAssemblyName *mono_assembly_get_name (MonoAssembly *assembly);
MONO_API mono_bool mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname);
MONO_API mono_bool mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r);
MONO_API char* mono_stringify_assembly_name (MonoAssemblyName *aname);
/* Installs a function which is called each time a new assembly is loaded. */
typedef void (*MonoAssemblyLoadFunc) (MonoAssembly *assembly, void* user_data);
MONO_API void mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, void* user_data);
/* Installs a function which is called each time an assembly is unloaded. */
typedef void(*MonoAssemblyUnloadFunc) (MonoAssembly *assembly, void* user_data);
MONO_API void mono_install_assembly_unload_hook(MonoAssemblyUnloadFunc func, void* user_data);
/*
* Installs a new function which is used to search the list of loaded
* assemblies for a given assembly name.
*/
typedef MonoAssembly *(*MonoAssemblySearchFunc) (MonoAssemblyName *aname, void* user_data);
MONO_API void mono_install_assembly_search_hook (MonoAssemblySearchFunc func, void* user_data);
MONO_API void mono_install_assembly_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
MONO_API MonoAssembly* mono_assembly_invoke_search_hook (MonoAssemblyName *aname);
/*
* Installs a new search function which is used as a last resort when loading
* an assembly fails. This could invoke AssemblyResolve events.
*/
MONO_API void
mono_install_assembly_postload_search_hook (MonoAssemblySearchFunc func, void* user_data);
MONO_API void
mono_install_assembly_postload_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
/* Installs a function which is called before a new assembly is loaded
* The hook are invoked from last hooked to first. If any of them returns
* a non-null value, that will be the value returned in mono_assembly_load */
typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname,
char **assemblies_path,
void* user_data);
MONO_API void mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func,
void* user_data);
MONO_API void mono_install_assembly_refonly_preload_hook (MonoAssemblyPreLoadFunc func,
void* user_data);
MONO_API void mono_assembly_invoke_load_hook (MonoAssembly *ass);
MONO_API MonoAssemblyName* mono_assembly_name_new (const char *name);
MONO_API const char* mono_assembly_name_get_name (MonoAssemblyName *aname);
MONO_API const char* mono_assembly_name_get_culture (MonoAssemblyName *aname);
MONO_API uint16_t mono_assembly_name_get_version (MonoAssemblyName *aname,
uint16_t *minor, uint16_t *build, uint16_t *revision);
MONO_API mono_byte* mono_assembly_name_get_pubkeytoken (MonoAssemblyName *aname);
MONO_API void mono_assembly_name_free (MonoAssemblyName *aname);
typedef struct {
const char *name;
const unsigned char *data;
const unsigned int size;
} MonoBundledAssembly;
MONO_API void mono_register_bundled_assemblies (const MonoBundledAssembly **assemblies);
MONO_API void mono_register_config_for_assembly (const char* assembly_name, const char* config_xml);
MONO_API void mono_register_symfile_for_assembly (const char* assembly_name, const mono_byte *raw_contents, int size);
MONO_API void mono_register_machine_config (const char *config_xml);
MONO_API void mono_set_rootdir (void);
MONO_API void mono_set_dirs (const char *assembly_dir, const char *config_dir);
MONO_API void mono_set_assemblies_path (const char* path);
MONO_END_DECLS
#endif
-26
View File
@@ -1,26 +0,0 @@
/**
* \file
*/
#ifndef __MONO_ATTACH_H__
#define __MONO_ATTACH_H__
#include <glib.h>
#include <mono/utils/mono-compiler.h>
void
mono_attach_parse_options (char *options);
void
mono_attach_init (void);
gboolean
mono_attach_start (void);
void
mono_attach_maybe_start (void);
void
mono_attach_cleanup (void);
#endif
-274
View File
@@ -1,274 +0,0 @@
/**
* \file
* This file contains the various definitions for constants
* found on the metadata tables
*
* Author:
* Miguel de Icaza (miguel@ximian.com)
* Paolo Molaro (lupus@ximian.com)
*
* (C) 2001 Ximian, Inc.
* (C) 2006 Novell, Inc.
*
* From the ECMA documentation
*/
#ifndef _MONO_METADATA_ATTRDEFS_H_
#define _MONO_METADATA_ATTRDEFS_H_
/*
* 23.1.1 Values for AssemblyHashAlgorithm
*/
enum {
MONO_ASSEMBLY_HASH_NONE,
MONO_ASSEMBLY_HASH_MD5 = 0x8003,
MONO_ASSEMBLY_HASH_SHA1 = 0x8004
};
/*
* 23.1.2 AssemblyRefs
*/
enum {
MONO_ASSEMBLYREF_FULL_PUBLIC_KEY = 0x0001,
MONO_ASSEMBLYREF_RETARGETABLE = 0x0100,
MONO_ASSEMBLYREF_JIT_TRACKING = 0x8000,
MONO_ASSEMBLYREF_NO_JIT_OPT = 0x4000
};
/*
* 23.1.4 Flags for Event.EventAttributes
*/
enum {
MONO_EVENT_SPECIALNAME = 0x0200,
MONO_EVENT_RTSPECIALNAME = 0x0400
};
/*
* Field Attributes (23.1.5).
*/
enum {
MONO_FIELD_ATTR_FIELD_ACCESS_MASK = 0x0007,
MONO_FIELD_ATTR_COMPILER_CONTROLLED = 0x0000,
MONO_FIELD_ATTR_PRIVATE = 0x0001,
MONO_FIELD_ATTR_FAM_AND_ASSEM = 0x0002,
MONO_FIELD_ATTR_ASSEMBLY = 0x0003,
MONO_FIELD_ATTR_FAMILY = 0x0004,
MONO_FIELD_ATTR_FAM_OR_ASSEM = 0x0005,
MONO_FIELD_ATTR_PUBLIC = 0x0006,
MONO_FIELD_ATTR_STATIC = 0x0010,
MONO_FIELD_ATTR_INIT_ONLY = 0x0020,
MONO_FIELD_ATTR_LITERAL = 0x0040,
MONO_FIELD_ATTR_NOT_SERIALIZED = 0x0080,
MONO_FIELD_ATTR_SPECIAL_NAME = 0x0200,
MONO_FIELD_ATTR_PINVOKE_IMPL = 0x2000,
/* For runtime use only */
MONO_FIELD_ATTR_RESERVED_MASK = 0x9500,
MONO_FIELD_ATTR_RT_SPECIAL_NAME = 0x0400,
MONO_FIELD_ATTR_HAS_MARSHAL = 0x1000,
MONO_FIELD_ATTR_HAS_DEFAULT = 0x8000,
MONO_FIELD_ATTR_HAS_RVA = 0x0100
};
/*
* 23.1.6 Flags for FileAttributes
*/
enum {
MONO_FILE_HAS_METADATA = 0,
MONO_FILE_HAS_NO_METADATA = 1
};
/*
* 23.1.7 Flags for generic parameters
*/
enum {
MONO_GEN_PARAM_VARIANCE_MASK = 0x0003,
MONO_GEN_PARAM_NON_VARIANT = 0x0000,
MONO_GEN_PARAM_VARIANT = 0x0001,
MONO_GEN_PARAM_COVARIANT = 0x0002,
MONO_GEN_PARAM_CONSTRAINT_MASK = 0x001c,
MONO_GEN_PARAM_CONSTRAINT_CLASS = 0x0004,
MONO_GEN_PARAM_CONSTRAINT_VTYPE = 0x0008,
MONO_GEN_PARAM_CONSTRAINT_DCTOR = 0x0010
};
/*
* 23.1.8 Flags for ImplMap [PInvokeAttributes]
*/
enum {
MONO_PINVOKE_NO_MANGLE = 0x0001,
MONO_PINVOKE_CHAR_SET_MASK = 0x0006,
MONO_PINVOKE_CHAR_SET_NOT_SPEC = 0x0000,
MONO_PINVOKE_CHAR_SET_ANSI = 0x0002,
MONO_PINVOKE_CHAR_SET_UNICODE = 0x0004,
MONO_PINVOKE_CHAR_SET_AUTO = 0x0006,
MONO_PINVOKE_BEST_FIT_ENABLED = 0x0010,
MONO_PINVOKE_BEST_FIT_DISABLED = 0x0020,
MONO_PINVOKE_BEST_FIT_MASK = 0x0030,
MONO_PINVOKE_SUPPORTS_LAST_ERROR = 0x0040,
MONO_PINVOKE_CALL_CONV_MASK = 0x0700,
MONO_PINVOKE_CALL_CONV_WINAPI = 0x0100,
MONO_PINVOKE_CALL_CONV_CDECL = 0x0200,
MONO_PINVOKE_CALL_CONV_STDCALL = 0x0300,
MONO_PINVOKE_CALL_CONV_THISCALL = 0x0400,
MONO_PINVOKE_CALL_CONV_FASTCALL = 0x0500,
MONO_PINVOKE_THROW_ON_UNMAPPABLE_ENABLED = 0x1000,
MONO_PINVOKE_THROW_ON_UNMAPPABLE_DISABLED = 0x2000,
MONO_PINVOKE_THROW_ON_UNMAPPABLE_MASK = 0x3000,
MONO_PINVOKE_CALL_CONV_GENERIC = 0x0010,
MONO_PINVOKE_CALL_CONV_GENERICINST = 0x000a
};
/*
* 23.1.9 Flags for ManifestResource
*/
enum {
MONO_MANIFEST_RESOURCE_VISIBILITY_MASK = 0x00000007,
MONO_MANIFEST_RESOURCE_PUBLIC = 0x00000001,
MONO_MANIFEST_RESOURCE_PRIVATE = 0x00000002
};
/*
* Method Attributes (23.1.10)
*/
enum {
MONO_METHOD_ATTR_ACCESS_MASK = 0x0007,
MONO_METHOD_ATTR_COMPILER_CONTROLLED = 0x0000,
MONO_METHOD_ATTR_PRIVATE = 0x0001,
MONO_METHOD_ATTR_FAM_AND_ASSEM = 0x0002,
MONO_METHOD_ATTR_ASSEM = 0x0003,
MONO_METHOD_ATTR_FAMILY = 0x0004,
MONO_METHOD_ATTR_FAM_OR_ASSEM = 0x0005,
MONO_METHOD_ATTR_PUBLIC = 0x0006,
MONO_METHOD_ATTR_STATIC = 0x0010,
MONO_METHOD_ATTR_FINAL = 0x0020,
MONO_METHOD_ATTR_VIRTUAL = 0x0040,
MONO_METHOD_ATTR_HIDE_BY_SIG = 0x0080,
MONO_METHOD_ATTR_VTABLE_LAYOUT_MASK = 0x0100,
MONO_METHOD_ATTR_REUSE_SLOT = 0x0000,
MONO_METHOD_ATTR_NEW_SLOT = 0x0100,
MONO_METHOD_ATTR_STRICT = 0x0200,
MONO_METHOD_ATTR_ABSTRACT = 0x0400,
MONO_METHOD_ATTR_SPECIAL_NAME = 0x0800,
MONO_METHOD_ATTR_PINVOKE_IMPL = 0x2000,
MONO_METHOD_ATTR_UNMANAGED_EXPORT = 0x0008,
/*
* For runtime use only
*/
MONO_METHOD_ATTR_RESERVED_MASK = 0xd000,
MONO_METHOD_ATTR_RT_SPECIAL_NAME = 0x1000,
MONO_METHOD_ATTR_HAS_SECURITY = 0x4000,
MONO_METHOD_ATTR_REQUIRE_SEC_OBJECT = 0x8000
};
/*
* Method Impl Attributes (23.1.11)
*/
enum {
MONO_METHOD_IMPL_ATTR_CODE_TYPE_MASK = 0x0003,
MONO_METHOD_IMPL_ATTR_IL = 0x0000,
MONO_METHOD_IMPL_ATTR_NATIVE = 0x0001,
MONO_METHOD_IMPL_ATTR_OPTIL = 0x0002,
MONO_METHOD_IMPL_ATTR_RUNTIME = 0x0003,
MONO_METHOD_IMPL_ATTR_MANAGED_MASK = 0x0004,
MONO_METHOD_IMPL_ATTR_UNMANAGED = 0x0004,
MONO_METHOD_IMPL_ATTR_MANAGED = 0x0000,
MONO_METHOD_IMPL_ATTR_FORWARD_REF = 0x0010,
MONO_METHOD_IMPL_ATTR_PRESERVE_SIG = 0x0080,
MONO_METHOD_IMPL_ATTR_INTERNAL_CALL = 0x1000,
MONO_METHOD_IMPL_ATTR_SYNCHRONIZED = 0x0020,
MONO_METHOD_IMPL_ATTR_NOINLINING = 0x0008,
MONO_METHOD_IMPL_ATTR_NOOPTIMIZATION = 0x0040,
MONO_METHOD_IMPL_ATTR_MAX_METHOD_IMPL_VAL = 0xffff
};
/*
* Method Semantics ([MethodSemanticAttributes]) 23.1.12,
*/
enum {
MONO_METHOD_SEMANTIC_SETTER = 0x0001,
MONO_METHOD_SEMANTIC_GETTER = 0x0002,
MONO_METHOD_SEMANTIC_OTHER = 0x0004,
MONO_METHOD_SEMANTIC_ADD_ON = 0x0008,
MONO_METHOD_SEMANTIC_REMOVE_ON = 0x0010,
MONO_METHOD_SEMANTIC_FIRE = 0x0020
};
/*
* Flags for Params (23.1.13)
*/
enum {
MONO_PARAM_ATTR_IN = 0x0001,
MONO_PARAM_ATTR_OUT = 0x0002,
MONO_PARAM_ATTR_OPTIONAL = 0x0010,
MONO_PARAM_ATTR_RESERVED_MASK = 0xf000,
MONO_PARAM_ATTR_HAS_DEFAULT = 0x1000,
MONO_PARAM_ATTR_HAS_MARSHAL = 0x2000,
MONO_PARAM_ATTR_UNUSED = 0xcfe0
};
/*
* 23.1.14 PropertyAttributes
*/
enum {
MONO_PROPERTY_ATTR_SPECIAL_NAME = 0x0200,
MONO_PROPERTY_ATTR_RESERVED_MASK = 0xf400,
MONO_PROPERTY_ATTR_RT_SPECIAL_NAME = 0x0400,
MONO_PROPERTY_ATTR_HAS_DEFAULT = 0x1000,
MONO_PROPERTY_ATTR_UNUSED = 0xe9ff
};
/*
* Type Attributes (23.1.15).
*/
enum {
MONO_TYPE_ATTR_VISIBILITY_MASK = 0x00000007,
MONO_TYPE_ATTR_NOT_PUBLIC = 0x00000000,
MONO_TYPE_ATTR_PUBLIC = 0x00000001,
MONO_TYPE_ATTR_NESTED_PUBLIC = 0x00000002,
MONO_TYPE_ATTR_NESTED_PRIVATE = 0x00000003,
MONO_TYPE_ATTR_NESTED_FAMILY = 0x00000004,
MONO_TYPE_ATTR_NESTED_ASSEMBLY = 0x00000005,
MONO_TYPE_ATTR_NESTED_FAM_AND_ASSEM = 0x00000006,
MONO_TYPE_ATTR_NESTED_FAM_OR_ASSEM = 0x00000007,
MONO_TYPE_ATTR_LAYOUT_MASK = 0x00000018,
MONO_TYPE_ATTR_AUTO_LAYOUT = 0x00000000,
MONO_TYPE_ATTR_SEQUENTIAL_LAYOUT = 0x00000008,
MONO_TYPE_ATTR_EXPLICIT_LAYOUT = 0x00000010,
MONO_TYPE_ATTR_CLASS_SEMANTIC_MASK = 0x00000020,
MONO_TYPE_ATTR_CLASS = 0x00000000,
MONO_TYPE_ATTR_INTERFACE = 0x00000020,
MONO_TYPE_ATTR_ABSTRACT = 0x00000080,
MONO_TYPE_ATTR_SEALED = 0x00000100,
MONO_TYPE_ATTR_SPECIAL_NAME = 0x00000400,
MONO_TYPE_ATTR_IMPORT = 0x00001000,
MONO_TYPE_ATTR_SERIALIZABLE = 0x00002000,
MONO_TYPE_ATTR_STRING_FORMAT_MASK = 0x00030000,
MONO_TYPE_ATTR_ANSI_CLASS = 0x00000000,
MONO_TYPE_ATTR_UNICODE_CLASS = 0x00010000,
MONO_TYPE_ATTR_AUTO_CLASS = 0x00020000,
MONO_TYPE_ATTR_CUSTOM_CLASS = 0x00030000,
MONO_TYPE_ATTR_CUSTOM_MASK = 0x00c00000,
MONO_TYPE_ATTR_BEFORE_FIELD_INIT = 0x00100000,
MONO_TYPE_ATTR_FORWARDER = 0x00200000,
MONO_TYPE_ATTR_RESERVED_MASK = 0x00040800,
MONO_TYPE_ATTR_RT_SPECIAL_NAME = 0x00000800,
MONO_TYPE_ATTR_HAS_SECURITY = 0x00040000
};
#endif
-118
View File
@@ -1,118 +0,0 @@
/**
* \file
* Definitions used to pull information out of the Blob
*
*/
#ifndef _MONO_METADATA_BLOB_H_
#define _MONO_METADATA_BLOB_H_
/*
* Encoding for type signatures used in the Metadata
*/
typedef enum {
MONO_TYPE_END = 0x00, /* End of List */
MONO_TYPE_VOID = 0x01,
MONO_TYPE_BOOLEAN = 0x02,
MONO_TYPE_CHAR = 0x03,
MONO_TYPE_I1 = 0x04,
MONO_TYPE_U1 = 0x05,
MONO_TYPE_I2 = 0x06,
MONO_TYPE_U2 = 0x07,
MONO_TYPE_I4 = 0x08,
MONO_TYPE_U4 = 0x09,
MONO_TYPE_I8 = 0x0a,
MONO_TYPE_U8 = 0x0b,
MONO_TYPE_R4 = 0x0c,
MONO_TYPE_R8 = 0x0d,
MONO_TYPE_STRING = 0x0e,
MONO_TYPE_PTR = 0x0f, /* arg: <type> token */
MONO_TYPE_BYREF = 0x10, /* arg: <type> token */
MONO_TYPE_VALUETYPE = 0x11, /* arg: <type> token */
MONO_TYPE_CLASS = 0x12, /* arg: <type> token */
MONO_TYPE_VAR = 0x13, /* number */
MONO_TYPE_ARRAY = 0x14, /* type, rank, boundsCount, bound1, loCount, lo1 */
MONO_TYPE_GENERICINST= 0x15, /* <type> <type-arg-count> <type-1> \x{2026} <type-n> */
MONO_TYPE_TYPEDBYREF = 0x16,
MONO_TYPE_I = 0x18,
MONO_TYPE_U = 0x19,
MONO_TYPE_FNPTR = 0x1b, /* arg: full method signature */
MONO_TYPE_OBJECT = 0x1c,
MONO_TYPE_SZARRAY = 0x1d, /* 0-based one-dim-array */
MONO_TYPE_MVAR = 0x1e, /* number */
MONO_TYPE_CMOD_REQD = 0x1f, /* arg: typedef or typeref token */
MONO_TYPE_CMOD_OPT = 0x20, /* optional arg: typedef or typref token */
MONO_TYPE_INTERNAL = 0x21, /* CLR internal type */
MONO_TYPE_MODIFIER = 0x40, /* Or with the following types */
MONO_TYPE_SENTINEL = 0x41, /* Sentinel for varargs method signature */
MONO_TYPE_PINNED = 0x45, /* Local var that points to pinned object */
MONO_TYPE_ENUM = 0x55 /* an enumeration */
} MonoTypeEnum;
typedef enum {
MONO_TABLE_MODULE,
MONO_TABLE_TYPEREF,
MONO_TABLE_TYPEDEF,
MONO_TABLE_FIELD_POINTER,
MONO_TABLE_FIELD,
MONO_TABLE_METHOD_POINTER,
MONO_TABLE_METHOD,
MONO_TABLE_PARAM_POINTER,
MONO_TABLE_PARAM,
MONO_TABLE_INTERFACEIMPL,
MONO_TABLE_MEMBERREF, /* 0xa */
MONO_TABLE_CONSTANT,
MONO_TABLE_CUSTOMATTRIBUTE,
MONO_TABLE_FIELDMARSHAL,
MONO_TABLE_DECLSECURITY,
MONO_TABLE_CLASSLAYOUT,
MONO_TABLE_FIELDLAYOUT, /* 0x10 */
MONO_TABLE_STANDALONESIG,
MONO_TABLE_EVENTMAP,
MONO_TABLE_EVENT_POINTER,
MONO_TABLE_EVENT,
MONO_TABLE_PROPERTYMAP,
MONO_TABLE_PROPERTY_POINTER,
MONO_TABLE_PROPERTY,
MONO_TABLE_METHODSEMANTICS,
MONO_TABLE_METHODIMPL,
MONO_TABLE_MODULEREF, /* 0x1a */
MONO_TABLE_TYPESPEC,
MONO_TABLE_IMPLMAP,
MONO_TABLE_FIELDRVA,
MONO_TABLE_UNUSED6,
MONO_TABLE_UNUSED7,
MONO_TABLE_ASSEMBLY, /* 0x20 */
MONO_TABLE_ASSEMBLYPROCESSOR,
MONO_TABLE_ASSEMBLYOS,
MONO_TABLE_ASSEMBLYREF,
MONO_TABLE_ASSEMBLYREFPROCESSOR,
MONO_TABLE_ASSEMBLYREFOS,
MONO_TABLE_FILE,
MONO_TABLE_EXPORTEDTYPE,
MONO_TABLE_MANIFESTRESOURCE,
MONO_TABLE_NESTEDCLASS,
MONO_TABLE_GENERICPARAM, /* 0x2a */
MONO_TABLE_METHODSPEC,
MONO_TABLE_GENERICPARAMCONSTRAINT,
MONO_TABLE_UNUSED8,
MONO_TABLE_UNUSED9,
MONO_TABLE_UNUSED10,
/* Portable PDB tables */
MONO_TABLE_DOCUMENT, /* 0x30 */
MONO_TABLE_METHODBODY,
MONO_TABLE_LOCALSCOPE,
MONO_TABLE_LOCALVARIABLE,
MONO_TABLE_LOCALCONSTANT,
MONO_TABLE_IMPORTSCOPE,
MONO_TABLE_STATEMACHINEMETHOD,
MONO_TABLE_CUSTOMDEBUGINFORMATION
#define MONO_TABLE_LAST MONO_TABLE_CUSTOMDEBUGINFORMATION
#define MONO_TABLE_NUM (MONO_TABLE_LAST + 1)
} MonoMetaTableEnum;
#endif
-47
View File
@@ -1,47 +0,0 @@
/**
* \file
*/
#ifndef __MONO_CALLSPEC_H__
#define __MONO_CALLSPEC_H__
#include <glib.h>
#include <mono/utils/mono-compiler.h>
typedef enum {
MONO_TRACEOP_ALL,
MONO_TRACEOP_PROGRAM,
MONO_TRACEOP_METHOD,
MONO_TRACEOP_ASSEMBLY,
MONO_TRACEOP_CLASS,
MONO_TRACEOP_NAMESPACE,
MONO_TRACEOP_EXCEPTION,
MONO_TRACEOP_WRAPPER,
} MonoTraceOpcode;
typedef struct {
MonoTraceOpcode op;
int exclude;
void *data, *data2;
} MonoTraceOperation;
typedef struct {
int len;
gboolean enabled;
MonoTraceOperation *ops;
} MonoCallSpec;
G_BEGIN_DECLS
MONO_PROFILER_API gboolean mono_callspec_parse (const char *options,
MonoCallSpec *spec,
char **errstr);
MONO_PROFILER_API void mono_callspec_cleanup (MonoCallSpec *spec);
MONO_PROFILER_API gboolean mono_callspec_eval_exception (MonoClass *klass,
MonoCallSpec *spec);
MONO_PROFILER_API gboolean mono_callspec_eval (MonoMethod *method,
const MonoCallSpec *spec);
void mono_callspec_set_assembly (MonoAssembly *assembly);
G_END_DECLS
#endif /* __MONO_CALLSPEC_H__ */
-335
View File
@@ -1,335 +0,0 @@
/**
* \file
*/
#ifndef __MONO_CIL_COFF_H__
#define __MONO_CIL_COFF_H__
#include <mono/metadata/metadata.h>
#include <glib.h>
/*
* 25.2.1: Method header type values
*/
#define METHOD_HEADER_FORMAT_MASK 3
#define METHOD_HEADER_TINY_FORMAT 2
#define METHOD_HEADER_FAT_FORMAT 3
/*
* 25.2.3.1: Flags for method headers
*/
#define METHOD_HEADER_INIT_LOCALS 0x10
#define METHOD_HEADER_MORE_SECTS 0x08
/*
* For section data (25.3)
*/
#define METHOD_HEADER_SECTION_RESERVED 0
#define METHOD_HEADER_SECTION_EHTABLE 1
#define METHOD_HEADER_SECTION_OPTIL_TABLE 2
#define METHOD_HEADER_SECTION_FAT_FORMAT 0x40
#define METHOD_HEADER_SECTION_MORE_SECTS 0x80
/* 128 bytes */
typedef struct {
char msdos_sig [2];
guint16 nlast_page;
guint16 npages;
char msdos_header [54];
guint32 pe_offset;
char msdos_header2 [64];
} MonoMSDOSHeader;
/* Possible values for coff_machine */
#define COFF_MACHINE_I386 332
#define COFF_MACHINE_IA64 512
#define COFF_MACHINE_AMD64 34404
#define COFF_MACHINE_ARM 452
/* 20 bytes */
typedef struct {
guint16 coff_machine;
guint16 coff_sections;
guint32 coff_time;
guint32 coff_symptr;
guint32 coff_symcount;
guint16 coff_opt_header_size;
guint16 coff_attributes;
} MonoCOFFHeader;
#define COFF_ATTRIBUTE_EXECUTABLE_IMAGE 0x0002
#define COFF_ATTRIBUTE_LIBRARY_IMAGE 0x2000
/* 28 bytes */
typedef struct {
guint16 pe_magic;
guchar pe_major;
guchar pe_minor;
guint32 pe_code_size;
guint32 pe_data_size;
guint32 pe_uninit_data_size;
guint32 pe_rva_entry_point;
guint32 pe_rva_code_base;
guint32 pe_rva_data_base;
} MonoPEHeader;
/* 24 bytes */
typedef struct {
guint16 pe_magic;
guchar pe_major;
guchar pe_minor;
guint32 pe_code_size;
guint32 pe_data_size;
guint32 pe_uninit_data_size;
guint32 pe_rva_entry_point;
guint32 pe_rva_code_base;
} MonoPEHeader64;
/* 68 bytes */
typedef struct {
guint32 pe_image_base; /* must be 0x400000 */
guint32 pe_section_align; /* must be 8192 */
guint32 pe_file_alignment; /* must be 512 or 4096 */
guint16 pe_os_major; /* must be 4 */
guint16 pe_os_minor; /* must be 0 */
guint16 pe_user_major;
guint16 pe_user_minor;
guint16 pe_subsys_major;
guint16 pe_subsys_minor;
guint32 pe_reserved_1;
guint32 pe_image_size;
guint32 pe_header_size;
guint32 pe_checksum;
guint16 pe_subsys_required;
guint16 pe_dll_flags;
guint32 pe_stack_reserve;
guint32 pe_stack_commit;
guint32 pe_heap_reserve;
guint32 pe_heap_commit;
guint32 pe_loader_flags;
guint32 pe_data_dir_count;
} MonoPEHeaderNT;
/* 88 bytes */
typedef struct {
guint64 pe_image_base;
guint32 pe_section_align; /* must be 8192 */
guint32 pe_file_alignment; /* must be 512 or 4096 */
guint16 pe_os_major; /* must be 4 */
guint16 pe_os_minor; /* must be 0 */
guint16 pe_user_major;
guint16 pe_user_minor;
guint16 pe_subsys_major;
guint16 pe_subsys_minor;
guint32 pe_reserved_1;
guint32 pe_image_size;
guint32 pe_header_size;
guint32 pe_checksum;
guint16 pe_subsys_required;
guint16 pe_dll_flags;
guint64 pe_stack_reserve;
guint64 pe_stack_commit;
guint64 pe_heap_reserve;
guint64 pe_heap_commit;
guint32 pe_loader_flags;
guint32 pe_data_dir_count;
} MonoPEHeaderNT64;
typedef struct {
guint32 rde_data_offset;
guint32 rde_size;
guint32 rde_codepage;
guint32 rde_reserved;
} MonoPEResourceDataEntry;
#define MONO_PE_RESOURCE_ID_CURSOR 0x01
#define MONO_PE_RESOURCE_ID_BITMAP 0x02
#define MONO_PE_RESOURCE_ID_ICON 0x03
#define MONO_PE_RESOURCE_ID_MENU 0x04
#define MONO_PE_RESOURCE_ID_DIALOG 0x05
#define MONO_PE_RESOURCE_ID_STRING 0x06
#define MONO_PE_RESOURCE_ID_FONTDIR 0x07
#define MONO_PE_RESOURCE_ID_FONT 0x08
#define MONO_PE_RESOURCE_ID_ACCEL 0x09
#define MONO_PE_RESOURCE_ID_RCDATA 0x0a
#define MONO_PE_RESOURCE_ID_MESSAGETABLE 0x0b
#define MONO_PE_RESOURCE_ID_GROUP_CURSOR 0x0c
#define MONO_PE_RESOURCE_ID_GROUP_ICON 0x0d
#define MONO_PE_RESOURCE_ID_VERSION 0x10
#define MONO_PE_RESOURCE_ID_DLGINCLUDE 0x11
#define MONO_PE_RESOURCE_ID_PLUGPLAY 0x13
#define MONO_PE_RESOURCE_ID_VXD 0x14
#define MONO_PE_RESOURCE_ID_ANICURSOR 0x15
#define MONO_PE_RESOURCE_ID_ANIICON 0x16
#define MONO_PE_RESOURCE_ID_HTML 0x17
#define MONO_PE_RESOURCE_ID_ASPNET_STRING 0x65
typedef struct {
/* If the MSB is set, then the other 31 bits store the RVA of
* the unicode string containing the name. Otherwise, the
* other 31 bits contain the ID of this entry.
*/
guint32 name;
/* If the MSB is set, then the other 31 bits store the RVA of
* another subdirectory. Otherwise, the other 31 bits store
* the RVA of the resource data entry leaf node.
*/
guint32 dir;
} MonoPEResourceDirEntry;
#define MONO_PE_RES_DIR_ENTRY_NAME_IS_STRING(d) (GUINT32_FROM_LE((d).name) >> 31)
#define MONO_PE_RES_DIR_ENTRY_NAME_OFFSET(d) (GUINT32_FROM_LE((d).name) & 0x7fffffff)
#define MONO_PE_RES_DIR_ENTRY_SET_NAME(d,i,o) ((d).name = GUINT32_TO_LE(((guint32)((i)?1:0) << 31) | ((o) & 0x7fffffff)))
#define MONO_PE_RES_DIR_ENTRY_IS_DIR(d) (GUINT32_FROM_LE((d).dir) >> 31)
#define MONO_PE_RES_DIR_ENTRY_DIR_OFFSET(d) (GUINT32_FROM_LE((d).dir) & 0x7fffffff)
#define MONO_PE_RES_DIR_ENTRY_SET_DIR(d,i,o) ((d).dir = GUINT32_TO_LE(((guint32)((i)?1:0) << 31) | ((o) & 0x7fffffff)))
typedef struct
{
guint32 res_characteristics;
guint32 res_date_stamp;
guint16 res_major;
guint16 res_minor;
guint16 res_named_entries;
guint16 res_id_entries;
/* Directory entries follow on here. The array is
* res_named_entries + res_id_entries long, containing all
* named entries first.
*/
} MonoPEResourceDir;
typedef struct {
guint32 rva;
guint32 size;
} MonoPEDirEntry;
/* 128 bytes */
typedef struct {
MonoPEDirEntry pe_export_table;
MonoPEDirEntry pe_import_table;
MonoPEDirEntry pe_resource_table;
MonoPEDirEntry pe_exception_table;
MonoPEDirEntry pe_certificate_table;
MonoPEDirEntry pe_reloc_table;
MonoPEDirEntry pe_debug;
MonoPEDirEntry pe_copyright;
MonoPEDirEntry pe_global_ptr;
MonoPEDirEntry pe_tls_table;
MonoPEDirEntry pe_load_config_table;
MonoPEDirEntry pe_bound_import;
MonoPEDirEntry pe_iat;
MonoPEDirEntry pe_delay_import_desc;
MonoPEDirEntry pe_cli_header;
MonoPEDirEntry pe_reserved;
} MonoPEDatadir;
/* 248 bytes */
typedef struct {
char pesig [4];
MonoCOFFHeader coff;
MonoPEHeader pe;
MonoPEHeaderNT nt;
MonoPEDatadir datadir;
} MonoDotNetHeader32;
/* 248 bytes */
typedef struct {
char pesig [4];
MonoCOFFHeader coff;
MonoPEHeader pe;
MonoPEHeaderNT nt;
MonoPEDatadir datadir;
} MonoDotNetHeader;
/* XX248 bytes */
typedef struct {
char pesig [4];
MonoCOFFHeader coff;
MonoPEHeader64 pe;
MonoPEHeaderNT64 nt;
MonoPEDatadir datadir;
} MonoDotNetHeader64;
#define VTFIXUP_TYPE_32BIT 0x01
#define VTFIXUP_TYPE_64BIT 0x02
#define VTFIXUP_TYPE_FROM_UNMANAGED 0x04
#define VTFIXUP_TYPE_FROM_UNMANAGED_RETAIN_APPDOMAIN 0x08
#define VTFIXUP_TYPE_CALL_MOST_DERIVED 0x10
typedef struct {
guint32 rva;
guint16 count;
guint16 type;
} MonoVTableFixup;
typedef struct {
char st_name [8];
guint32 st_virtual_size;
guint32 st_virtual_address;
guint32 st_raw_data_size;
guint32 st_raw_data_ptr;
guint32 st_reloc_ptr;
guint32 st_lineno_ptr;
guint16 st_reloc_count;
guint16 st_line_count;
#define SECT_FLAGS_HAS_CODE 0x20
#define SECT_FLAGS_HAS_INITIALIZED_DATA 0x40
#define SECT_FLAGS_HAS_UNINITIALIZED_DATA 0x80
#define SECT_FLAGS_MEM_DISCARDABLE 0x02000000
#define SECT_FLAGS_MEM_NOT_CACHED 0x04000000
#define SECT_FLAGS_MEM_NOT_PAGED 0x08000000
#define SECT_FLAGS_MEM_SHARED 0x10000000
#define SECT_FLAGS_MEM_EXECUTE 0x20000000
#define SECT_FLAGS_MEM_READ 0x40000000
#define SECT_FLAGS_MEM_WRITE 0x80000000
guint32 st_flags;
} MonoSectionTable;
typedef struct {
guint32 ch_size;
guint16 ch_runtime_major;
guint16 ch_runtime_minor;
MonoPEDirEntry ch_metadata;
#define CLI_FLAGS_ILONLY 0x01
#define CLI_FLAGS_32BITREQUIRED 0x02
#define CLI_FLAGS_STRONGNAMESIGNED 0x8
#define CLI_FLAGS_TRACKDEBUGDATA 0x00010000
#define CLI_FLAGS_PREFERRED32BIT 0x00020000
guint32 ch_flags;
guint32 ch_entry_point;
MonoPEDirEntry ch_resources;
MonoPEDirEntry ch_strong_name;
MonoPEDirEntry ch_code_manager_table;
MonoPEDirEntry ch_vtable_fixups;
MonoPEDirEntry ch_export_address_table_jumps;
/* The following are zero in the current docs */
MonoPEDirEntry ch_eeinfo_table;
MonoPEDirEntry ch_helper_table;
MonoPEDirEntry ch_dynamic_info;
MonoPEDirEntry ch_delay_load_info;
MonoPEDirEntry ch_module_image;
MonoPEDirEntry ch_external_fixups;
MonoPEDirEntry ch_ridmap;
MonoPEDirEntry ch_debug_map;
MonoPEDirEntry ch_ip_map;
} MonoCLIHeader;
/* This is not an on-disk structure */
typedef struct {
MonoDotNetHeader cli_header;
int cli_section_count;
MonoSectionTable *cli_section_tables;
void **cli_sections;
MonoCLIHeader cli_cli_header;
} MonoCLIImageInfo;
MONO_API guint32 mono_cli_rva_image_map (MonoImage *image, guint32 rva);
#endif /* __MONO_CIL_COFF_H__ */
@@ -1,23 +0,0 @@
/**
* \file Declarations of MonoClass field offset functions
* Copyright 2018 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#ifndef __MONO_METADATA_CLASS_ABI_DETAILS_H__
#define __MONO_METADATA_CLASS_ABI_DETAILS_H__
#include <mono/metadata/class-internals.h>
#include <mono/metadata/abi-details.h>
#define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) /*nothing*/
#ifdef MONO_CLASS_DEF_PRIVATE
#define MONO_CLASS_OFFSET(funcname, argtype, fieldname) intptr_t funcname (void);
#else
#define MONO_CLASS_OFFSET(funcname, argtype, fieldname) static inline intptr_t funcname (void) { return MONO_STRUCT_OFFSET (argtype, fieldname); }
#endif
#include "class-getters.h"
#undef MONO_CLASS_GETTER
#undef MONO_CLASS_OFFSET
#endif /* __MONO_METADATA_CLASS_ABI_DETAILS_H__ */
-118
View File
@@ -1,118 +0,0 @@
/*
* \file Definitions of getters for the fields of struct _MonoClass
*
* Copyright 2018 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
/* No include guards - this file is meant to be included multiple times.
* Before including the file define the following macros:
* MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname)
*
* MONO_CLASS_OFFSET(funcname, argtype, fieldname)
*/
/* Accessors for _MonoClass fields. */
MONO_CLASS_GETTER(m_class_get_element_class, MonoClass *, , MonoClass, element_class)
MONO_CLASS_GETTER(m_class_get_cast_class, MonoClass *, , MonoClass, cast_class)
MONO_CLASS_GETTER(m_class_get_supertypes, MonoClass **, , MonoClass, supertypes)
MONO_CLASS_GETTER(m_class_get_idepth, guint16, , MonoClass, idepth)
MONO_CLASS_GETTER(m_class_get_rank, guint8, , MonoClass, rank)
MONO_CLASS_GETTER(m_class_get_instance_size, int, , MonoClass, instance_size)
MONO_CLASS_GETTER(m_class_is_inited, gboolean, , MonoClass, inited)
MONO_CLASS_GETTER(m_class_is_size_inited, gboolean, , MonoClass, size_inited)
MONO_CLASS_GETTER(m_class_is_valuetype, gboolean, , MonoClass, valuetype)
MONO_CLASS_GETTER(m_class_is_enumtype, gboolean, , MonoClass, enumtype)
MONO_CLASS_GETTER(m_class_is_blittable, gboolean, , MonoClass, blittable)
MONO_CLASS_GETTER(m_class_is_unicode, gboolean, , MonoClass, unicode)
MONO_CLASS_GETTER(m_class_was_typebuilder, gboolean, , MonoClass, wastypebuilder)
MONO_CLASS_GETTER(m_class_is_array_special_interface, gboolean, , MonoClass, is_array_special_interface)
MONO_CLASS_GETTER(m_class_get_min_align, guint8, , MonoClass, min_align)
MONO_CLASS_GETTER(m_class_get_packing_size, guint, , MonoClass, packing_size)
MONO_CLASS_GETTER(m_class_is_ghcimpl, gboolean, , MonoClass, ghcimpl)
MONO_CLASS_GETTER(m_class_has_finalize, gboolean, , MonoClass, has_finalize)
#ifndef DISABLE_REMOTING
MONO_CLASS_GETTER(m_class_get_marshalbyref, guint, , MonoClass, marshalbyref)
MONO_CLASS_GETTER(m_class_get_contextbound, guint, , MonoClass, contextbound)
#endif
MONO_CLASS_GETTER(m_class_is_delegate, gboolean, , MonoClass, delegate)
MONO_CLASS_GETTER(m_class_is_gc_descr_inited, gboolean, , MonoClass, gc_descr_inited)
MONO_CLASS_GETTER(m_class_has_cctor, gboolean, , MonoClass, has_cctor)
MONO_CLASS_GETTER(m_class_has_references, gboolean, , MonoClass, has_references)
MONO_CLASS_GETTER(m_class_has_static_refs, gboolean, , MonoClass, has_static_refs)
MONO_CLASS_GETTER(m_class_has_no_special_static_fields, gboolean, , MonoClass, no_special_static_fields)
MONO_CLASS_GETTER(m_class_is_com_object, gboolean, , MonoClass, is_com_object)
MONO_CLASS_GETTER(m_class_is_nested_classes_inited, gboolean, , MonoClass, nested_classes_inited)
MONO_CLASS_GETTER(m_class_get_class_kind, guint, , MonoClass, class_kind)
MONO_CLASS_GETTER(m_class_is_interfaces_inited, gboolean, , MonoClass, interfaces_inited)
MONO_CLASS_GETTER(m_class_is_simd_type, gboolean, , MonoClass, simd_type)
MONO_CLASS_GETTER(m_class_is_has_finalize_inited, gboolean, , MonoClass, has_finalize_inited)
MONO_CLASS_GETTER(m_class_is_fields_inited, gboolean, , MonoClass, fields_inited)
MONO_CLASS_GETTER(m_class_has_failure, gboolean, , MonoClass, has_failure)
MONO_CLASS_GETTER(m_class_has_weak_fields, gboolean, , MonoClass, has_weak_fields)
MONO_CLASS_GETTER(m_class_has_dim_conflicts, gboolean, , MonoClass, has_dim_conflicts)
MONO_CLASS_GETTER(m_class_get_parent, MonoClass *, , MonoClass, parent)
MONO_CLASS_GETTER(m_class_get_nested_in, MonoClass *, , MonoClass, nested_in)
MONO_CLASS_GETTER(m_class_get_image, MonoImage *, , MonoClass, image)
MONO_CLASS_GETTER(m_class_get_name, const char *, , MonoClass, name)
MONO_CLASS_GETTER(m_class_get_name_space, const char *, , MonoClass, name_space)
MONO_CLASS_GETTER(m_class_get_type_token, guint32, , MonoClass, type_token)
MONO_CLASS_GETTER(m_class_get_vtable_size, int, , MonoClass, vtable_size)
MONO_CLASS_GETTER(m_class_get_interface_count, guint16, , MonoClass, interface_count)
MONO_CLASS_GETTER(m_class_get_interface_id, guint32, , MonoClass, interface_id)
MONO_CLASS_GETTER(m_class_get_max_interface_id, guint32, , MonoClass, max_interface_id)
MONO_CLASS_GETTER(m_class_get_interface_offsets_count, guint16, , MonoClass, interface_offsets_count)
MONO_CLASS_GETTER(m_class_get_interfaces_packed, MonoClass **, , MonoClass, interfaces_packed)
MONO_CLASS_GETTER(m_class_get_interface_offsets_packed, guint16 *, , MonoClass, interface_offsets_packed)
MONO_CLASS_GETTER(m_class_get_interface_bitmap, guint8 *, , MonoClass, interface_bitmap)
MONO_CLASS_GETTER(m_class_get_interfaces, MonoClass **, , MonoClass, interfaces)
MONO_CLASS_GETTER(m_class_get_sizes, union _MonoClassSizes, , MonoClass, sizes)
MONO_CLASS_GETTER(m_class_get_fields, MonoClassField *, , MonoClass, fields)
MONO_CLASS_GETTER(m_class_get_methods, MonoMethod **, , MonoClass, methods)
MONO_CLASS_GETTER(m_class_get_this_arg, MonoType*, &, MonoClass, this_arg)
MONO_CLASS_GETTER(m_class_get_byval_arg, MonoType*, &, MonoClass, _byval_arg)
MONO_CLASS_GETTER(m_class_get_gc_descr, MonoGCDescriptor, , MonoClass, gc_descr)
MONO_CLASS_GETTER(m_class_get_runtime_info, MonoClassRuntimeInfo *, , MonoClass, runtime_info)
MONO_CLASS_GETTER(m_class_get_vtable, MonoMethod **, , MonoClass, vtable)
MONO_CLASS_GETTER(m_class_get_infrequent_data, MonoPropertyBag*, &, MonoClass, infrequent_data)
/* Accessors for _MonoClassDef fields. */
MONO_CLASS_GETTER(m_classdef_get_klass, MonoClass*, &, MonoClassDef, klass)
MONO_CLASS_GETTER(m_classdef_get_flags, guint32, , MonoClassDef, flags)
MONO_CLASS_GETTER(m_classdef_get_first_method_idx, guint32, , MonoClassDef, first_method_idx)
MONO_CLASS_GETTER(m_classdef_get_first_field_idx, guint32, , MonoClassDef, first_field_idx)
MONO_CLASS_GETTER(m_classdef_get_method_count, guint32, , MonoClassDef, method_count)
MONO_CLASS_GETTER(m_classdef_get_field_count, guint32, , MonoClassDef, field_count)
MONO_CLASS_GETTER(m_classdef_get_next_class_cache, MonoClass **, &, MonoClassDef, next_class_cache)
/* Accessors for _MonoClassGtd fields. */
MONO_CLASS_GETTER(m_classgtd_get_klass, MonoClassDef*, &, MonoClassGtd, klass)
MONO_CLASS_GETTER(m_classgtd_get_generic_container, MonoGenericContainer*, , MonoClassGtd, generic_container)
MONO_CLASS_GETTER(m_classgtd_get_canonical_inst, MonoType*, &, MonoClassGtd, canonical_inst)
/* Accessors for _MonoClassGenericInst fields. */
MONO_CLASS_GETTER(m_classgenericinst_get_klass, MonoClass*, &, MonoClassGenericInst, klass)
MONO_CLASS_GETTER(m_classgenericinst_get_generic_class, MonoGenericClass*, , MonoClassGenericInst, generic_class)
/* Accessors for _MonoClassGenericParam fields. */
MONO_CLASS_GETTER(m_classgenericparam_get_klass, MonoClass*, &, MonoClassGenericParam, klass)
/* Accessors for _MonoClassArray fields. */
MONO_CLASS_GETTER(m_classarray_get_klass, MonoClass*, &, MonoClassArray, klass)
MONO_CLASS_GETTER(m_classarray_get_method_count, guint32, , MonoClassArray, method_count)
/* Accessors for _MonoClassPointer fields. */
MONO_CLASS_GETTER(m_classpointer_get_klass, MonoClass*, &, MonoClassPointer, klass)
MONO_CLASS_OFFSET(m_class_offsetof_interface_bitmap, MonoClass, interface_bitmap)
MONO_CLASS_OFFSET(m_class_offsetof_byval_arg, MonoClass, _byval_arg)
MONO_CLASS_OFFSET(m_class_offsetof_cast_class, MonoClass, cast_class)
MONO_CLASS_OFFSET(m_class_offsetof_element_class, MonoClass, element_class)
MONO_CLASS_OFFSET(m_class_offsetof_idepth, MonoClass, idepth)
MONO_CLASS_OFFSET(m_class_offsetof_instance_size, MonoClass, instance_size)
MONO_CLASS_OFFSET(m_class_offsetof_interface_id, MonoClass, interface_id)
MONO_CLASS_OFFSET(m_class_offsetof_max_interface_id, MonoClass, max_interface_id)
MONO_CLASS_OFFSET(m_class_offsetof_parent, MonoClass, parent)
MONO_CLASS_OFFSET(m_class_offsetof_rank, MonoClass, rank)
MONO_CLASS_OFFSET(m_class_offsetof_sizes, MonoClass, sizes)
MONO_CLASS_OFFSET(m_class_offsetof_supertypes, MonoClass, supertypes)
-92
View File
@@ -1,92 +0,0 @@
/**
* \file
* Copyright 2018 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#ifndef __MONO_METADATA_CLASS_INIT_H__
#define __MONO_METADATA_CLASS_INIT_H__
#include <glib.h>
#include <mono/metadata/metadata.h>
#include <mono/metadata/class-internals.h>
MONO_BEGIN_DECLS
void
mono_classes_init (void);
void
mono_classes_cleanup (void);
MonoClass *
mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError *error);
MonoClass*
mono_class_create_generic_inst (MonoGenericClass *gclass);
MonoClass *
mono_class_create_bounded_array (MonoClass *element_class, uint32_t rank, mono_bool bounded);
MonoClass *
mono_class_create_array (MonoClass *element_class, uint32_t rank);
MonoClass *
mono_class_create_generic_parameter (MonoGenericParam *param);
MonoClass *
mono_class_create_ptr (MonoType *type);
MonoClass *
mono_class_create_fnptr (MonoMethodSignature *sig);
void
mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int onum, GList *in_setup);
void
mono_class_init_sizes (MonoClass *klass);
void
mono_class_setup_basic_field_info (MonoClass *klass);
void
mono_class_setup_fields (MonoClass *klass);
void
mono_class_setup_methods (MonoClass *klass);
void
mono_class_setup_properties (MonoClass *klass);
void
mono_class_setup_events (MonoClass *klass);
void
mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_size, int real_size, gboolean sre);
void
mono_class_setup_interface_offsets (MonoClass *klass);
void
mono_class_setup_vtable (MonoClass *klass);
void
mono_class_setup_parent (MonoClass *klass, MonoClass *parent);
void
mono_class_setup_mono_type (MonoClass *klass);
void
mono_class_setup_has_finalizer (MonoClass *klass);
void
mono_class_setup_nested_types (MonoClass *klass);
void
mono_class_setup_runtime_info (MonoClass *klass, MonoDomain *domain, MonoVTable *vtable);
MonoClass *
mono_class_create_array_fill_type (void);
MONO_END_DECLS
#endif
-121
View File
@@ -1,121 +0,0 @@
/**
* \file
* Copyright 2016 Microsoft
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#ifndef __MONO_METADATA_CLASS_INLINES_H__
#define __MONO_METADATA_CLASS_INLINES_H__
#include <mono/metadata/class-internals.h>
#include <mono/metadata/tabledefs.h>
static inline MonoType*
mono_get_void_type (void)
{
return m_class_get_byval_arg (mono_defaults.void_class);
}
static inline MonoType*
mono_get_int32_type (void)
{
return m_class_get_byval_arg (mono_defaults.int32_class);
}
static inline MonoType*
mono_get_int_type (void)
{
return m_class_get_byval_arg (mono_defaults.int_class);
}
static inline MonoType*
mono_get_object_type (void)
{
return m_class_get_byval_arg (mono_defaults.object_class);
}
static inline gboolean
mono_class_is_def (MonoClass *klass)
{
return m_class_get_class_kind (klass) == MONO_CLASS_DEF;
}
static inline gboolean
mono_class_is_gtd (MonoClass *klass)
{
return m_class_get_class_kind (klass) == MONO_CLASS_GTD;
}
static inline gboolean
mono_class_is_ginst (MonoClass *klass)
{
return m_class_get_class_kind (klass) == MONO_CLASS_GINST;
}
static inline gboolean
mono_class_is_gparam (MonoClass *klass)
{
return m_class_get_class_kind (klass) == MONO_CLASS_GPARAM;
}
static inline gboolean
mono_class_is_array (MonoClass *klass)
{
return m_class_get_class_kind (klass) == MONO_CLASS_ARRAY;
}
static inline gboolean
mono_class_is_pointer (MonoClass *klass)
{
return m_class_get_class_kind (klass) == MONO_CLASS_POINTER;
}
static inline gboolean
mono_class_is_abstract (MonoClass *klass)
{
return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_ABSTRACT;
}
static inline gboolean
mono_class_is_interface (MonoClass *klass)
{
return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_INTERFACE;
}
static inline gboolean
mono_class_is_sealed (MonoClass *klass)
{
return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_SEALED;
}
static inline gboolean
mono_class_is_before_field_init (MonoClass *klass)
{
return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT;
}
static inline gboolean
mono_class_is_auto_layout (MonoClass *klass)
{
return (mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT;
}
static inline gboolean
mono_class_is_explicit_layout (MonoClass *klass)
{
return (mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT;
}
static inline gboolean
mono_class_is_public (MonoClass *klass)
{
return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_PUBLIC;
}
static inline gboolean
mono_class_has_static_metadata (MonoClass *klass)
{
return m_class_get_type_token (klass) && !m_class_get_image (klass)->dynamic && !mono_class_is_ginst (klass);
}
#endif
File diff suppressed because it is too large Load Diff
@@ -1,170 +0,0 @@
/**
* \file Definitions of struct _MonoClass members
*
* NOTE: This file should NOT be included directly.
*/
#if defined(MONO_CLASS_DEF_PRIVATE) && !defined(REALLY_INCLUDE_CLASS_DEF)
#error struct _MonoClass definition should not be accessed directly
#endif
#ifndef __MONO_METADATA_CLASS_PRIVATE_DEFINITION_H__
#define __MONO_METADATA_CLASS_PRIVATE_DEFINITION_H__
struct _MonoClass {
/* element class for arrays and enum basetype for enums */
MonoClass *element_class;
/* used for subtype checks */
MonoClass *cast_class;
/* for fast subtype checks */
MonoClass **supertypes;
guint16 idepth;
/* array dimension */
guint8 rank;
int instance_size; /* object instance size */
guint inited : 1;
/* A class contains static and non static data. Static data can be
* of the same type as the class itselfs, but it does not influence
* the instance size of the class. To avoid cyclic calls to
* mono_class_init (from mono_class_instance_size ()) we first
* initialise all non static fields. After that we set size_inited
* to 1, because we know the instance size now. After that we
* initialise all static fields.
*/
/* ALL BITFIELDS SHOULD BE WRITTEN WHILE HOLDING THE LOADER LOCK */
guint size_inited : 1;
guint valuetype : 1; /* derives from System.ValueType */
guint enumtype : 1; /* derives from System.Enum */
guint blittable : 1; /* class is blittable */
guint unicode : 1; /* class uses unicode char when marshalled */
guint wastypebuilder : 1; /* class was created at runtime from a TypeBuilder */
guint is_array_special_interface : 1; /* gtd or ginst of once of the magic interfaces that arrays implement */
/* next byte */
guint8 min_align;
/* next byte */
guint packing_size : 4;
guint ghcimpl : 1; /* class has its own GetHashCode impl */
guint has_finalize : 1; /* class has its own Finalize impl */
#ifndef DISABLE_REMOTING
guint marshalbyref : 1; /* class is a MarshalByRefObject */
guint contextbound : 1; /* class is a ContextBoundObject */
#endif
/* next byte */
guint delegate : 1; /* class is a Delegate */
guint gc_descr_inited : 1; /* gc_descr is initialized */
guint has_cctor : 1; /* class has a cctor */
guint has_references : 1; /* it has GC-tracked references in the instance */
guint has_static_refs : 1; /* it has static fields that are GC-tracked */
guint no_special_static_fields : 1; /* has no thread/context static fields */
/* directly or indirectly derives from ComImport attributed class.
* this means we need to create a proxy for instances of this class
* for COM Interop. set this flag on loading so all we need is a quick check
* during object creation rather than having to traverse supertypes
*/
guint is_com_object : 1;
guint nested_classes_inited : 1; /* Whenever nested_class is initialized */
/* next byte*/
guint class_kind : 3; /* One of the values from MonoTypeKind */
guint interfaces_inited : 1; /* interfaces is initialized */
guint simd_type : 1; /* class is a simd intrinsic type */
guint has_finalize_inited : 1; /* has_finalize is initialized */
guint fields_inited : 1; /* setup_fields () has finished */
guint has_failure : 1; /* See mono_class_get_exception_data () for a MonoErrorBoxed with the details */
guint has_weak_fields : 1; /* class has weak reference fields */
guint has_dim_conflicts : 1; /* Class has conflicting default interface methods */
MonoClass *parent;
MonoClass *nested_in;
MonoImage *image;
const char *name;
const char *name_space;
guint32 type_token;
int vtable_size; /* number of slots */
guint16 interface_count;
guint32 interface_id; /* unique inderface id (for interfaces) */
guint32 max_interface_id;
guint16 interface_offsets_count;
MonoClass **interfaces_packed;
guint16 *interface_offsets_packed;
guint8 *interface_bitmap;
MonoClass **interfaces;
union _MonoClassSizes sizes;
/*
* Field information: Type and location from object base
*/
MonoClassField *fields;
MonoMethod **methods;
/* used as the type of the this argument and when passing the arg by value */
MonoType this_arg;
MonoType _byval_arg;
MonoGCDescriptor gc_descr;
MonoClassRuntimeInfo *runtime_info;
/* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
MonoMethod **vtable;
/* Infrequently used items. See class-accessors.c: InfrequentDataKind for what goes into here. */
MonoPropertyBag infrequent_data;
};
struct _MonoClassDef {
MonoClass klass;
guint32 flags;
/*
* From the TypeDef table
*/
guint32 first_method_idx;
guint32 first_field_idx;
guint32 method_count, field_count;
/* next element in the class_cache hash list (in MonoImage) */
MonoClass *next_class_cache;
};
struct _MonoClassGtd {
MonoClassDef klass;
MonoGenericContainer *generic_container;
/* The canonical GENERICINST where we instantiate a generic type definition with its own generic parameters.*/
/* Suppose we have class T`2<A,B> {...}. canonical_inst is the GTD T`2 applied to A and B. */
MonoType canonical_inst;
};
struct _MonoClassGenericInst {
MonoClass klass;
MonoGenericClass *generic_class;
};
struct _MonoClassGenericParam {
MonoClass klass;
};
struct _MonoClassArray {
MonoClass klass;
guint32 method_count;
};
struct _MonoClassPointer {
MonoClass klass;
};
#endif
-301
View File
@@ -1,301 +0,0 @@
/**
* \file
*/
#ifndef _MONO_CLI_CLASS_H_
#define _MONO_CLI_CLASS_H_
#include <mono/metadata/metadata.h>
#include <mono/metadata/image.h>
#include <mono/metadata/loader.h>
#include <mono/utils/mono-error.h>
MONO_BEGIN_DECLS
typedef struct MonoVTable MonoVTable;
typedef struct _MonoClassField MonoClassField;
typedef struct _MonoProperty MonoProperty;
typedef struct _MonoEvent MonoEvent;
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClass *
mono_class_get (MonoImage *image, uint32_t type_token);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClass *
mono_class_get_full (MonoImage *image, uint32_t type_token, MonoGenericContext *context);
MONO_API mono_bool
mono_class_init (MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoVTable *
mono_class_vtable (MonoDomain *domain, MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
mono_class_from_name (MonoImage *image, const char* name_space, const char *name);
MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
mono_class_from_name_case (MonoImage *image, const char* name_space, const char *name);
MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
mono_class_get_method_from_name_flags (MonoClass *klass, const char *name, int param_count, int flags);
MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
mono_class_from_typeref (MonoImage *image, uint32_t type_token);
MONO_API MonoClass *
mono_class_from_typeref_checked (MonoImage *image, uint32_t type_token, MonoError *error);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClass *
mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *image, mono_bool is_mvar);
MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
mono_class_inflate_generic_type (MonoType *type, MonoGenericContext *context) /* MONO_DEPRECATED */;
MONO_API MONO_RT_EXTERNAL_ONLY
MonoMethod*
mono_class_inflate_generic_method (MonoMethod *method, MonoGenericContext *context);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoMethod *
mono_get_inflated_method (MonoMethod *method);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClassField*
mono_field_from_token (MonoImage *image, uint32_t token, MonoClass **retklass, MonoGenericContext *context);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClass *
mono_bounded_array_class_get (MonoClass *element_class, uint32_t rank, mono_bool bounded);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClass *
mono_array_class_get (MonoClass *element_class, uint32_t rank);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClass *
mono_ptr_class_get (MonoType *type);
MONO_API MonoClassField *
mono_class_get_field (MonoClass *klass, uint32_t field_token);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClassField *
mono_class_get_field_from_name (MonoClass *klass, const char *name);
MONO_API uint32_t
mono_class_get_field_token (MonoClassField *field);
MONO_API uint32_t
mono_class_get_event_token (MonoEvent *event);
MONO_API MonoProperty*
mono_class_get_property_from_name (MonoClass *klass, const char *name);
MONO_API uint32_t
mono_class_get_property_token (MonoProperty *prop);
MONO_API int32_t
mono_array_element_size (MonoClass *ac);
MONO_API int32_t
mono_class_instance_size (MonoClass *klass);
MONO_API int32_t
mono_class_array_element_size (MonoClass *klass);
MONO_API int32_t
mono_class_data_size (MonoClass *klass);
MONO_API int32_t
mono_class_value_size (MonoClass *klass, uint32_t *align);
MONO_API int32_t
mono_class_min_align (MonoClass *klass);
MONO_API MonoClass *
mono_class_from_mono_type (MonoType *type);
MONO_API mono_bool
mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc,
mono_bool check_interfaces);
MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass);
// Checks if type or any of the subtypes (generic arguments, etc.) comes from the given assembly
MONO_API mono_bool
mono_class_is_from_assembly(MonoClass *klass, MonoAssembly *assembly);
MONO_API MONO_RT_EXTERNAL_ONLY
void*
mono_ldtoken (MonoImage *image, uint32_t token, MonoClass **retclass, MonoGenericContext *context);
MONO_API char*
mono_type_get_name (MonoType *type);
MONO_API MonoType*
mono_type_get_underlying_type (MonoType *type);
/* MonoClass accessors */
MONO_API MonoImage*
mono_class_get_image (MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClass*
mono_class_get_element_class (MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY
mono_bool
mono_class_is_valuetype (MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY
mono_bool
mono_class_is_enum (MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
mono_class_enum_basetype (MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClass*
mono_class_get_parent (MonoClass *klass);
MONO_API MonoClass*
mono_class_get_nesting_type (MonoClass *klass);
MONO_API int
mono_class_get_rank (MonoClass *klass);
MONO_API uint32_t
mono_class_get_flags (MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY
const char*
mono_class_get_name (MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY
const char*
mono_class_get_namespace (MonoClass *klass);
MONO_API MonoType*
mono_class_get_type (MonoClass *klass);
MONO_API uint32_t
mono_class_get_type_token (MonoClass *klass);
MONO_API MonoType*
mono_class_get_byref_type (MonoClass *klass);
MONO_API int
mono_class_num_fields (MonoClass *klass);
MONO_API int
mono_class_num_methods (MonoClass *klass);
MONO_API int
mono_class_num_properties (MonoClass *klass);
MONO_API int
mono_class_num_events (MonoClass *klass);
MONO_API MONO_RT_EXTERNAL_ONLY
MonoClassField*
mono_class_get_fields (MonoClass* klass, void **iter);
MONO_API MonoMethod*
mono_class_get_methods (MonoClass* klass, void **iter);
MONO_API MonoProperty*
mono_class_get_properties (MonoClass* klass, void **iter);
MONO_API MonoEvent*
mono_class_get_events (MonoClass* klass, void **iter);
MONO_API MonoClass*
mono_class_get_interfaces (MonoClass* klass, void **iter);
MONO_API MonoClass*
mono_class_get_nested_types (MonoClass* klass, void **iter);
MONO_API MONO_RT_EXTERNAL_ONLY
mono_bool
mono_class_is_delegate (MonoClass* klass);
MONO_API mono_bool
mono_class_implements_interface (MonoClass* klass, MonoClass* iface);
/* MonoClassField accessors */
MONO_API const char*
mono_field_get_name (MonoClassField *field);
MONO_API MonoType*
mono_field_get_type (MonoClassField *field);
MONO_API MonoClass*
mono_field_get_parent (MonoClassField *field);
MONO_API uint32_t
mono_field_get_flags (MonoClassField *field);
MONO_API uint32_t
mono_field_get_offset (MonoClassField *field);
MONO_API const char *
mono_field_get_data (MonoClassField *field);
/* MonoProperty acessors */
MONO_API const char*
mono_property_get_name (MonoProperty *prop);
MONO_API MonoMethod*
mono_property_get_set_method (MonoProperty *prop);
MONO_API MonoMethod*
mono_property_get_get_method (MonoProperty *prop);
MONO_API MonoClass*
mono_property_get_parent (MonoProperty *prop);
MONO_API uint32_t
mono_property_get_flags (MonoProperty *prop);
/* MonoEvent accessors */
MONO_API const char*
mono_event_get_name (MonoEvent *event);
MONO_API MonoMethod*
mono_event_get_add_method (MonoEvent *event);
MONO_API MonoMethod*
mono_event_get_remove_method (MonoEvent *event);
MONO_API MonoMethod*
mono_event_get_remove_method (MonoEvent *event);
MONO_API MonoMethod*
mono_event_get_raise_method (MonoEvent *event);
MONO_API MonoClass*
mono_event_get_parent (MonoEvent *event);
MONO_API uint32_t
mono_event_get_flags (MonoEvent *event);
MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
mono_class_get_method_from_name (MonoClass *klass, const char *name, int param_count);
MONO_API char *
mono_class_name_from_token (MonoImage *image, uint32_t type_token);
MONO_API mono_bool
mono_method_can_access_field (MonoMethod *method, MonoClassField *field);
MONO_API mono_bool
mono_method_can_access_method (MonoMethod *method, MonoMethod *called);
MONO_END_DECLS
#endif /* _MONO_CLI_CLASS_H_ */

Some files were not shown because too many files have changed in this diff Show More