Compare commits
10 Commits
e086228d90
...
3705ca6e1f
Author | SHA1 | Date |
---|---|---|
walon | 3705ca6e1f | |
walon | 34df279943 | |
walon | b85ed1aa92 | |
walon | faf4a328af | |
walon | 53f4f33bf0 | |
walon | 48c91f497b | |
walon | 9afbe3bd84 | |
walon | 2d5f71f6b7 | |
walon | 5747458bf2 | |
walon | 0b455eb882 |
|
@ -2,28 +2,28 @@
|
|||
"versions": [
|
||||
{
|
||||
"unity_version":"2019",
|
||||
"hybridclr" : { "branch":"v6.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2019-6.1.0"}
|
||||
"hybridclr" : { "branch":"v6.6.0"},
|
||||
"il2cpp_plus": { "branch":"v2019-6.6.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2020",
|
||||
"hybridclr" : { "branch":"v6.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2020-6.1.0"}
|
||||
"hybridclr" : { "branch":"v6.6.0"},
|
||||
"il2cpp_plus": { "branch":"v2020-6.6.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2021",
|
||||
"hybridclr" : { "branch":"v6.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2021-6.2.0"}
|
||||
"hybridclr" : { "branch":"v6.6.0"},
|
||||
"il2cpp_plus": { "branch":"v2021-6.6.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2022",
|
||||
"hybridclr" : { "branch":"v6.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2022-6.1.0"}
|
||||
"hybridclr" : { "branch":"v6.6.0"},
|
||||
"il2cpp_plus": { "branch":"v2022-6.6.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2022-tuanjie",
|
||||
"hybridclr" : { "branch":"v6.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2022-tuanjie-6.1.0"}
|
||||
"hybridclr" : { "branch":"v6.6.0"},
|
||||
"il2cpp_plus": { "branch":"v2022-tuanjie-6.6.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2023",
|
||||
|
@ -32,8 +32,8 @@
|
|||
},
|
||||
{
|
||||
"unity_version":"6000",
|
||||
"hybridclr" : { "branch":"v6.2.0"},
|
||||
"il2cpp_plus": { "branch":"v6000-6.1.0"}
|
||||
"hybridclr" : { "branch":"v6.6.0"},
|
||||
"il2cpp_plus": { "branch":"v6000-6.6.0"}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -35,18 +35,31 @@ namespace HybridCLR.MonoHook
|
|||
|
||||
private static string BuildMainWindowTitle()
|
||||
{
|
||||
#if UNITY_WEIXINMINIGAME
|
||||
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame);
|
||||
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WeixinMiniGame/Data/ScriptingAssemblies.json";
|
||||
#else
|
||||
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebGL);
|
||||
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WebGL/Data/ScriptingAssemblies.json";
|
||||
#endif
|
||||
if (File.Exists(tempJsonPath))
|
||||
var cacheDir = $"{Application.dataPath}/../Library/PlayerDataCache";
|
||||
if (Directory.Exists(cacheDir))
|
||||
{
|
||||
var patcher = new PatchScriptingAssemblyList();
|
||||
patcher.PathScriptingAssembilesFile(Path.GetDirectoryName(tempJsonPath));
|
||||
foreach (var tempJsonPath in Directory.GetDirectories(cacheDir, "*", SearchOption.TopDirectoryOnly))
|
||||
{
|
||||
string dirName = Path.GetFileName(tempJsonPath);
|
||||
#if UNITY_WEIXINMINIGAME
|
||||
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame);
|
||||
if (!dirName.Contains("WeixinMiniGame"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
#else
|
||||
Debug.Assert(EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebGL);
|
||||
if (!dirName.Contains("WebGL"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
var patcher = new PatchScriptingAssemblyList();
|
||||
patcher.PathScriptingAssembilesFile(tempJsonPath);
|
||||
}
|
||||
}
|
||||
|
||||
string newTitle = BuildMainWindowTitleProxy();
|
||||
return newTitle;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ using HybridCLR.Editor.Installer;
|
|||
using HybridCLR.Editor.Settings;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Callbacks;
|
||||
|
@ -24,6 +25,31 @@ namespace HybridCLR.Editor.BuildProcessors
|
|||
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)
|
||||
{
|
||||
string pbxprojContent = File.ReadAllText(pbxprojFile, Encoding.UTF8);
|
||||
|
@ -38,13 +64,8 @@ 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");
|
||||
}
|
||||
|
||||
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}'");
|
||||
}
|
||||
pbxprojContent = TryRemoveDunplicateShellScriptSegment(pbxprojFile, pbxprojContent);
|
||||
|
||||
|
||||
File.WriteAllText(pbxprojFile, pbxprojContent, Encoding.UTF8);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ using UnityEngine;
|
|||
using TypeInfo = HybridCLR.Editor.ABI.TypeInfo;
|
||||
using CallingConvention = System.Runtime.InteropServices.CallingConvention;
|
||||
using System.Security.Cryptography;
|
||||
using TypeAttributes = dnlib.DotNet.TypeAttributes;
|
||||
|
||||
namespace HybridCLR.Editor.MethodBridge
|
||||
{
|
||||
|
@ -246,11 +247,20 @@ namespace HybridCLR.Editor.MethodBridge
|
|||
_managed2NativeMethodList0.Count, _native2ManagedMethodList0.Count, _adjustThunkMethodList0.Count, _structTypes0.Count);
|
||||
}
|
||||
|
||||
private class AnalyzeFieldInfo
|
||||
{
|
||||
public FieldDef field;
|
||||
|
||||
public TypeInfo type;
|
||||
}
|
||||
|
||||
private class AnalyzeTypeInfo
|
||||
{
|
||||
public TypeInfo toSharedType;
|
||||
public List<TypeInfo> fields;
|
||||
public List<AnalyzeFieldInfo> fields;
|
||||
public string signature;
|
||||
public ClassLayout classLayout;
|
||||
public TypeAttributes layout;
|
||||
}
|
||||
|
||||
private readonly Dictionary<TypeInfo, AnalyzeTypeInfo> _analyzeTypeInfos = new Dictionary<TypeInfo, AnalyzeTypeInfo>();
|
||||
|
@ -266,7 +276,11 @@ namespace HybridCLR.Editor.MethodBridge
|
|||
GenericArgumentContext ctx = klassInst != null ? new GenericArgumentContext(klassInst, null) : null;
|
||||
|
||||
ClassLayout sa = typeDef.ClassLayout;
|
||||
var analyzeTypeInfo = new AnalyzeTypeInfo();
|
||||
var analyzeTypeInfo = new AnalyzeTypeInfo()
|
||||
{
|
||||
classLayout = sa,
|
||||
layout = typeDef.Layout,
|
||||
};
|
||||
|
||||
// don't share type with explicit layout
|
||||
if (sa != null)
|
||||
|
@ -277,7 +291,7 @@ namespace HybridCLR.Editor.MethodBridge
|
|||
return analyzeTypeInfo;
|
||||
}
|
||||
|
||||
var fields = analyzeTypeInfo.fields = new List<TypeInfo>();
|
||||
var fields = analyzeTypeInfo.fields = new List<AnalyzeFieldInfo>();
|
||||
|
||||
foreach (FieldDef field in typeDef.Fields)
|
||||
{
|
||||
|
@ -286,7 +300,7 @@ namespace HybridCLR.Editor.MethodBridge
|
|||
continue;
|
||||
}
|
||||
TypeSig fieldType = ctx != null ? MetaUtil.Inflate(field.FieldType, ctx) : field.FieldType;
|
||||
fields.Add(GetSharedTypeInfo(fieldType));
|
||||
fields.Add(new AnalyzeFieldInfo { field = field, type = GetSharedTypeInfo(fieldType) });
|
||||
}
|
||||
return analyzeTypeInfo;
|
||||
}
|
||||
|
@ -312,9 +326,19 @@ namespace HybridCLR.Editor.MethodBridge
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
sigBuf.Append("{" + GetOrCalculateTypeInfoSignature(ToIsomorphicType(field)) + "}");
|
||||
string fieldOffset = field.field.FieldOffset != null ? field.field.FieldOffset.ToString() + "|" : "";
|
||||
sigBuf.Append("{" + fieldOffset + GetOrCalculateTypeInfoSignature(ToIsomorphicType(field.type)) + "}");
|
||||
}
|
||||
return ati.signature = sigBuf.ToString();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,62 @@
|
|||
# 发布日志
|
||||
|
||||
## 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
|
||||
|
||||
发布日期 2024.7.1.
|
||||
|
|
|
@ -10,6 +10,7 @@ namespace HybridCLR
|
|||
HOMOLOGOUS_ONLY_SUPPORT_AOT_ASSEMBLY, // 不能给解释器assembly补充元数据
|
||||
HOMOLOGOUS_ASSEMBLY_HAS_LOADED, // 已经补充过了,不能再次补充
|
||||
INVALID_HOMOLOGOUS_MODE, // 非法HomologousImageMode
|
||||
PDB_BAD_FILE, // pdb文件不合法
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "com.code-philosophy.hybridclr",
|
||||
"version": "6.2.0",
|
||||
"version": "6.6.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",
|
||||
|
|
Loading…
Reference in New Issue