}
}
public static CallSite bootstrap(MethodHandles.Lookup lookup, String name,
MethodType callSiteType) {
final CallSite cs = new MonomorphicCallSite(lookup, name, callSiteType);
MethodHandle boundInvoker =
MethodHandles.insertArguments(INVOKE_DYNAMICALLY, 0, cs);
MethodHandle collectedArgsInvoker =
boundInvoker.asCollector(Object.class, callSiteType
.parameterCount()
- boundInvoker.type().parameterCount() + 1);
MethodHandle convertedArgsInvoker =
MethodHandles.convertArguments(collectedArgsInvoker,
callSiteType);
cs.setTarget(convertedArgsInvoker);
return cs;
}