Compare commits

...

8 Commits

12 changed files with 127 additions and 51 deletions
+9 -9
View File
@@ -2,28 +2,28 @@
"versions": [
{
"unity_version":"2019",
"hybridclr" : { "branch":"v7.0.0"},
"hybridclr" : { "branch":"v7.2.0"},
"il2cpp_plus": { "branch":"v2019-7.0.0"}
},
{
"unity_version":"2020",
"hybridclr" : { "branch":"v7.0.0"},
"hybridclr" : { "branch":"v7.2.0"},
"il2cpp_plus": { "branch":"v2020-7.0.0"}
},
{
"unity_version":"2021",
"hybridclr" : { "branch":"v7.0.0"},
"hybridclr" : { "branch":"v7.2.0"},
"il2cpp_plus": { "branch":"v2021-7.0.0"}
},
{
"unity_version":"2022",
"hybridclr" : { "branch":"v7.0.0"},
"il2cpp_plus": { "branch":"v2022-7.0.0"}
"hybridclr" : { "branch":"v7.2.0"},
"il2cpp_plus": { "branch":"v2022-7.2.0"}
},
{
"unity_version":"2022-tuanjie",
"hybridclr" : { "branch":"v7.0.0"},
"il2cpp_plus": { "branch":"v2022-tuanjie-7.0.0"}
"hybridclr" : { "branch":"v7.2.0"},
"il2cpp_plus": { "branch":"v2022-tuanjie-7.1.0"}
},
{
"unity_version":"2023",
@@ -32,8 +32,8 @@
},
{
"unity_version":"6000",
"hybridclr" : { "branch":"v7.0.0"},
"il2cpp_plus": { "branch":"v6000-7.0.0"}
"hybridclr" : { "branch":"v7.2.0"},
"il2cpp_plus": { "branch":"v6000-7.2.0"}
}
]
}
@@ -35,8 +35,14 @@ namespace HybridCLR.Editor.BuildProcessors
return $"{projectDir}/Library/Bee/artifacts/WinPlayerBuildProgram/ManagedStripped";
case BuildTarget.StandaloneLinux64:
return $"{projectDir}/Library/Bee/artifacts/LinuxPlayerBuildProgram/ManagedStripped";
case BuildTarget.WSAPlayer:
return $"{projectDir}/Library/Bee/artifacts/UWPPlayerBuildProgram/ManagedStripped";
case BuildTarget.Android:
return $"{projectDir}/Library/Bee/artifacts/Android/ManagedStripped";
#if TUANJIE_2022_3_OR_NEWER
case BuildTarget.HMIAndroid:
return $"{projectDir}/Library/Bee/artifacts/HMIAndroid/ManagedStripped";
#endif
case BuildTarget.iOS:
#if UNITY_TVOS
case BuildTarget.tvOS:
@@ -75,7 +81,6 @@ namespace HybridCLR.Editor.BuildProcessors
public void OnBeforeConvertRun(BuildReport report, Il2CppBuildPipelineData data)
{
// 此回调只在 2020中调用
BuildTarget target = report.summary.platform;
CopyStripDlls(GetStripAssembliesDir2020(target), target);
}
-3
View File
@@ -6,9 +6,6 @@ using UnityEditorInternal;
namespace HybridCLR.Editor.Settings
{
/// <summary>
/// 监听编辑器状态,当编辑器重新 focus 时,重新加载实例,避免某些情景下 svn 、git 等外部修改了数据却无法同步的异常。
/// </summary>
[InitializeOnLoad]
public static class EditorStatusWatcher
{
@@ -123,7 +123,6 @@ namespace HybridCLR.Editor.Settings
{
using (CreateSettingsWindowGUIScope())
{
//解决编辑器打包时出现的 _serializedObject.targetObject 意外销毁的情况
if (_serializedObject == null||!_serializedObject.targetObject)
{
InitGUI();
+17 -17
View File
@@ -6,55 +6,55 @@ namespace HybridCLR.Editor.Settings
[FilePath("ProjectSettings/HybridCLRSettings.asset")]
public class HybridCLRSettings : ScriptableSingleton<HybridCLRSettings>
{
[Header("开启HybridCLR插件")]
[Tooltip("enable HybridCLR")]
public bool enable = true;
[Header("使用全局安装的il2cpp")]
[Tooltip("use il2cpp in unity editor installation location")]
public bool useGlobalIl2cpp;
[Header("hybridclr 仓库 URL")]
[Tooltip("hybridclr repo URL")]
public string hybridclrRepoURL = "https://gitee.com/focus-creative-games/hybridclr";
[Header("il2cpp_plus 仓库 URL")]
[Tooltip("il2cpp_plus repo URL")]
public string il2cppPlusRepoURL = "https://gitee.com/focus-creative-games/il2cpp_plus";
[Header("热更新Assembly Definitions")]
[Tooltip("hot update assembly definitions(asd)")]
public AssemblyDefinitionAsset[] hotUpdateAssemblyDefinitions;
[Header("热更新dlls")]
[Tooltip("hot update assembly names(without .dll suffix)")]
public string[] hotUpdateAssemblies;
[Header("预留的热更新dlls")]
[Tooltip("preserved hot update assembly names(without .dll suffix)")]
public string[] preserveHotUpdateAssemblies;
[Header("热更新dll编译输出根目录")]
[Tooltip("output directory of compiling hot update assemblies")]
public string hotUpdateDllCompileOutputRootDir = "HybridCLRData/HotUpdateDlls";
[Header("外部热更新dll搜索路径")]
[Tooltip("searching paths of external hot update assemblies")]
public string[] externalHotUpdateAssembliyDirs;
[Header("裁减后AOT dll输出根目录")]
[Tooltip("output directory of stripped AOT assemblies")]
public string strippedAOTDllOutputRootDir = "HybridCLRData/AssembliesPostIl2CppStrip";
[Header("补充元数据AOT dlls")]
[Tooltip("supplementary metadata assembly names(without .dll suffix)")]
public string[] patchAOTAssemblies;
[Header("生成的link.xml路径")]
[Tooltip("output file of automatic generated link.xml by scanning hot update assemblies")]
public string outputLinkFile = "HybridCLRGenerate/link.xml";
[Header("自动扫描生成的AOTGenericReferences.cs路径")]
[Tooltip("output file of automatic generated AOTGenericReferences.cs")]
public string outputAOTGenericReferenceFile = "HybridCLRGenerate/AOTGenericReferences.cs";
[Header("AOT泛型实例化搜索迭代次数")]
[Tooltip("max iteration count of searching generic methods in hot update assemblies")]
public int maxGenericReferenceIteration = 10;
[Header("MethodBridge泛型搜索迭代次数")]
[Tooltip("max iteration count of searching method bridge generic methods in AOT assemblies")]
public int maxMethodBridgeGenericIteration = 10;
[Header("Release发布模式下也开启Profiler支持")]
[Tooltip("enable profiler support when publishing in release mode")]
public bool enableProfilerInReleaseBuild = false;
[Header("WebGL平台Release发布模式下也开启StraceTrace支持")]
[Tooltip("enable StraceTrace support when publishing to the WebGL platform in release mode")]
public bool enableStraceTraceInWebGLReleaseBuild = false;
}
}
-3
View File
@@ -65,9 +65,6 @@ namespace HybridCLR.Editor
public string name;
}
/// <summary>
/// 热更新dll列表。不包含 preserveHotUpdateAssemblies。
/// </summary>
public static List<string> HotUpdateAssemblyNamesExcludePreserved
{
get
+35
View File
@@ -1,5 +1,40 @@
# ReleaseLog
## 7.2.0
Release Date: 2024-12-9.
### Runtime
- [fix] fix a critical bug in Image::ReadArrayType, where it incorrectly uses alloca to allocate Il2CppArray's sizes and lobounds data.
- [merge] merge il2cpp changes from 2022.3.51f1 to 2022.3.54f1
- [merge] merge il2cpp changes from 6000.0.21 to 6000.0.30
## 7.1.0
Release Date: 2024-12-4.
### Runtime
- [new] support prejit interpreter class and method
- [new] add RuntimeOptionId::MaxInlineableMethodBodySize
- [merge] merge il2cpp changes from tuanjie v1.3.1 to v1.3.4
- [fix] fix memory leak of TransformContext::irbbs and ir2offsetMap
- [opt] does not insert CheckThrowIfNull check when inlining constructors
- [opt] remove unnecessary typeSize calculation from the NewValueTypeInterpVar instruction.
- [change] change default maxInlineableMethodBodySize from 16 to 32
- [change] remove the unnecessary Inflate operation on arg.type when initializing ArgVarInfo in TransformContext::TransformBodyImpl.
- [change] remove unnecessary fields genericContext, klassContainer, methodContainer from the TransformContext
### Editor
- [new] support prejit interpreter class and method
- [new] add RuntimeOptionId::MaxInlineableMethodBodySize
- [fix] fix the bug that CopyStrippedAOTAssemblies didn't work on UWP platform of 6000.0.x
- [fix] fix the issue that CopyStrippedAOTAssemblies didn't support HMIAndroid in tuanjie engine
- [change] change the attributes on fields of HybridCLRSettings from `[Header]` to `[ToolTip]`
- [refactor] refactor code comments and translate them to English
## 7.0.0
Release Date: 2024-11-15.
+2 -2
View File
@@ -3,8 +3,8 @@ namespace HybridCLR
{
public enum HomologousImageMode
{
Consistent, // AOT dll需要跟主工程精确一致,即为裁剪后的AO dll
SuperSet, // AOT dll不需要跟主工程精确一致,但必须包含裁剪后的AOT dll的所有元数据,即为裁剪后dll的超集。推荐使用原始aot dll
Consistent,
SuperSet,
}
}
+8 -8
View File
@@ -4,13 +4,13 @@ namespace HybridCLR
public enum LoadImageErrorCode
{
OK = 0,
BAD_IMAGE, // dll 不合法
NOT_IMPLEMENT, // 不支持的元数据特性
AOT_ASSEMBLY_NOT_FIND, // 对应的AOT assembly未找到
HOMOLOGOUS_ONLY_SUPPORT_AOT_ASSEMBLY, // 不能给解释器assembly补充元数据
HOMOLOGOUS_ASSEMBLY_HAS_LOADED, // 已经补充过了,不能再次补充
INVALID_HOMOLOGOUS_MODE, // 非法HomologousImageMode
PDB_BAD_FILE, // pdb文件不合法
};
BAD_IMAGE, // invalid dll file
NOT_IMPLEMENT, // not implement feature
AOT_ASSEMBLY_NOT_FIND, // AOT assembly not found
HOMOLOGOUS_ONLY_SUPPORT_AOT_ASSEMBLY, // can not load supplementary metadata assembly for non-AOT assembly
HOMOLOGOUS_ASSEMBLY_HAS_LOADED, // can not load supplementary metadata assembly for the same assembly
INVALID_HOMOLOGOUS_MODE, // invalid homologous image mode
PDB_BAD_FILE, // invalid pdb file
};
}
+48 -6
View File
@@ -6,6 +6,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine.Scripting;
namespace HybridCLR
@@ -14,7 +15,7 @@ namespace HybridCLR
public static class RuntimeApi
{
/// <summary>
/// 加载补充元数据assembly
/// load supplementary metadata assembly
/// </summary>
/// <param name="dllBytes"></param>
/// <returns></returns>
@@ -30,7 +31,38 @@ namespace HybridCLR
#endif
/// <summary>
/// 获取解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小)
/// prejit method to avoid the jit cost of first time running
/// </summary>
/// <param name="method"></param>
/// <returns>return true if method is jited, return false if method can't be jited </returns>
///
#if UNITY_EDITOR
public static bool PreJitMethod(MethodInfo method)
{
return false;
}
#else
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern bool PreJitMethod(MethodInfo method);
#endif
/// <summary>
/// prejit all methods of class to avoid the jit cost of first time running
/// </summary>
/// <param name="type"></param>
/// <returns>return true if class is jited, return false if class can't be jited </returns>
#if UNITY_EDITOR
public static bool PreJitClass(Type type)
{
return false;
}
#else
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern bool PreJitClass(Type type);
#endif
/// <summary>
/// get the maximum number of StackObjects in the interpreter thread stack (size*8 represents the final memory size occupied
/// </summary>
/// <returns></returns>
public static int GetInterpreterThreadObjectStackSize()
@@ -39,17 +71,17 @@ namespace HybridCLR
}
/// <summary>
/// 设置解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小)
/// set the maximum number of StackObjects for the interpreter thread stack (size*8 represents the final memory size occupied)
/// </summary>
/// <param name="size"></param>
public static void SetInterpreterThreadObjectStackSize(int size)
{
SetRuntimeOption(RuntimeOptionId.InterpreterThreadObjectStackSize, size);
}
/// <summary>
/// 获取解释器线程函数帧数量(sizeof(InterpreterFrame)*size 为最终占用的内存大小)
/// get the number of interpreter thread function frames (sizeof(InterpreterFrame)*size represents the final memory size occupied)
/// </summary>
/// <returns></returns>
public static int GetInterpreterThreadFrameStackSize()
@@ -58,7 +90,7 @@ namespace HybridCLR
}
/// <summary>
/// 设置解释器线程函数帧数量(sizeof(InterpreterFrame)*size 为最终占用的内存大小)
/// set the number of interpreter thread function frames (sizeof(InterpreterFrame)*size represents the final memory size occupied)
/// </summary>
/// <param name="size"></param>
public static void SetInterpreterThreadFrameStackSize(int size)
@@ -71,6 +103,11 @@ namespace HybridCLR
private static readonly Dictionary<RuntimeOptionId, int> s_runtimeOptions = new Dictionary<RuntimeOptionId, int>();
/// <summary>
/// set runtime option value
/// </summary>
/// <param name="optionId"></param>
/// <param name="value"></param>
public static void SetRuntimeOption(RuntimeOptionId optionId, int value)
{
s_runtimeOptions[optionId] = value;
@@ -80,6 +117,11 @@ namespace HybridCLR
public static extern void SetRuntimeOption(RuntimeOptionId optionId, int value);
#endif
/// <summary>
/// get runtime option value
/// </summary>
/// <param name="optionId"></param>
/// <returns></returns>
#if UNITY_EDITOR
public static int GetRuntimeOption(RuntimeOptionId optionId)
{
+1
View File
@@ -7,5 +7,6 @@
ThreadExceptionFlowSize = 3,
MaxMethodBodyCacheSize = 4,
MaxMethodInlineDepth = 5,
MaxInlineableMethodBodySize = 6,
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "com.code-philosophy.hybridclr",
"version": "7.0.0",
"version": "7.2.0",
"displayName": "HybridCLR",
"description": "HybridCLR is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotupdate.",
"category": "Runtime",