use of java.lang.invoke.MutableCallSite in project openj9 by eclipse.
the class BootstrapMethods method gwtBootstrap.
public static CallSite gwtBootstrap(Lookup ignored, String name, MethodType type) throws Throwable {
Lookup lookup = lookup();
MethodHandle double_string = lookup.findStatic(BootstrapMethods.class, "dup", methodType(String.class, String.class));
MethodHandle double_integer = lookup.findStatic(BootstrapMethods.class, "dup", methodType(String.class, Integer.class));
MethodHandle double_object = lookup.findStatic(BootstrapMethods.class, "dup", methodType(String.class, Object.class));
MethodHandle isInteger = lookup.findStatic(BootstrapMethods.class, "isInteger", methodType(boolean.class, Object.class));
MethodHandle isString = lookup.findStatic(BootstrapMethods.class, "isString", methodType(boolean.class, Object.class));
MethodHandle handle = guardWithTest(isString, double_string.asType(methodType(String.class, Object.class)), double_object);
handle = guardWithTest(isInteger, double_integer.asType(methodType(String.class, Object.class)), handle);
return new MutableCallSite(handle);
}
use of java.lang.invoke.MutableCallSite in project openj9 by eclipse.
the class BootstrapMethods method foldBootstrap.
public static CallSite foldBootstrap(Lookup ignored, String name, MethodType type) throws Throwable {
Lookup lookup = lookup();
MethodHandle add = lookup.findStatic(BootstrapMethods.class, "add", methodType(int.class, int.class, int.class));
MethodHandle fold = foldArguments(add, identity(int.class));
fold = foldArguments(add, fold);
return new MutableCallSite(fold);
}
Aggregations