Compare commits

...

5 Commits

Author SHA1 Message Date
walon 1f9faf49a3 [version] 发布v3.4.2版本 2023-08-13 13:07:49 +08:00
walon 3f1b34682d [fix] 修复计算 AOTGenericReferences时未考虑到泛型中调用泛型的问题,导致间接调用的泛型未被统计在内的bug 2023-08-13 13:07:37 +08:00
walon c3f6325e4a [version] 发布v3.4.1版本 2023-07-31 11:06:02 +08:00
walon a9f5608ecf [change] 检查Settings中热更新程序集列表配置中程序集名不能为空
[fix] 修复当某个热更新程序集正好是另一个AOT程序集后缀时,由于只对比字符串尾部,意外将该AOT程序集也过滤的bug
2023-07-21 18:05:12 +08:00
walon 8a95fd57f5 [version] 发布v3.4.0版本 2023-07-17 12:33:23 +08:00
6 changed files with 94 additions and 26 deletions
+6 -6
View File
@@ -2,18 +2,18 @@
"versions": [
{
"unity_version":"2020",
"hybridclr" : { "branch":"v3.2.0"},
"il2cpp_plus": { "branch":"v2020-3.2.0"}
"hybridclr" : { "branch":"v3.3.1"},
"il2cpp_plus": { "branch":"v2020-3.3.1"}
},
{
"unity_version":"2021",
"hybridclr" : { "branch":"v3.2.0"},
"il2cpp_plus": { "branch":"v2021-3.2.0"}
"hybridclr" : { "branch":"v3.3.1"},
"il2cpp_plus": { "branch":"v2021-3.3.2"}
},
{
"unity_version":"2022",
"hybridclr" : { "branch":"v3.2.0"},
"il2cpp_plus": { "branch":"v2022-3.2.0"}
"hybridclr" : { "branch":"v3.3.1"},
"il2cpp_plus": { "branch":"v2022-3.3.2"}
}
]
}
+7 -11
View File
@@ -58,15 +58,15 @@ namespace HybridCLR.Editor.AOT
return;
}
gc = gc.ToGenericShare();
if (_genericTypes.Add(gc) && NeedWalk(gc.Type))
if (_genericTypes.Add(gc) && NeedWalk(null, gc.Type))
{
WalkType(gc);
}
}
private bool NeedWalk(TypeDef type)
private bool NeedWalk(MethodDef callFrom, TypeDef type)
{
return _hotUpdateAssemblyFiles.Contains(type.Module.Name);
return _hotUpdateAssemblyFiles.Contains(type.Module.Name) || callFrom == null || callFrom.HasGenericParameters;
}
private bool IsAotType(TypeDef type)
@@ -85,7 +85,7 @@ namespace HybridCLR.Editor.AOT
{
return;
}
if (_genericMethods.Add(method) && NeedWalk(method.Method.DeclaringType))
if (NeedWalk(methodDef, method.Method.DeclaringType) && _genericMethods.Add(method))
{
_newMethods.Add(method);
}
@@ -101,7 +101,7 @@ namespace HybridCLR.Editor.AOT
{
return;
}
if (_genericMethods.Add(method) && NeedWalk(method.Method.DeclaringType))
if (NeedWalk(null, method.Method.DeclaringType) && _genericMethods.Add(method))
{
_newMethods.Add(method);
}
@@ -157,9 +157,9 @@ namespace HybridCLR.Editor.AOT
for (uint rid = 1, n = ass.Metadata.TablesStream.TypeSpecTable.Rows; rid <= n; rid++)
{
var ts = ass.ResolveTypeSpec(rid);
if (!ts.ContainsGenericParameter)
var cs = GenericClass.ResolveClass(ts, null)?.ToGenericShare();
if (cs != null)
{
var cs = GenericClass.ResolveClass(ts, null)?.ToGenericShare();
TryAddAndWalkGenericType(cs);
}
}
@@ -167,10 +167,6 @@ namespace HybridCLR.Editor.AOT
for (uint rid = 1, n = ass.Metadata.TablesStream.MethodSpecTable.Rows; rid <= n; rid++)
{
var ms = ass.ResolveMethodSpec(rid);
if (ms.DeclaringType.ContainsGenericParameter || ms.GenericInstMethodSig.ContainsGenericParameter)
{
continue;
}
var gm = GenericMethod.ResolveMethod(ms, null)?.ToGenericShare();
TryAddMethodNotWalkType(gm);
}
@@ -1,6 +1,7 @@
using HybridCLR.Editor.Meta;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -25,15 +26,18 @@ namespace HybridCLR.Editor.BuildProcessors
return assemblies;
}
List<string> allHotUpdateDllNames = SettingsUtil.HotUpdateAssemblyNamesExcludePreserved;
List<string> allHotupdateDllFiles = SettingsUtil.HotUpdateAssemblyFilesExcludePreserved;
// 检查是否重复填写
var hotUpdateDllSet = new HashSet<string>();
foreach(var hotUpdateDll in allHotUpdateDllNames)
{
if (string.IsNullOrWhiteSpace(hotUpdateDll))
{
throw new BuildFailedException($"热更新 assembly 名不能为空");
}
if (!hotUpdateDllSet.Add(hotUpdateDll))
{
throw new Exception($"热更新 assembly:{hotUpdateDll} 在列表中重复,请除去重复条目");
throw new BuildFailedException($"热更新 assembly:{hotUpdateDll} 在列表中重复,请除去重复条目");
}
}
@@ -41,16 +45,24 @@ namespace HybridCLR.Editor.BuildProcessors
// 检查是否填写了正确的dll名称
foreach (var hotUpdateDllName in allHotUpdateDllNames)
{
string hotUpdateDllFile = hotUpdateDllName + ".dll";
if (assemblies.All(ass => !ass.EndsWith(hotUpdateDllFile)) && string.IsNullOrEmpty(assResolver.ResolveAssembly(hotUpdateDllName, false)))
if (assemblies.Select(Path.GetFileNameWithoutExtension).All(ass => ass != hotUpdateDllName)
&& string.IsNullOrEmpty(assResolver.ResolveAssembly(hotUpdateDllName, false)))
{
throw new Exception($"热更新 assembly:{hotUpdateDllFile} 不存在,请检查拼写错误");
throw new BuildFailedException($"热更新 assembly:{hotUpdateDllName} 不存在,请检查拼写错误");
}
Debug.Log($"[FilterHotFixAssemblies] 过滤热更新assembly:{hotUpdateDllFile}");
}
// 将热更dll从打包列表中移除
return assemblies.Where(ass => allHotupdateDllFiles.All(dll => !ass.EndsWith(dll, StringComparison.OrdinalIgnoreCase))).ToArray();
return assemblies.Where(ass =>
{
string assName = Path.GetFileNameWithoutExtension(ass);
bool reserved = allHotUpdateDllNames.All(dll => !assName.Equals(dll, StringComparison.Ordinal));
if (!reserved)
{
Debug.Log($"[FilterHotFixAssemblies] 过滤热更新assembly:{assName}");
}
return reserved;
}).ToArray();
}
}
}
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 52688f4469ff9454e8c3d8aaf045d9f4
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+53
View File
@@ -1,5 +1,58 @@
# 发布日志
## 3.4.2
发布日期 2023.08.14。
### Runtime
- [fix] 修复RawImage::LoadTables读取_4byteGUIDIndex的bug
- [version] 支持2022.3.7版本
- [version] 支持2021.3.29版本
### Editor
- [fix] 修复计算AOTGenericReference未考虑到泛型调用泛型的情况,导致少计算了泛型及补充元数据
## 3.4.1
发布日期 2023.07.31。
### Runtime
- [fix] 修复 InitializeRuntimeMetadata的内存可见性问题
- [fix] 修复CustomAttribute未正确处理父类NamedArg导致崩溃的bug
- [opt] 优化Transfrom Instinct指令的代码,从HashMap中快速查找而不是挨个匹配
### Editor
- [fix] 修复FilterHotFixAssemblies只对比程序集名尾部,导致有AOT的尾部与某个热更新程序集匹配时意外被过滤的bug
- [change] 检查Settings中热更新程序集列表配置中程序集名不能为空
## 3.4.0
发布日期 2023.07.17。
### Runtime
- [version] 支持2021.3.28和2022.3.4版本
- [opt] 删除MachineState::InitEvalStack分配_StackBase后不必要的memset
- [fix] 修复Exception机制的bug
- [fix] 修复CustomAttribute不支持Type[]类型参数的bug
- [fix] 修复不支持new string(xxx)用法的问题
- [refactor] 重构VTableSetup实现
- [fix] 修复未计算子interface中显式实现父interface的函数的bug
- [opt] Lazy初始化CustomAttributeData,而不是加载时全部初始化,明显减少Assembly.Load时间
- [fix] 修复2022 当new byte\[]{a,b,c...}方式初始化较长的byte[]数据时,返回错误数据的bug
### Editor
- [fix] 修复计算桥接函数未考虑到泛型类的成员函数中可能包含的Native2Managed调用
- [change] link.xml及AOTGenericReferences.cs默认输出路径改为HybridCLRGenerate,避免与顶层HybridCLRData混淆
- [fix] 修复Win下生成的Lump文件中include路径以\为目录分隔符导致同步到Mac后找不到路径的bug
- [refactor] 重构Installer
## 3.3.0
发布日期 2023.07.03。
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "com.code-philosophy.hybridclr",
"version": "3.3.0",
"version": "3.4.2",
"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",