From 4bc06a261eb6a79d00e7157d8b6715876a823c8c Mon Sep 17 00:00:00 2001 From: liiir1985 Date: Fri, 26 Mar 2021 15:47:54 +0800 Subject: [PATCH] Added default value for prewarm method --- ILRuntime/Runtime/Enviorment/AppDomain.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ILRuntime/Runtime/Enviorment/AppDomain.cs b/ILRuntime/Runtime/Enviorment/AppDomain.cs index 97957b4d..35c6640f 100644 --- a/ILRuntime/Runtime/Enviorment/AppDomain.cs +++ b/ILRuntime/Runtime/Enviorment/AppDomain.cs @@ -1000,15 +1000,16 @@ public ILTypeInstance Instantiate(string type, object[] args = null) /// Prewarm all methods of the specified type /// /// - public void Prewarm(string type) + /// + public void Prewarm(string type, bool recursive = true) { IType t = GetType(type); if (t == null || t is CLRType) return; var methods = t.GetMethods(); - foreach(var i in methods) + foreach (var i in methods) { - ((ILMethod)i).Prewarm(true); + ((ILMethod)i).Prewarm(recursive); } } @@ -1016,7 +1017,8 @@ public void Prewarm(string type) /// Prewarm all methods specified by the parameter /// /// - public void Prewarm(PrewarmInfo[] info) + /// + public void Prewarm(PrewarmInfo[] info, bool recursive = true) { foreach(var i in info) { @@ -1031,7 +1033,7 @@ public void Prewarm(PrewarmInfo[] info) ILMethod m = (ILMethod)j; if(m.Name == mn && m.GenericParameterCount == 0) { - m.Prewarm(false); + m.Prewarm(recursive); } } }