public static CallSite getSuperCallSite() { return new SuperCallSite(); } }
public IRubyObject callVarargs(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject... args) { switch (args.length) { case 0: return call(context, caller, self); case 1: return call(context, caller, self, args[0]); case 2: return call(context, caller, self, args[0], args[1]); case 3: return call(context, caller, self, args[0], args[1], args[2]); default: return call(context, caller, self, args); } }
public IRubyObject callVarargsIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) { switch (args.length) { case 0: return callIter(context, caller, self, block); case 1: return callIter(context, caller, self, args[0], block); case 2: return callIter(context, caller, self, args[0], args[1], block); case 3: return callIter(context, caller, self, args[0], args[1], args[2], block); default: return callIter(context, caller, self, args, block); } }
public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) { try { return callBlock(context, caller, self, args, block); } catch (JumpException.BreakJump bj) { return handleBreakJump(context, bj); } catch (JumpException.RetryJump rj) { throw retryJumpError(context); } }
public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject... args) { RubyModule klazz = context.getFrameKlazz(); String name = context.getFrameName(); RubyClass selfType = pollAndGetClass(context, self, klazz, name); SuperTuple myCache = cache; if (selfType != null && myCache.cacheOk(name, selfType)) { return myCache.cache.method.call(context, self, selfType, name, args); } return cacheAndCall(caller, selfType, args, context, self, name); }
protected IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, ThreadContext context, IRubyObject self, String name, IRubyObject arg) { CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE; DynamicMethod method = entry.method; if (methodMissing(method, caller)) { return callMethodMissing(context, self, selfType, name, method, arg); } cache = new SuperTuple(name, entry); return method.call(context, self, selfType, name, arg); }
protected static RubyClass pollAndGetClass(ThreadContext context, IRubyObject self, RubyModule frameClass, String frameName) { checkSuperDisabledOrOutOfMethod(context, frameClass, frameName); RubyClass superClass = Helpers.findImplementerIfNecessary(self.getMetaClass(), frameClass).getSuperClass(); return superClass; }
public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) { RubyModule klazz = context.getFrameKlazz(); String name = context.getFrameName(); RubyClass selfType = pollAndGetClass(context, self, klazz, name); SuperTuple myCache = cache; if (selfType != null && myCache.cacheOk(name, selfType)) { return myCache.cache.method.call(context, self, selfType, name, args, block); } return cacheAndCall(caller, selfType, block, args, context, self, name); }
protected IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, Block block, ThreadContext context, IRubyObject self, String name, IRubyObject arg) { CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE; DynamicMethod method = entry.method; if (methodMissing(method, caller)) { return callMethodMissing(context, self, selfType, name, method, arg, block); } cache = new SuperTuple(name, entry); return method.call(context, self, selfType, name, arg, block); }
public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block) { try { return callBlock(context, caller, self, arg1, arg2, arg3, block); } catch (JumpException.BreakJump bj) { return handleBreakJump(context, bj); } catch (JumpException.RetryJump rj) { throw retryJumpError(context); } }
protected static RubyClass pollAndGetClass(ThreadContext context, IRubyObject self, RubyModule frameClass, String frameName) { checkSuperDisabledOrOutOfMethod(context, frameClass, frameName); RubyClass superClass = Helpers.findImplementerIfNecessary(self.getMetaClass(), frameClass).getSuperClass(); return superClass; }
public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1) { RubyModule klazz = context.getFrameKlazz(); String name = context.getFrameName(); RubyClass selfType = pollAndGetClass(context, self, klazz, name); SuperTuple myCache = cache; if (selfType != null && myCache.cacheOk(name, selfType)) { return myCache.cache.method.call(context, self, selfType, name, arg1); } return cacheAndCall(caller, selfType, context, self, name, arg1); }
protected IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, ThreadContext context, IRubyObject self, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) { CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE; DynamicMethod method = entry.method; if (methodMissing(method, caller)) { return callMethodMissing(context, self, selfType, name, method, arg1, arg2, arg3); } cache = new SuperTuple(name, entry); return method.call(context, self, selfType, name, arg1, arg2, arg3); }
public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) { try { return callBlock(context, caller, self, args, block); } catch (JumpException.BreakJump bj) { return handleBreakJump(context, bj); } catch (JumpException.RetryJump rj) { throw retryJumpError(context); } }
public IRubyObject callVarargs(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) { switch (args.length) { case 0: return call(context, caller, self, block); case 1: return call(context, caller, self, args[0], block); case 2: return call(context, caller, self, args[0], args[1], block); case 3: return call(context, caller, self, args[0], args[1], args[2], block); default: return call(context, caller, self, args, block); } }
public IRubyObject callVarargsIter(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) { switch (args.length) { case 0: return callIter(context, caller, self, block); case 1: return callIter(context, caller, self, args[0], block); case 2: return callIter(context, caller, self, args[0], args[1], block); case 3: return callIter(context, caller, self, args[0], args[1], args[2], block); default: return callIter(context, caller, self, args, block); } }
public static CallSite getSuperCallSite() { return new SuperCallSite(); }
private IRubyObject callBlock(ThreadContext context, IRubyObject caller, IRubyObject self, Block block) { RubyModule klazz = context.getFrameKlazz(); String name = context.getFrameName(); RubyClass selfType = pollAndGetClass(context, self, klazz, name); SuperTuple myCache = cache; if (selfType != null && myCache.cacheOk(name, selfType)) { return myCache.cache.method.call(context, self, selfType, name, block); } return cacheAndCall(caller, selfType, block, context, self, name); }
protected IRubyObject cacheAndCall(IRubyObject caller, RubyClass selfType, ThreadContext context, IRubyObject self, String name, IRubyObject arg) { CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE; DynamicMethod method = entry.method; if (methodMissing(method, caller)) { return callMethodMissing(context, self, name, method, arg); } cache = new SuperTuple(name, entry); return method.call(context, self, selfType, name, arg); }
public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1, Block block) { try { return callBlock(context, caller, self, arg1, block); } catch (JumpException.BreakJump bj) { return handleBreakJump(context, bj); } catch (JumpException.RetryJump rj) { throw retryJumpError(context); } }