public static CompiledBlockCallback19 createBlockCallback19(Object scriptObject, String closureMethod, String file, int line) { Class scriptClass = scriptObject.getClass(); ClassLoader scriptClassLoader = scriptClass.getClassLoader(); MethodFactory factory = MethodFactory.createFactory(scriptClassLoader); return factory.getBlockCallback19(closureMethod, file, line, scriptObject); }
public static CompiledBlockCallback19 createBlockCallback19(Object scriptObject, String closureMethod, String file, int line) { Class scriptClass = scriptObject.getClass(); ClassLoader scriptClassLoader = scriptClass.getClassLoader(); MethodFactory factory = MethodFactory.createFactory(scriptClassLoader); return factory.getBlockCallback19(closureMethod, file, line, scriptObject); }
public static CompiledBlockCallback createBlockCallback(Object scriptObject, String closureMethod, String file, int line) { Class scriptClass = scriptObject.getClass(); ClassLoader scriptClassLoader = scriptClass.getClassLoader(); MethodFactory factory = MethodFactory.createFactory(scriptClassLoader); return factory.getBlockCallback(closureMethod, file, line, scriptObject); }
public static CompiledBlockCallback createBlockCallback(Object scriptObject, String closureMethod, String file, int line) { Class scriptClass = scriptObject.getClass(); ClassLoader scriptClassLoader = scriptClass.getClassLoader(); MethodFactory factory = MethodFactory.createFactory(scriptClassLoader); return factory.getBlockCallback(closureMethod, file, line, scriptObject); }
public static byte[] defOffline(String rubyName, String javaName, String classPath, String invokerName, Arity arity, StaticScope scope, CallConfiguration callConfig, String filename, int line) { MethodFactory factory = MethodFactory.createFactory(Helpers.class.getClassLoader()); byte[] methodBytes = factory.getCompiledMethodOffline(rubyName, javaName, classPath, invokerName, arity, scope, callConfig, filename, line); return methodBytes; }
public static byte[] createBlockCallback19Offline(String classPath, String closureMethod, String file, int line) { MethodFactory factory = MethodFactory.createFactory(Helpers.class.getClassLoader()); return factory.getBlockCallback19Offline(closureMethod, file, line, classPath); }
public static byte[] createBlockCallback19Offline(String classPath, String closureMethod, String file, int line) { MethodFactory factory = MethodFactory.createFactory(Helpers.class.getClassLoader()); return factory.getBlockCallback19Offline(closureMethod, file, line, classPath); }
public static byte[] defOffline(String rubyName, String javaName, String classPath, String invokerName, Arity arity, StaticScope scope, CallConfiguration callConfig, String filename, int line) { MethodFactory factory = MethodFactory.createFactory(Helpers.class.getClassLoader()); byte[] methodBytes = factory.getCompiledMethodOffline(rubyName, javaName, classPath, invokerName, arity, scope, callConfig, filename, line); return methodBytes; }
public static byte[] createBlockCallbackOffline(String classPath, String closureMethod, String file, int line) { MethodFactory factory = MethodFactory.createFactory(Helpers.class.getClassLoader()); return factory.getBlockCallbackOffline(closureMethod, file, line, classPath); }
public static byte[] createBlockCallbackOffline(String classPath, String closureMethod, String file, int line) { MethodFactory factory = MethodFactory.createFactory(Helpers.class.getClassLoader()); return factory.getBlockCallbackOffline(closureMethod, file, line, classPath); }
public void defineAnnotatedMethod(Class clazz, String name) { // FIXME: This is probably not very efficient, since it loads all methods for each call boolean foundMethod = false; for (Method method : clazz.getDeclaredMethods()) { if (method.getName().equals(name) && defineAnnotatedMethod(method, MethodFactory.createFactory(getRuntime().getJRubyClassLoader()))) { foundMethod = true; } } if (!foundMethod) { throw new RuntimeException("No JRubyMethod present for method " + name + "on class " + clazz.getName()); } }
public void defineAnnotatedMethod(Class clazz, String name) { // FIXME: This is probably not very efficient, since it loads all methods for each call boolean foundMethod = false; for (Method method : clazz.getDeclaredMethods()) { if (method.getName().equals(name) && defineAnnotatedMethod(method, MethodFactory.createFactory(getRuntime().getJRubyClassLoader()))) { foundMethod = true; } } if (!foundMethod) { throw new RuntimeException("No JRubyMethod present for method " + name + "on class " + clazz.getName()); } }
public void defineAnnotatedMethod(Class clazz, String name) { // FIXME: This is probably not very efficient, since it loads all methods for each call boolean foundMethod = false; for (Method method : clazz.getDeclaredMethods()) { if (method.getName().equals(name) && defineAnnotatedMethod(method, MethodFactory.createFactory(getRuntime().getJRubyClassLoader()))) { foundMethod = true; } } if (!foundMethod) { throw new RuntimeException("No JRubyMethod present for method " + name + "on class " + clazz.getName()); } }
public void defineAnnotatedMethod(Class clazz, String name) { // FIXME: This is probably not very efficient, since it loads all methods for each call boolean foundMethod = false; for (Method method : clazz.getDeclaredMethods()) { if (method.getName().equals(name) && defineAnnotatedMethod(method, MethodFactory.createFactory(getRuntime().getJRubyClassLoader()))) { foundMethod = true; } } if (!foundMethod) { throw new RuntimeException("No JRubyMethod present for method " + name + "on class " + clazz.getName()); } }
public static IRubyObject defs(ThreadContext context, IRubyObject self, IRubyObject receiver, Object scriptObject, String rubyName, String javaName, StaticScope scope, int arity, String filename, int line, CallConfiguration callConfig, String parameterDesc) { Class compiledClass = scriptObject.getClass(); Ruby runtime = context.runtime; RubyClass rubyClass = performSingletonMethodChecks(runtime, receiver, rubyName); MethodFactory factory = MethodFactory.createFactory(compiledClass.getClassLoader()); DynamicMethod method = constructSingletonMethod( factory, rubyName, javaName, rubyClass, new SimpleSourcePosition(filename, line), arity, scope, scriptObject, callConfig, parameterDesc); rubyClass.addMethod(rubyName, method); callSingletonMethodHook(receiver,context, runtime.fastNewSymbol(rubyName)); return runtime.getNil(); }
public static IRubyObject defs(ThreadContext context, IRubyObject self, IRubyObject receiver, Object scriptObject, String rubyName, String javaName, StaticScope scope, int arity, String filename, int line, CallConfiguration callConfig, String parameterDesc) { Class compiledClass = scriptObject.getClass(); Ruby runtime = context.runtime; RubyClass rubyClass = performSingletonMethodChecks(runtime, receiver, rubyName); MethodFactory factory = MethodFactory.createFactory(compiledClass.getClassLoader()); DynamicMethod method = constructSingletonMethod( factory, rubyName, javaName, rubyClass, new SimpleSourcePosition(filename, line), arity, scope, scriptObject, callConfig, parameterDesc); rubyClass.addMethod(rubyName, method); callSingletonMethodHook(receiver,context, runtime.fastNewSymbol(rubyName)); return runtime.getNil(); }
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); } }
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); } }
public static IRubyObject def(ThreadContext context, IRubyObject self, Object scriptObject, String rubyName, String javaName, StaticScope scope, int arity, String filename, int line, CallConfiguration callConfig, String parameterDesc) { Class compiledClass = scriptObject.getClass(); Ruby runtime = context.runtime; RubyModule containingClass = context.getRubyClass(); Visibility visibility = context.getCurrentVisibility(); performNormalMethodChecks(containingClass, runtime, rubyName); MethodFactory factory = MethodFactory.createFactory(compiledClass.getClassLoader()); DynamicMethod method = constructNormalMethod( factory, javaName, rubyName, containingClass, new SimpleSourcePosition(filename, line), arity, scope, visibility, scriptObject, callConfig, parameterDesc); addInstanceMethod(containingClass, rubyName, method, visibility,context, runtime); return runtime.getNil(); }
public static IRubyObject def(ThreadContext context, IRubyObject self, Object scriptObject, String rubyName, String javaName, StaticScope scope, int arity, String filename, int line, CallConfiguration callConfig, String parameterDesc) { Class compiledClass = scriptObject.getClass(); Ruby runtime = context.runtime; RubyModule containingClass = context.getRubyClass(); Visibility visibility = context.getCurrentVisibility(); performNormalMethodChecks(containingClass, runtime, rubyName); MethodFactory factory = MethodFactory.createFactory(compiledClass.getClassLoader()); DynamicMethod method = constructNormalMethod( factory, javaName, rubyName, containingClass, new SimpleSourcePosition(filename, line), arity, scope, visibility, scriptObject, callConfig, parameterDesc); addInstanceMethod(containingClass, rubyName, method, visibility,context, runtime); return runtime.getNil(); }