Exemple #1
0
        internal static MemberName LinkCallSiteImpl(Class caller, MethodHandle bootstrapMethod, String name, MethodType type, Object staticArguments, Object[] appendixResult)
        {
            CallSite callSite = CallSite.MakeSite(bootstrapMethod, name, type, staticArguments, caller);

            if (callSite is ConstantCallSite)
            {
                appendixResult[0] = callSite.DynamicInvoker();
                return(Invokers.LinkToTargetMethod(type));
            }
            else
            {
                appendixResult[0] = callSite;
                return(Invokers.LinkToCallSiteMethod(type));
            }
        }
Exemple #2
0
 internal static MemberName LinkMethodImpl(Class callerClass, int refKind, Class defc, String name, Object type, Object[] appendixResult)
 {
     try
     {
         if (defc == typeof(MethodHandle) && refKind == REF_invokeVirtual)
         {
             return(Invokers.MethodHandleInvokeLinkerMethod(name, FixMethodType(callerClass, type), appendixResult));
         }
     }
     catch (Throwable ex)
     {
         if (ex is LinkageError)
         {
             throw (LinkageError)ex;
         }
         else
         {
             throw new LinkageError(ex.Message, ex);
         }
     }
     throw new LinkageError("no such method " + defc.Name + "." + name + type);
 }