+AnnotationHelper.getArityValue(anno, actualRequired) + ", \"" + method.getSimpleName() + "\", " + isStatic + ", " + "CallConfiguration." + AnnotationHelper.getCallConfigNameByAnno(anno) + ", " + anno.notImplemented() + ", " + ((TypeElement)method.getEnclosingElement()).getQualifiedName() + ".class, "
public static String getCallConfigNameByAnno(JRubyMethod anno) { return getCallConfigName(anno.frame(), anno.scope()); }
public static void addMethodNamesToMap(Map<String, JRubyMethod> map, JRubyMethod jrubyMethod, String simpleName) { addMethodNamesToMap(map, jrubyMethod, simpleName, jrubyMethod.name(), jrubyMethod.alias()); }
AnnotationHelper.groupFrameFields(readGroups, writeGroups, anno, method.getSimpleName().toString()); AnnotationHelper.populateMethodIndex(readGroups, (bits, names) -> emitIndexCode(bits, names, " MethodIndex.addMethodReadFieldsPacked(%d, \"%s\");")); AnnotationHelper.populateMethodIndex(writeGroups, (bits, names) -> emitIndexCode(bits, names, " MethodIndex.addMethodWriteFieldsPacked(%d, \"%s\");"));
out.println(" javaMethod = new " + annotatedBindingName + "(" + implClass + ", Visibility." + anno.visibility() + ", \"" + baseName + "\");"); out.println(" populateMethod(javaMethod, " + join(AnnotationHelper.getArityValue(anno, actualRequired), quote(method.getSimpleName()), isStatic,
if (frame) AnnotationHelper.addMethodNamesToSet(frameAwareMethods, anno, method.getSimpleName().toString()); if (scope) AnnotationHelper.addMethodNamesToSet(scopeAwareMethods, anno, method.getSimpleName().toString());
public void populate(final RubyModule target, final Class clazz) { assert clazz == this.clazz : "populator for " + this.clazz + " used for " + clazz; // fallback on non-pregenerated logic // populate method index; this is done statically in generated code AnnotationHelper.populateMethodIndex(clumper.readGroups, MethodIndex::addMethodReadFieldsPacked); AnnotationHelper.populateMethodIndex(clumper.writeGroups, MethodIndex::addMethodWriteFieldsPacked); final Ruby runtime = target.getRuntime(); final MethodFactory methodFactory = MethodFactory.createFactory(runtime.getJRubyClassLoader()); for (Map.Entry<String, List<JavaMethodDescriptor>> entry : clumper.getStaticAnnotatedMethods().entrySet()) { final String name = entry.getKey(); final List<JavaMethodDescriptor> methods = entry.getValue(); target.defineAnnotatedMethod(name, methods, methodFactory); addBoundMethodsUnlessOmitted(runtime, name, methods); } for (Map.Entry<String, List<JavaMethodDescriptor>> entry : clumper.getAnnotatedMethods().entrySet()) { final String name = entry.getKey(); final List<JavaMethodDescriptor> methods = entry.getValue(); target.defineAnnotatedMethod(name, methods, methodFactory); addBoundMethodsUnlessOmitted(runtime, name, methods); } }
if (anno.writes().length > 0 && writeGroups == Collections.EMPTY_MAP) writeGroups = new HashMap<>(); AnnotationHelper.groupFrameFields(readGroups, writeGroups, anno, method.getName());
method.getSimpleName() + "\", " + isStatic + ", " + "CallConfiguration." + AnnotationHelper.getCallConfigNameByAnno(anno) + ", " + anno.notImplemented() + ", " + ((TypeElement)method.getEnclosingElement()).getQualifiedName() + ".class, "
AnnotationHelper.groupFrameFields(readGroups, writeGroups, anno, method.getSimpleName().toString()); AnnotationHelper.populateMethodIndex(readGroups, (bits, names) -> emitIndexCode(bits, names, " MethodIndex.addMethodReadFieldsPacked(%d, \"%s\");")); AnnotationHelper.populateMethodIndex(writeGroups, (bits, names) -> emitIndexCode(bits, names, " MethodIndex.addMethodWriteFieldsPacked(%d, \"%s\");"));
out.println(" javaMethod = new " + annotatedBindingName + "(" + implClass + ", Visibility." + anno.visibility() + ", \"" + baseName + "\");"); out.println(" populateMethod(javaMethod, " + join(AnnotationHelper.getArityValue(anno, actualRequired), quote(method.getSimpleName()), isStatic,
if (frame) AnnotationHelper.addMethodNamesToSet(frameAwareMethods, anno, method.getSimpleName().toString()); if (scope) AnnotationHelper.addMethodNamesToSet(scopeAwareMethods, anno, method.getSimpleName().toString());
public void populate(final RubyModule target, final Class clazz) { assert clazz == this.clazz : "populator for " + this.clazz + " used for " + clazz; // fallback on non-pregenerated logic // populate method index; this is done statically in generated code AnnotationHelper.populateMethodIndex(clumper.readGroups, MethodIndex::addMethodReadFieldsPacked); AnnotationHelper.populateMethodIndex(clumper.writeGroups, MethodIndex::addMethodWriteFieldsPacked); final Ruby runtime = target.getRuntime(); final MethodFactory methodFactory = MethodFactory.createFactory(runtime.getJRubyClassLoader()); for (Map.Entry<String, List<JavaMethodDescriptor>> entry : clumper.getStaticAnnotatedMethods().entrySet()) { final String name = entry.getKey(); final List<JavaMethodDescriptor> methods = entry.getValue(); target.defineAnnotatedMethod(name, methods, methodFactory); addBoundMethodsUnlessOmitted(runtime, name, methods); } for (Map.Entry<String, List<JavaMethodDescriptor>> entry : clumper.getAnnotatedMethods().entrySet()) { final String name = entry.getKey(); final List<JavaMethodDescriptor> methods = entry.getValue(); target.defineAnnotatedMethod(name, methods, methodFactory); addBoundMethodsUnlessOmitted(runtime, name, methods); } }
if (anno.writes().length > 0 && writeGroups == Collections.EMPTY_MAP) writeGroups = new HashMap<>(); AnnotationHelper.groupFrameFields(readGroups, writeGroups, anno, method.getName());
method.getSimpleName() + "\", " + isStatic + ", " + "CallConfiguration." + AnnotationHelper.getCallConfigNameByAnno(anno) + ", " + anno.notImplemented() + ", " + ((TypeElement)method.getEnclosingElement()).getQualifiedName() + ".class, "
+AnnotationHelper.getArityValue(anno, actualRequired) + ", \"" + method.getSimpleName() + "\", " + isStatic + ", " + "CallConfiguration." + AnnotationHelper.getCallConfigNameByAnno(anno) + ", " + anno.notImplemented() + ", " + ((TypeElement)method.getEnclosingElement()).getQualifiedName() + ".class, "
public static String getCallConfigNameByAnno(JRubyMethod anno) { return getCallConfigName(anno.frame(), anno.scope()); }
AnnotationHelper.groupFrameFields(readGroups, writeGroups, anno, method.getSimpleName().toString()); AnnotationHelper.populateMethodIndex(readGroups, (bits, names) -> emitIndexCode(bits, names, "addMethodReadFieldsPacked")); AnnotationHelper.populateMethodIndex(writeGroups, (bits, names) -> emitIndexCode(bits, names, "addMethodWriteFieldsPacked"));
AnnotationHelper.addMethodNamesToSet(frameAwareMethods, jrubyMethod, simpleName); ASTInspector.FRAME_AWARE_METHODS.addAll(frameAwareMethods); AnnotationHelper.addMethodNamesToSet(scopeAwareMethods, jrubyMethod, simpleName); ASTInspector.SCOPE_AWARE_METHODS.addAll(scopeAwareMethods);
public static void addMethodNamesToMap(Map<String, JRubyMethod> map, JRubyMethod jrubyMethod, String simpleName) { addMethodNamesToMap(map, jrubyMethod, simpleName, jrubyMethod.name(), jrubyMethod.alias()); }