public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName, arg0); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 1, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0); }
public static IRubyObject invoke(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.NORMAL, methodName, self)) { return callMethodMissing(entry, CallType.NORMAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 2, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1); }
public static IRubyObject invoke(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.NORMAL, methodName, self)) { return callMethodMissing(entry, CallType.NORMAL, context, self, methodName, arg0); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 1, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0); }
public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName, arg0, arg1, arg2); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 3, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1, arg2); }
public static IRubyObject invoke(InvokeSite site, ThreadContext context, IRubyObject self) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.NORMAL, methodName, self)) { return callMethodMissing(entry, CallType.NORMAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 0, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self); }
public static IRubyObject invoke(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.NORMAL, methodName, self)) { return callMethodMissing(entry, CallType.NORMAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 3, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1, arg2); }
public static IRubyObject invoke(InvokeSite site, ThreadContext context, IRubyObject self) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.NORMAL, methodName, self)) { return callMethodMissing(entry, CallType.NORMAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 0, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self); }
public static IRubyObject invoke(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.NORMAL, methodName, self)) { return callMethodMissing(entry, CallType.NORMAL, context, self, methodName, arg0); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 1, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0); }
public static IRubyObject invoke(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.NORMAL, methodName, self)) { return callMethodMissing(entry, CallType.NORMAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 3, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1, arg2); }
public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName, arg0, arg1); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 2, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1); }
public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName, arg0, arg1, arg2); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 3, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1, arg2); }
public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 0, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self); }
public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName, arg0, arg1); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 2, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1); }
public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 0, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self); }
public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName, arg0); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 1, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0); }
public static IRubyObject invoke(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1) throws Throwable { RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.NORMAL, methodName, self)) { return callMethodMissing(entry, CallType.NORMAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 2, false); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1); }
public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block) throws Throwable { // TODO: literal block wrapper for break, etc RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName, arg0, arg1); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 2, true); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1, block); }
public static IRubyObject invokeSelf(InvokeSite site, ThreadContext context, IRubyObject self, Block block) throws Throwable { // TODO: literal block handling of break, etc RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.FUNCTIONAL, methodName, self)) { return callMethodMissing(entry, CallType.FUNCTIONAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 0, true); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, block); }
public static IRubyObject invoke(InvokeSite site, ThreadContext context, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) throws Throwable { // TODO: literal block handling of break, etc RubyClass selfClass = self.getMetaClass(); String methodName = site.name; SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(methodName); DynamicMethod method = entry.method; if (methodMissing(entry, CallType.NORMAL, methodName, self)) { return callMethodMissing(entry, CallType.NORMAL, context, self, methodName); } MethodHandle mh = getHandle(selfClass, switchPoint, site, method, 3, true); site.setTarget(mh); return (IRubyObject)mh.invokeWithArguments(context, self, arg0, arg1, arg2, block); }
public static IRubyObject invocationFallback(JRubyCallSite site, ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) throws Throwable { RubyClass selfClass = pollAndGetClass(context, self); String method = site.name(); SwitchPoint switchPoint = (SwitchPoint)selfClass.getInvalidator().getData(); CacheEntry entry = selfClass.searchWithCache(method); if (methodMissing(entry, site.callType(), method, caller)) { IRubyObject mmResult = callMethodMissing(entry, site.callType(), context, self, method, arg0, arg1, arg2); // TODO: replace with handle logic return site.isAttrAssign() ? arg2 : mmResult; } MethodHandle target = getTarget(site, selfClass, entry, 3); target = updateInvocationTarget(target, site, self, selfClass, method, entry, switchPoint, false, 3); return (IRubyObject)target.invokeWithArguments(context, caller, self, arg0, arg1, arg2); }