/** * Produce a CallConfiguration name that represents what must be prepared around calls to * the method with this annotation. */ public static CallConfiguration getCallConfigByAnno(JRubyMethod anno) { return getCallConfig(anno.frame()); }
/** * Produce a CallConfiguration name that represents what must be prepared around calls to * the method with this annotation. */ public static CallConfiguration getCallConfigByAnno(JRubyMethod anno) { return getCallConfig(anno.frame()); }
public static CallConfiguration getCallConfigByAnno(JRubyMethod anno) { return getCallConfig(anno.frame(), anno.scope()); }
public static CallConfiguration getCallConfigByAnno(JRubyMethod anno) { return getCallConfig(anno.frame(), anno.scope()); }
public static String getCallConfigNameByAnno(JRubyMethod anno) { return getCallConfigName(anno.frame(), anno.scope()); }
public static String getCallConfigNameByAnno(JRubyMethod anno) { return getCallConfigName(anno.frame(), anno.scope()); }
anno.optional(), true, anno.frame()); String implClass = anno.meta() ? "singletonClass" : "cls";
anno.optional(), true, anno.frame()); String implClass = anno.meta() ? "singletonClass" : "cls";
anno.optional(), false, anno.frame()); String implClass = anno.meta() ? "singletonClass" : "cls";
anno.optional(), true, anno.frame()); String implClass = anno.meta() ? "singletonClass" : "cls";
anno.optional(), true, anno.frame()); String implClass = anno.meta() ? "singletonClass" : "cls";
anno.optional(), false, anno.frame()); String implClass = anno.meta() ? "singletonClass" : "cls";
anno.optional(), false, anno.frame()); String implClass = anno.meta() ? "singletonClass" : "cls";
@Override public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, List<JavaMethodDescriptor> descs) { JavaMethodDescriptor desc1 = descs.get(0); if (desc1.anno.frame()) { // super logic does not work yet because we need to take impl class // and method name from the DynamicMethod#call call, so punt to // generated class for now return super.getAnnotatedMethod(implementationClass, descs); } if (!Modifier.isPublic(desc1.getDeclaringClass().getModifiers())) { LOG.warn("warning: binding non-public class {}; reflected handles won't work", desc1.declaringClassName); } DescriptorInfo info = new DescriptorInfo(descs); MethodHandle[] targets = buildAnnotatedMethodHandles(implementationClass.getRuntime(), descs, implementationClass); return new HandleMethod(implementationClass, desc1.anno.visibility(), CallConfiguration.getCallConfig(info.isFrame(), info.isScope()), targets, null); }
@Override public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, List<JavaMethodDescriptor> descs) { JavaMethodDescriptor desc1 = descs.get(0); if (desc1.anno.frame()) { // super logic does not work yet because we need to take impl class // and method name from the DynamicMethod#call call, so punt to // generated class for now return super.getAnnotatedMethod(implementationClass, descs); } if (!Modifier.isPublic(desc1.getDeclaringClass().getModifiers())) { LOG.warn("warning: binding non-public class {}; reflected handles won't work", desc1.declaringClassName); } DescriptorInfo info = new DescriptorInfo(descs); MethodHandle[] targets = buildAnnotatedMethodHandles(implementationClass.getRuntime(), descs, implementationClass); return new HandleMethod(implementationClass, desc1.anno.visibility(), CallConfiguration.getCallConfig(info.isFrame(), info.isScope()), targets, null); }
Callable<MethodHandle> target = adaptHandle(method, runtime, desc.actualRequired, desc.required, desc.optional, desc.rest, rubyName, desc.declaringClass, desc.isStatic, desc.hasContext, desc.hasBlock, desc.anno.frame(), implementationClass); int specificArity = -1; if (desc.required < 4 && desc.optional == 0 && !desc.rest) {
Callable<MethodHandle> target = adaptHandle(method, runtime, desc.actualRequired, desc.required, desc.optional, desc.rest, rubyName, desc.declaringClass, desc.isStatic, desc.hasContext, desc.hasBlock, desc.anno.frame(), implementationClass); int specificArity = -1; if (desc.required < 4 && desc.optional == 0 && !desc.rest) {
String generatedClassName = CodegenUtils.getAnnotatedBindingClassName(javaMethodName, desc1.declaringClassName, desc1.isStatic, desc1.actualRequired, desc1.optional, descs.size() > 1, desc1.anno.frame()); if (RubyInstanceConfig.FULL_TRACE_ENABLED) {
public void adaptHandle(ExecutableElementDescriptor executableElementDescriptor, int implClass) { ExecutableElementDescriptor desc = executableElementDescriptor; // adapt handle mv.aload(RUNTIME); mv.ldc(calculateActualRequired(desc.method, desc.method.getParameters().size(), desc.optional, desc.rest, desc.isStatic, desc.hasContext, desc.hasBlock)); mv.ldc(desc.required); mv.ldc(desc.optional); mv.ldc(desc.rest); mv.ldc(desc.rubyName); mv.ldc(Type.getObjectType(desc.declaringClassPath)); mv.ldc(desc.isStatic); mv.ldc(desc.hasContext); mv.ldc(desc.hasBlock); mv.ldc(desc.anno.frame()); mv.aload(implClass); mv.invokestatic("org/jruby/internal/runtime/methods/InvokeDynamicMethodFactory", "adaptHandle", Method.getMethod("java.util.concurrent.Callable adaptHandle(java.lang.invoke.MethodHandle, org.jruby.Ruby, int, int, int, boolean, java.lang.String, java.lang.Class, boolean, boolean, boolean, boolean, org.jruby.RubyModule)").getDescriptor()); }
public void adaptHandle(ExecutableElementDescriptor executableElementDescriptor, int implClass) { ExecutableElementDescriptor desc = executableElementDescriptor; // adapt handle mv.aload(RUNTIME); mv.ldc(calculateActualRequired(desc.method, desc.method.getParameters().size(), desc.optional, desc.rest, desc.isStatic, desc.hasContext, desc.hasBlock)); mv.ldc(desc.required); mv.ldc(desc.optional); mv.ldc(desc.rest); mv.ldc(desc.rubyName); mv.ldc(Type.getObjectType(desc.declaringClassPath)); mv.ldc(desc.isStatic); mv.ldc(desc.hasContext); mv.ldc(desc.hasBlock); mv.ldc(desc.anno.frame()); mv.aload(implClass); mv.invokestatic("org/jruby/internal/runtime/methods/InvokeDynamicMethodFactory", "adaptHandle", Method.getMethod("java.util.concurrent.Callable adaptHandle(java.lang.invoke.MethodHandle, org.jruby.Ruby, int, int, int, boolean, java.lang.String, java.lang.Class, boolean, boolean, boolean, boolean, org.jruby.RubyModule)").getDescriptor()); }