[new] support prejit interpreter class and method
parent
37dafd7b3c
commit
9ca9cd5aa7
|
@ -6,6 +6,7 @@ using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using UnityEditor;
|
||||||
using UnityEngine.Scripting;
|
using UnityEngine.Scripting;
|
||||||
|
|
||||||
namespace HybridCLR
|
namespace HybridCLR
|
||||||
|
@ -29,6 +30,37 @@ namespace HybridCLR
|
||||||
public static extern LoadImageErrorCode LoadMetadataForAOTAssembly(byte[] dllBytes, HomologousImageMode mode);
|
public static extern LoadImageErrorCode LoadMetadataForAOTAssembly(byte[] dllBytes, HomologousImageMode mode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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>
|
/// <summary>
|
||||||
/// get the maximum number of StackObjects in the interpreter thread stack (size*8 represents the final memory size occupied
|
/// get the maximum number of StackObjects in the interpreter thread stack (size*8 represents the final memory size occupied
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue