Compare commits
No commits in common. "3705ca6e1fd51256e23387fecbfb65b5783354a0" and "e086228d90df02901abd543b878f08285ec78e93" have entirely different histories.
3705ca6e1f
...
e086228d90
|
@ -2,28 +2,28 @@
|
||||||
"versions": [
|
"versions": [
|
||||||
{
|
{
|
||||||
"unity_version":"2019",
|
"unity_version":"2019",
|
||||||
"hybridclr" : { "branch":"v6.6.0"},
|
"hybridclr" : { "branch":"v6.2.0"},
|
||||||
"il2cpp_plus": { "branch":"v2019-6.6.0"}
|
"il2cpp_plus": { "branch":"v2019-6.1.0"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unity_version":"2020",
|
"unity_version":"2020",
|
||||||
"hybridclr" : { "branch":"v6.6.0"},
|
"hybridclr" : { "branch":"v6.2.0"},
|
||||||
"il2cpp_plus": { "branch":"v2020-6.6.0"}
|
"il2cpp_plus": { "branch":"v2020-6.1.0"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unity_version":"2021",
|
"unity_version":"2021",
|
||||||
"hybridclr" : { "branch":"v6.6.0"},
|
"hybridclr" : { "branch":"v6.2.0"},
|
||||||
"il2cpp_plus": { "branch":"v2021-6.6.0"}
|
"il2cpp_plus": { "branch":"v2021-6.2.0"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unity_version":"2022",
|
"unity_version":"2022",
|
||||||
"hybridclr" : { "branch":"v6.6.0"},
|
"hybridclr" : { "branch":"v6.2.0"},
|
||||||
"il2cpp_plus": { "branch":"v2022-6.6.0"}
|
"il2cpp_plus": { "branch":"v2022-6.1.0"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unity_version":"2022-tuanjie",
|
"unity_version":"2022-tuanjie",
|
||||||
"hybridclr" : { "branch":"v6.6.0"},
|
"hybridclr" : { "branch":"v6.2.0"},
|
||||||
"il2cpp_plus": { "branch":"v2022-tuanjie-6.6.0"}
|
"il2cpp_plus": { "branch":"v2022-tuanjie-6.1.0"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unity_version":"2023",
|
"unity_version":"2023",
|
||||||
|
@ -32,8 +32,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unity_version":"6000",
|
"unity_version":"6000",
|
||||||
"hybridclr" : { "branch":"v6.6.0"},
|
"hybridclr" : { "branch":"v6.2.0"},
|
||||||
"il2cpp_plus": { "branch":"v6000-6.6.0"}
|
"il2cpp_plus": { "branch":"v6000-6.1.0"}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -35,31 +35,18 @@ namespace HybridCLR.MonoHook
|
||||||
|
|
||||||
private static string BuildMainWindowTitle()
|
private static string BuildMainWindowTitle()
|
||||||
{
|
{
|
||||||
var cacheDir = $"{Application.dataPath}/../Library/PlayerDataCache";
|
#if UNITY_WEIXINMINIGAME
|
||||||
if (Directory.Exists(cacheDir))
|
|
||||||
{
|
|
||||||
foreach (var tempJsonPath in Directory.GetDirectories(cacheDir, "*", SearchOption.TopDirectoryOnly))
|
|
||||||
{
|
|
||||||
string dirName = Path.GetFileName(tempJsonPath);
|
|
||||||
#if UNITY_WEIXINMINIGAME
|
|
||||||
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame);
|
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame);
|
||||||
if (!dirName.Contains("WeixinMiniGame"))
|
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WeixinMiniGame/Data/ScriptingAssemblies.json";
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebGL);
|
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebGL);
|
||||||
if (!dirName.Contains("WebGL"))
|
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WebGL/Data/ScriptingAssemblies.json";
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
if (File.Exists(tempJsonPath))
|
||||||
|
{
|
||||||
var patcher = new PatchScriptingAssemblyList();
|
var patcher = new PatchScriptingAssemblyList();
|
||||||
patcher.PathScriptingAssembilesFile(tempJsonPath);
|
patcher.PathScriptingAssembilesFile(Path.GetDirectoryName(tempJsonPath));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
string newTitle = BuildMainWindowTitleProxy();
|
string newTitle = BuildMainWindowTitleProxy();
|
||||||
return newTitle;
|
return newTitle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ using HybridCLR.Editor.Installer;
|
||||||
using HybridCLR.Editor.Settings;
|
using HybridCLR.Editor.Settings;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Build;
|
using UnityEditor.Build;
|
||||||
using UnityEditor.Callbacks;
|
using UnityEditor.Callbacks;
|
||||||
|
@ -25,31 +24,6 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||||
CopyLibil2cppToXcodeProj(pathToBuiltProject);
|
CopyLibil2cppToXcodeProj(pathToBuiltProject);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string TryRemoveDunplicateShellScriptSegment(string pbxprojFile, string pbxprojContent)
|
|
||||||
{
|
|
||||||
// will appear duplicated Shell Script segment when append to existed xcode project.
|
|
||||||
// This is unity bug.
|
|
||||||
// we remove duplicated Shell Script to avoid build error.
|
|
||||||
string copyFileComment = @"/\* CopyFiles \*/,\s+([A-Z0-9]{24}) /\* ShellScript \*/,\s+([A-Z0-9]{24}) /\* ShellScript \*/,";
|
|
||||||
var m = Regex.Match(pbxprojContent, copyFileComment, RegexOptions.Multiline);
|
|
||||||
if (!m.Success)
|
|
||||||
{
|
|
||||||
return pbxprojContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m.Groups[1].Value != m.Groups[2].Value)
|
|
||||||
{
|
|
||||||
throw new BuildFailedException($"find invalid /* ShellScript */ segment");
|
|
||||||
}
|
|
||||||
|
|
||||||
int startIndexOfDupShellScript = m.Groups[2].Index;
|
|
||||||
int endIndexOfDupShellScript = pbxprojContent.IndexOf(",", startIndexOfDupShellScript);
|
|
||||||
|
|
||||||
pbxprojContent = pbxprojContent.Remove(startIndexOfDupShellScript, endIndexOfDupShellScript + 1 - startIndexOfDupShellScript);
|
|
||||||
Debug.LogWarning($"[AddLil2cppSourceCodeToXcodeproj] remove duplicated '/* ShellScript */' from file '{pbxprojFile}'");
|
|
||||||
return pbxprojContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void RemoveExternalLibil2cppOption(string pbxprojFile)
|
private static void RemoveExternalLibil2cppOption(string pbxprojFile)
|
||||||
{
|
{
|
||||||
string pbxprojContent = File.ReadAllText(pbxprojFile, Encoding.UTF8);
|
string pbxprojContent = File.ReadAllText(pbxprojFile, Encoding.UTF8);
|
||||||
|
@ -64,8 +38,13 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||||
Debug.LogWarning($"[AddLil2cppSourceCodeToXcodeproj] project.pbxproj remove building option:'{removeBuildOption}' fail. This may occur when 'Append' to existing xcode project in building");
|
Debug.LogWarning($"[AddLil2cppSourceCodeToXcodeproj] project.pbxproj remove building option:'{removeBuildOption}' fail. This may occur when 'Append' to existing xcode project in building");
|
||||||
}
|
}
|
||||||
|
|
||||||
pbxprojContent = TryRemoveDunplicateShellScriptSegment(pbxprojFile, pbxprojContent);
|
int strShellScriptIndex1 = pbxprojContent.IndexOf("/* ShellScript */,");
|
||||||
|
int strShellScriptIndex2 = pbxprojContent.IndexOf("/* ShellScript */,", strShellScriptIndex1 + 10);
|
||||||
|
if (strShellScriptIndex2 >= 0)
|
||||||
|
{
|
||||||
|
pbxprojContent = pbxprojContent.Remove(strShellScriptIndex1, strShellScriptIndex2 - strShellScriptIndex1);
|
||||||
|
Debug.LogWarning($"[AddLil2cppSourceCodeToXcodeproj] remove duplicated '/* ShellScript */' from file '{pbxprojFile}'");
|
||||||
|
}
|
||||||
|
|
||||||
File.WriteAllText(pbxprojFile, pbxprojContent, Encoding.UTF8);
|
File.WriteAllText(pbxprojFile, pbxprojContent, Encoding.UTF8);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ using UnityEngine;
|
||||||
using TypeInfo = HybridCLR.Editor.ABI.TypeInfo;
|
using TypeInfo = HybridCLR.Editor.ABI.TypeInfo;
|
||||||
using CallingConvention = System.Runtime.InteropServices.CallingConvention;
|
using CallingConvention = System.Runtime.InteropServices.CallingConvention;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using TypeAttributes = dnlib.DotNet.TypeAttributes;
|
|
||||||
|
|
||||||
namespace HybridCLR.Editor.MethodBridge
|
namespace HybridCLR.Editor.MethodBridge
|
||||||
{
|
{
|
||||||
|
@ -247,20 +246,11 @@ namespace HybridCLR.Editor.MethodBridge
|
||||||
_managed2NativeMethodList0.Count, _native2ManagedMethodList0.Count, _adjustThunkMethodList0.Count, _structTypes0.Count);
|
_managed2NativeMethodList0.Count, _native2ManagedMethodList0.Count, _adjustThunkMethodList0.Count, _structTypes0.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class AnalyzeFieldInfo
|
|
||||||
{
|
|
||||||
public FieldDef field;
|
|
||||||
|
|
||||||
public TypeInfo type;
|
|
||||||
}
|
|
||||||
|
|
||||||
private class AnalyzeTypeInfo
|
private class AnalyzeTypeInfo
|
||||||
{
|
{
|
||||||
public TypeInfo toSharedType;
|
public TypeInfo toSharedType;
|
||||||
public List<AnalyzeFieldInfo> fields;
|
public List<TypeInfo> fields;
|
||||||
public string signature;
|
public string signature;
|
||||||
public ClassLayout classLayout;
|
|
||||||
public TypeAttributes layout;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly Dictionary<TypeInfo, AnalyzeTypeInfo> _analyzeTypeInfos = new Dictionary<TypeInfo, AnalyzeTypeInfo>();
|
private readonly Dictionary<TypeInfo, AnalyzeTypeInfo> _analyzeTypeInfos = new Dictionary<TypeInfo, AnalyzeTypeInfo>();
|
||||||
|
@ -276,11 +266,7 @@ namespace HybridCLR.Editor.MethodBridge
|
||||||
GenericArgumentContext ctx = klassInst != null ? new GenericArgumentContext(klassInst, null) : null;
|
GenericArgumentContext ctx = klassInst != null ? new GenericArgumentContext(klassInst, null) : null;
|
||||||
|
|
||||||
ClassLayout sa = typeDef.ClassLayout;
|
ClassLayout sa = typeDef.ClassLayout;
|
||||||
var analyzeTypeInfo = new AnalyzeTypeInfo()
|
var analyzeTypeInfo = new AnalyzeTypeInfo();
|
||||||
{
|
|
||||||
classLayout = sa,
|
|
||||||
layout = typeDef.Layout,
|
|
||||||
};
|
|
||||||
|
|
||||||
// don't share type with explicit layout
|
// don't share type with explicit layout
|
||||||
if (sa != null)
|
if (sa != null)
|
||||||
|
@ -291,7 +277,7 @@ namespace HybridCLR.Editor.MethodBridge
|
||||||
return analyzeTypeInfo;
|
return analyzeTypeInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fields = analyzeTypeInfo.fields = new List<AnalyzeFieldInfo>();
|
var fields = analyzeTypeInfo.fields = new List<TypeInfo>();
|
||||||
|
|
||||||
foreach (FieldDef field in typeDef.Fields)
|
foreach (FieldDef field in typeDef.Fields)
|
||||||
{
|
{
|
||||||
|
@ -300,7 +286,7 @@ namespace HybridCLR.Editor.MethodBridge
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
TypeSig fieldType = ctx != null ? MetaUtil.Inflate(field.FieldType, ctx) : field.FieldType;
|
TypeSig fieldType = ctx != null ? MetaUtil.Inflate(field.FieldType, ctx) : field.FieldType;
|
||||||
fields.Add(new AnalyzeFieldInfo { field = field, type = GetSharedTypeInfo(fieldType) });
|
fields.Add(GetSharedTypeInfo(fieldType));
|
||||||
}
|
}
|
||||||
return analyzeTypeInfo;
|
return analyzeTypeInfo;
|
||||||
}
|
}
|
||||||
|
@ -326,19 +312,9 @@ namespace HybridCLR.Editor.MethodBridge
|
||||||
}
|
}
|
||||||
|
|
||||||
var sigBuf = new StringBuilder();
|
var sigBuf = new StringBuilder();
|
||||||
if (ati.classLayout != null)
|
|
||||||
{
|
|
||||||
sigBuf.Append($"[{ati.classLayout.ClassSize}|{ati.classLayout.PackingSize}|{ati.classLayout}]");
|
|
||||||
}
|
|
||||||
if (ati.layout != 0)
|
|
||||||
{
|
|
||||||
sigBuf.Append($"[{(int)ati.layout}]");
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var field in ati.fields)
|
foreach (var field in ati.fields)
|
||||||
{
|
{
|
||||||
string fieldOffset = field.field.FieldOffset != null ? field.field.FieldOffset.ToString() + "|" : "";
|
sigBuf.Append("{" + GetOrCalculateTypeInfoSignature(ToIsomorphicType(field)) + "}");
|
||||||
sigBuf.Append("{" + fieldOffset + GetOrCalculateTypeInfoSignature(ToIsomorphicType(field.type)) + "}");
|
|
||||||
}
|
}
|
||||||
return ati.signature = sigBuf.ToString();
|
return ati.signature = sigBuf.ToString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,62 +1,5 @@
|
||||||
# 发布日志
|
# 发布日志
|
||||||
|
|
||||||
## 6.6.0
|
|
||||||
|
|
||||||
发布日期 2024.8.12.
|
|
||||||
|
|
||||||
### Runtime
|
|
||||||
|
|
||||||
- [fix] 修复CustomAttribute的构造或者namedArg包含typeof(T[])参数时崩溃的bug
|
|
||||||
- [fix] 修复 T[index].CallMethod() 当CallMethod为泛型类型T的接口函数,并且array的element为T的子类时抛出ArrayTypeMismatchException的bug
|
|
||||||
- [fix] 修复MethodBase.GetCurrentMethod未返回正确结果的bug。新增instinct指令MethodBaseGetCurrentMethod
|
|
||||||
- [fix] 修复在WebGL之类的平台加载pdb后仍然无法显示堆栈代码行数的bug
|
|
||||||
- [fix] 修复调用子解释器函数后返回,再打印日志时,由于frame->ip未重新设置为&ip,导致后续打印的代码行数永远为调用子函数的代码行数的bug
|
|
||||||
- [fix] 修复调用子解释器函数时,由于frame->ip指向下一条指令,导致父函数的代码行数显示为下一条语句的行数的bug
|
|
||||||
- [merge] 合并2021.3.42f1及2022.3.41f1的il2cpp的代码,修复2021.3.42f1及2022.3.40f1新增il2cpp_codegen_memcpy_with_write_barrier函数引发的编译错误
|
|
||||||
|
|
||||||
## 6.5.0
|
|
||||||
|
|
||||||
发布日期 2024.8.5.
|
|
||||||
|
|
||||||
### Runtime
|
|
||||||
|
|
||||||
- [new] 2019-2020版本热更新函数堆栈也能正常显示代码文件及行号
|
|
||||||
- [merge] 合并Unity 6000.0.1-6000.0.10的il2cpp改动
|
|
||||||
|
|
||||||
## 6.4.0
|
|
||||||
|
|
||||||
发布日期 2024.7.25.
|
|
||||||
|
|
||||||
### Runtime
|
|
||||||
|
|
||||||
- [new] 支持`Assembly.Load(byte[] assData, byte[] pdbData)`加载dll和pdb符号文件,在2021+版本打印函数堆栈时能显示正确的代码文件和行号
|
|
||||||
- [fix] 修复团结引擎平台InterpreterImage::GetEventInfo和GetPropertyInfo时有可能未初始化method,导致getter之类的函数为空的bug
|
|
||||||
- [opt] 优化StackTrace和UnityEngine.Debug打印的函数栈顺序,大多数情况下可以在正确的栈位置地显示解释器函数
|
|
||||||
- [opt] 优化元数据内存
|
|
||||||
|
|
||||||
### Editor
|
|
||||||
|
|
||||||
- [fix][严重] 修复生成MethodBridge过程中计算等价类时未考虑到ClassLayout、Layout和FieldOffset因素的bug
|
|
||||||
- [fix] 修复Library/PlayerDataCache目录不存在时,PatchScriptingAssembliesJsonHook运行异常的bug
|
|
||||||
|
|
||||||
## 6.3.0
|
|
||||||
|
|
||||||
发布日期 2024.7.15.
|
|
||||||
|
|
||||||
### Runtime
|
|
||||||
|
|
||||||
- [opt] 大幅优化metadata元数据内存,内存占用相比6.2.0版本减少了15-40%
|
|
||||||
- [fix] 修复Transform时未释放IRBasicBlock中insts内存的bug,此bug大约0.7-1.6倍dll大小内存泄露
|
|
||||||
- [fix] 修复ClassFieldLayoutCalculator内存泄露的bug
|
|
||||||
- [fix] 修复 MetadataAllocT 错误使用 HYBRIDCLR_MALLOC的bug,正确应该是 HYBRIDCLR_METADATA_MALLOC
|
|
||||||
- [opt] 优化Interpreter::Execute占用的原生栈大小,避免嵌套过深时出现栈溢出的错误
|
|
||||||
|
|
||||||
### Editor
|
|
||||||
|
|
||||||
- [fix] 修复 Unity 2022导出的xcode工程包含多个ShellScript片段时错误地删除了非重复片断的bug
|
|
||||||
- [fix] 修复微信小游戏平台当TextureCompression非默认值时临时目录名为WinxinMiniGame{xxx},导致没有成功修改scriptingassemblies.json文件的bug
|
|
||||||
- [fix] 修复团结引擎微信小游戏平台由于同时定义了UNITY_WEIXINMINIGAME和UNITY_WEBGL宏,导致从错误路径查找scriptingassemblies.json文件失败,运行时出现脚本missing的bug
|
|
||||||
|
|
||||||
## 6.2.0
|
## 6.2.0
|
||||||
|
|
||||||
发布日期 2024.7.1.
|
发布日期 2024.7.1.
|
||||||
|
|
|
@ -10,7 +10,6 @@ namespace HybridCLR
|
||||||
HOMOLOGOUS_ONLY_SUPPORT_AOT_ASSEMBLY, // 不能给解释器assembly补充元数据
|
HOMOLOGOUS_ONLY_SUPPORT_AOT_ASSEMBLY, // 不能给解释器assembly补充元数据
|
||||||
HOMOLOGOUS_ASSEMBLY_HAS_LOADED, // 已经补充过了,不能再次补充
|
HOMOLOGOUS_ASSEMBLY_HAS_LOADED, // 已经补充过了,不能再次补充
|
||||||
INVALID_HOMOLOGOUS_MODE, // 非法HomologousImageMode
|
INVALID_HOMOLOGOUS_MODE, // 非法HomologousImageMode
|
||||||
PDB_BAD_FILE, // pdb文件不合法
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "com.code-philosophy.hybridclr",
|
"name": "com.code-philosophy.hybridclr",
|
||||||
"version": "6.6.0",
|
"version": "6.2.0",
|
||||||
"displayName": "HybridCLR",
|
"displayName": "HybridCLR",
|
||||||
"description": "HybridCLR is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotupdate.",
|
"description": "HybridCLR is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotupdate.",
|
||||||
"category": "Runtime",
|
"category": "Runtime",
|
||||||
|
|
Loading…
Reference in New Issue