[change] 移除HybridCLR.Runtime中DHE相关代码

main
walon 2022-12-04 21:37:17 +08:00
parent e7fac5b0b8
commit 38615500fb
6 changed files with 1 additions and 124 deletions

View File

@ -1,33 +0,0 @@
using System.Collections.Generic;
using System.IO;
using UnityEngine;
namespace HybridCLR.Runtime
{
public class DifferentialHybridAssemblyOptions
{
public const uint Signature = 0xABCDABCD;
public List<uint> notChangeMethodTokens;
public byte[] Marshal()
{
var stream = new MemoryStream();
var writer = new BinaryWriter(stream);
writer.Write(Signature);
writer.Write((uint)notChangeMethodTokens.Count);
foreach (uint token in notChangeMethodTokens)
{
writer.Write(token);
}
writer.Flush();
stream.Flush();
byte[] result = new byte[stream.Length];
stream.Position = 0;
stream.Read(result, 0, result.Length);
Debug.Log($"HotPatchAssemblyConfig. options bytes:{result.Length}");
return result;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 3394055921ccce643b09466544ea3634
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -46,56 +46,6 @@ namespace HybridCLR
public static extern unsafe int LoadMetadataForAOTAssembly(byte* dllBytes, int dllSize, int mode); public static extern unsafe int LoadMetadataForAOTAssembly(byte* dllBytes, int dllSize, int mode);
//[DllImport(dllName, EntryPoint = "RuntimeApi_UseDifferentialHybridAOTAssembly")]
//public static unsafe LoadImageErrorCode UseDifferentialHybridAOTAssembly(string assemblyName)
//{
// byte[] nameBytes = System.Text.Encoding.UTF8.GetBytes(assemblyName);
// fixed(byte* namePtr = nameBytes)
// {
// }
//}
/// <summary>
/// 指示混合执行assembly使用原始的AOT代码。当assembly没有发生变化时必须调用此接口。
/// </summary>
/// <param name="assemblyName"></param>
/// <returns></returns>
#if UNITY_EDITOR
public static LoadImageErrorCode UseDifferentialHybridAOTAssembly(string assemblyName)
{
return LoadImageErrorCode.OK;
}
#else
[DllImport(dllName, EntryPoint = "RuntimeApi_UseDifferentialHybridAOTAssembly")]
public static extern LoadImageErrorCode UseDifferentialHybridAOTAssembly(string assemblyName);
#endif
/// <summary>
/// 加载差分混合执行 assembly
/// </summary>
/// <param name="dllBytes"></param>
/// <param name="optionBytes"></param>
/// <returns></returns>
public static unsafe LoadImageErrorCode LoadDifferentialHybridAssembly(byte[] dllBytes, byte[] optionBytes)
{
#if UNITY_EDITOR
return LoadImageErrorCode.OK;
#else
fixed(byte* dllBytesPtr = dllBytes)
{
fixed(byte* optionBytesPtr = optionBytes)
{
return (LoadImageErrorCode)LoadDifferentialHybridAssembly(dllBytesPtr, dllBytes.Length, optionBytesPtr, optionBytes.Length);
}
}
#endif
}
[DllImport(dllName, EntryPoint = "RuntimeApi_LoadDifferentialHybridAssembly")]
public static extern unsafe int LoadDifferentialHybridAssembly(byte* dllBytes, int dllSize, byte* optionBytesPtr, int optionBytesLength);
/// <summary> /// <summary>
/// 获取解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小) /// 获取解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小)
/// </summary> /// </summary>

View File

@ -1,18 +0,0 @@
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybridCLR.Runtime
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Struct)]
public class UnchangedAttribute : Attribute
{
public bool Unchanged { get; }
public UnchangedAttribute(bool unchanged = true)
{
Unchanged = unchanged;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 704603a2a0551f247a30e331ca476870
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,6 +1,6 @@
{ {
"name": "com.focus-creative-games.hybridclr_unity", "name": "com.focus-creative-games.hybridclr_unity",
"version": "1.1.5", "version": "1.1.6",
"displayName": "HybridCLR", "displayName": "HybridCLR",
"description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR", "description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR",
"category": "Runtime", "category": "Runtime",