예제 #1
0
    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);
    }
예제 #2
0
    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
    }
예제 #3
0
 public static void setCallSiteTargetVolatile(JlInvoke.CallSite site, MethodHandle target)
 {
     setCallSiteTargetNormal(site, target);
 }