File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66using System . Runtime . InteropServices ;
77using System . Text ;
88using System . Threading . Tasks ;
9+ using UnityEditor ;
910using UnityEngine . Scripting ;
1011
1112namespace HybridCLR
@@ -29,6 +30,37 @@ public static unsafe LoadImageErrorCode LoadMetadataForAOTAssembly(byte[] dllByt
2930 public static extern LoadImageErrorCode LoadMetadataForAOTAssembly ( byte [ ] dllBytes , HomologousImageMode mode ) ;
3031#endif
3132
33+ /// <summary>
34+ /// prejit method to avoid the jit cost of first time running
35+ /// </summary>
36+ /// <param name="method"></param>
37+ /// <returns>return true if method is jited, return false if method can't be jited </returns>
38+ ///
39+ #if UNITY_EDITOR
40+ public static bool PreJitMethod ( MethodInfo method )
41+ {
42+ return false ;
43+ }
44+ #else
45+ [ MethodImpl ( MethodImplOptions . InternalCall ) ]
46+ public static extern bool PreJitMethod ( MethodInfo method ) ;
47+ #endif
48+
49+ /// <summary>
50+ /// prejit all methods of class to avoid the jit cost of first time running
51+ /// </summary>
52+ /// <param name="type"></param>
53+ /// <returns>return true if class is jited, return false if class can't be jited </returns>
54+ #if UNITY_EDITOR
55+ public static bool PreJitClass ( Type type )
56+ {
57+ return false ;
58+ }
59+ #else
60+ [ MethodImpl ( MethodImplOptions . InternalCall ) ]
61+ public static extern bool PreJitClass ( Type type ) ;
62+ #endif
63+
3264 /// <summary>
3365 /// get the maximum number of StackObjects in the interpreter thread stack (size*8 represents the final memory size occupied
3466 /// </summary>
You can’t perform that action at this time.
0 commit comments