internal static void InitializeCallSite(JlInvoke.CallSite site) { Type type = typeof(IKVM.Runtime.IndyCallSite <>).MakeGenericType(MethodHandleUtil.GetDelegateTypeForInvokeExact(site.type())); IKVM.Runtime.IIndyCallSite ics = (IKVM.Runtime.IIndyCallSite)Activator.CreateInstance(type, true); System.Threading.Interlocked.CompareExchange(ref site.ics, ics, null); }
public static void setCallSiteTargetNormal(JlInvoke.CallSite site, MethodHandle target) { #if !FIRST_PASS if (site.ics == null) { InitializeCallSite(site); } lock (site.ics) { site.target = target; site.ics.SetTarget(target); } #endif }
public static void setCallSiteTargetVolatile(JlInvoke.CallSite site, MethodHandle target) { setCallSiteTargetNormal(site, target); }