private boolean hasSingletonMethods(RubyClass type) { for(DynamicMethod method : type.getMethods().values()) { // We do not want to capture cached methods if(method.getImplementationClass() == type) { return true; } } return false; }
private boolean hasSingletonMethods(RubyClass type) { for(DynamicMethod method : type.getMethods().values()) { // We do not want to capture cached methods if(method.getImplementationClass() == type) { return true; } } return false; }
@Override public RubyModule getImplementationClass() { if (compiledMethod == null) initializeMethod(); return compiledMethod.getImplementationClass(); }
public int getCachedClassIndex() { CacheEntry cacheEntry = getCache(); if (cacheEntry != CacheEntry.NULL_CACHE) { return cacheEntry.method.getImplementationClass().index; } return ClassIndex.NO_INDEX; }
public MethodMissingMethod(DynamicMethod delegate, Visibility lastVisibility, CallType lastCallStatus) { super(delegate.getImplementationClass(), lastVisibility, delegate.getName()); this.delegate = delegate; this.lastCallStatus = lastCallStatus; this.lastVisibility = lastVisibility; }
@Override public RubyModule getImplementationClass() { if (compiledMethod == null) initializeMethod(); return compiledMethod.getImplementationClass(); }
public MethodMissingMethod(DynamicMethod delegate, Visibility lastVisibility, CallType lastCallStatus) { super(delegate.getImplementationClass(), lastVisibility, delegate.getName()); this.delegate = delegate; this.lastCallStatus = lastCallStatus; this.lastVisibility = lastVisibility; }
public int getCachedClassIndex() { CacheEntry cacheEntry = getCache(); if (cacheEntry != CacheEntry.NULL_CACHE) { return cacheEntry.method.getImplementationClass().index; } return ClassIndex.NO_INDEX; }
@Override public List<MethodRef> getDeclaredMethods(RubyModule clazz) { List<MethodRef> r = new ArrayList<MethodRef>(); for (DynamicMethod m : clazz.getMethods().values()) { // TODO: not sure if this is entirely correct if (m.getImplementationClass()==clazz) r.add(new RubyMethodRef(clazz,m)); } return r; }
@JIT public static IRubyObject invokeModuleBody(ThreadContext context, DynamicMethod method, Block block) { RubyModule implClass = method.getImplementationClass(); return method.call(context, implClass, implClass, "", block); }
@JIT public static IRubyObject invokeModuleBody(ThreadContext context, DynamicMethod method, Block block) { RubyModule implClass = method.getImplementationClass(); return method.call(context, implClass, implClass, "", block); }
public DelegatingDynamicMethod(DynamicMethod delegate) { super(delegate.getImplementationClass(), delegate.getVisibility(), delegate.getName()); this.delegate = delegate; }
public final int getCachedClassIndex() { CacheEntry cacheEntry = cache; if (cacheEntry != CacheEntry.NULL_CACHE) { return cacheEntry.method.getImplementationClass().getClassIndex().ordinal(); } return ClassIndex.NO_INDEX.ordinal(); }
public final int getCachedClassIndex() { CacheEntry cacheEntry = cache; if (cacheEntry != CacheEntry.NULL_CACHE) { return cacheEntry.method.getImplementationClass().getClassIndex().ordinal(); } return ClassIndex.NO_INDEX.ordinal(); }
static String methodName(ProfiledMethod profileMethod) { final String displayName; if (profileMethod != null) { DynamicMethod method = profileMethod.getMethod(); String id = profileMethod.getName(); if (id == null) id = method.getName(); displayName = moduleHashMethod(method.getImplementationClass(), id.toString()); } else { displayName = "<unknown>"; } // System.out.printf("%d - %s\n", serial, displayName); return displayName; }
static String methodName(ProfiledMethod profileMethod) { final String displayName; if (profileMethod != null) { DynamicMethod method = profileMethod.getMethod(); String id = profileMethod.getName(); if (id == null) id = method.getName(); displayName = moduleHashMethod(method.getImplementationClass(), id.toString()); } else { displayName = "<unknown>"; } // System.out.printf("%d - %s\n", serial, displayName); return displayName; }
public static ArgumentDescriptor[] methodToArgumentDescriptors(DynamicMethod method) { method = method.getRealMethod(); if (method instanceof MethodArgs2) { return parameterListToArgumentDescriptors(method.getImplementationClass().getRuntime(), ((MethodArgs2) method).getParameterList(), true); } else if (method instanceof IRMethodArgs) { return ((IRMethodArgs) method).getArgumentDescriptors(); } else { return new ArgumentDescriptor[]{new ArgumentDescriptor(ArgumentType.anonrest)}; } }
public static ArgumentDescriptor[] methodToArgumentDescriptors(DynamicMethod method) { method = method.getRealMethod(); if (method instanceof MethodArgs2) { return parameterListToArgumentDescriptors(method.getImplementationClass().getRuntime(), ((MethodArgs2) method).getParameterList(), true); } else if (method instanceof IRMethodArgs) { return ((IRMethodArgs) method).getArgumentDescriptors(); } else { return new ArgumentDescriptor[]{new ArgumentDescriptor(ArgumentType.anonrest)}; } }
public static Block createMethodBlock(MethodBlockBody body) { RubyModule module = body.method.getImplementationClass(); Frame frame = new Frame(); frame.setKlazz(module); frame.setName(body.method.getName()); frame.setSelf(body.receiver); frame.setVisibility(body.method.getVisibility()); Binding binding = new Binding( frame, body.getStaticScope().getDummyScope(), body.method.getName(), body.getFile(), body.getLine()); return new Block(body, binding); }
public static Block createMethodBlock(MethodBlockBody body) { RubyModule module = body.method.getImplementationClass(); Frame frame = new Frame(); frame.setKlazz(module); frame.setName(body.method.getName()); frame.setSelf(body.receiver); frame.setVisibility(body.method.getVisibility()); Binding binding = new Binding( frame, body.getStaticScope().getDummyScope(), body.method.getName(), body.getFile(), body.getLine()); return new Block(body, binding); }