private int getArg0Generation(CachingCallSite op_cmp) { IRubyObject arg0 = eltInternal(0); RubyClass metaclass = arg0.getMetaClass(); CacheEntry entry = op_cmp.retrieveCache(metaclass); int generation = -1; if (entry.method.isBuiltin()) { generation = entry.token; } return generation; }
private int getArg0Generation(CachingCallSite op_cmp) { IRubyObject arg0 = eltInternal(0); RubyClass metaclass = arg0.getMetaClass(); CacheEntry entry = op_cmp.retrieveCache(metaclass); int generation = -1; if (entry.method.isBuiltin()) { generation = entry.token; } return generation; }
@Override public IRubyObject isNegative(ThreadContext context) { Ruby runtime = context.runtime; CachingCallSite op_lt_site = sites(context).basic_op_lt; if (op_lt_site.retrieveCache(metaClass).method.isBuiltin()) { return runtime.newBoolean(value.signum() < 0); } return op_lt_site.call(context, this, this, RubyFixnum.zero(runtime)); }
@Override public IRubyObject isPositive(ThreadContext context) { Ruby runtime = context.runtime; CachingCallSite op_gt_site = sites(context).basic_op_gt; if (op_gt_site.retrieveCache(metaClass).method.isBuiltin()) { return runtime.newBoolean(value.signum() > 0); } return op_gt_site.call(context, this, this, RubyFixnum.zero(runtime)); }
@Override public IRubyObject isNegative(ThreadContext context) { Ruby runtime = context.runtime; CachingCallSite op_lt_site = sites(context).basic_op_lt; if (op_lt_site.retrieveCache(metaClass).method.isBuiltin()) { return runtime.newBoolean(value.signum() < 0); } return op_lt_site.call(context, this, this, RubyFixnum.zero(runtime)); }
@Override public IRubyObject isPositive(ThreadContext context) { Ruby runtime = context.runtime; CachingCallSite op_gt_site = sites(context).basic_op_gt; if (op_gt_site.retrieveCache(metaClass).method.isBuiltin()) { return runtime.newBoolean(value.signum() > 0); } return op_gt_site.call(context, this, this, RubyFixnum.zero(runtime)); }
private IRubyObject checkFuncallDefault(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites, IRubyObject[] args) { final RubyClass klass = this; if (!checkFuncallRespondTo(context, klass, self, sites.respond_to_X)) return null; // return def; DynamicMethod method = sites.site.retrieveCache(klass).method; if (!checkFuncallCallable(context, method, CallType.FUNCTIONAL, self)) { return checkFuncallMissing(context, klass, self, sites.methodName, sites.respond_to_missing, sites.method_missing, args); } return method.call(context, self, klass, sites.methodName, args); }
private IRubyObject checkFuncallDefault(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites) { final RubyClass klass = this; if (!checkFuncallRespondTo(context, klass, self, sites.respond_to_X)) return null; // return def; DynamicMethod method = sites.site.retrieveCache(klass).method; if (!checkFuncallCallable(context, method, CallType.FUNCTIONAL, self)) { return checkFuncallMissing(context, klass, self, sites.methodName, sites.respond_to_missing, sites.method_missing); } return method.call(context, self, klass, sites.methodName); }
private IRubyObject checkFuncallDefault(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites, IRubyObject[] args) { final RubyClass klass = this; if (!checkFuncallRespondTo(context, klass, self, sites.respond_to_X)) return null; // return def; DynamicMethod method = sites.site.retrieveCache(klass).method; if (!checkFuncallCallable(context, method, CallType.FUNCTIONAL, self)) { return checkFuncallMissing(context, klass, self, sites.methodName, sites.respond_to_missing, sites.method_missing, args); } return method.call(context, self, klass, sites.methodName, args); }
private IRubyObject checkFuncallDefault(ThreadContext context, IRubyObject self, JavaSites.CheckedSites sites) { final RubyClass klass = this; if (!checkFuncallRespondTo(context, klass, self, sites.respond_to_X)) return null; // return def; DynamicMethod method = sites.site.retrieveCache(klass).method; if (!checkFuncallCallable(context, method, CallType.FUNCTIONAL, self)) { return checkFuncallMissing(context, klass, self, sites.methodName, sites.respond_to_missing, sites.method_missing); } return method.call(context, self, klass, sites.methodName); }
@Override public IRubyObject isPositive(ThreadContext context) { Ruby runtime = context.runtime; CachingCallSite op_gt_site = sites(context).basic_op_gt; if (op_gt_site.retrieveCache(metaClass).method.isBuiltin()) { return runtime.newBoolean(value > 0); } return op_gt_site.call(context, this, this, RubyFixnum.zero(runtime)); }
@Override public IRubyObject isNegative(ThreadContext context) { Ruby runtime = context.runtime; CachingCallSite op_lt_site = sites(context).basic_op_lt; if (op_lt_site.retrieveCache(metaClass).method.isBuiltin()) { return runtime.newBoolean(value < 0); } return op_lt_site.call(context, this, this, RubyFixnum.zero(runtime)); }
@Override public IRubyObject isNegative(ThreadContext context) { Ruby runtime = context.runtime; CachingCallSite op_lt_site = sites(context).basic_op_lt; if (op_lt_site.retrieveCache(metaClass).method.isBuiltin()) { return runtime.newBoolean(value < 0); } return op_lt_site.call(context, this, this, RubyFixnum.zero(runtime)); }
@Override public IRubyObject isPositive(ThreadContext context) { Ruby runtime = context.runtime; CachingCallSite op_gt_site = sites(context).basic_op_gt; if (op_gt_site.retrieveCache(metaClass).method.isBuiltin()) { return runtime.newBoolean(value > 0); } return op_gt_site.call(context, this, this, RubyFixnum.zero(runtime)); }
public static DynamicMethod getConversionMethod(IRubyObject parameter, CachingCallSite callSite) { DynamicMethod method = callSite.retrieveCache(parameter.getMetaClass(), callSite.getMethodName()).method; if (method.isUndefined()) { throw parameter.getRuntime().newTypeError("cannot convert parameter of type " + parameter.getMetaClass() + " to native pointer; does not respond to :" + callSite.getMethodName()); } return method; }
public static DynamicMethod getConversionMethod(IRubyObject parameter, CachingCallSite callSite) { DynamicMethod method = callSite.retrieveCache(parameter.getMetaClass(), callSite.getMethodName()).method; if (method.isUndefined()) { throw parameter.getRuntime().newTypeError("cannot convert parameter of type " + parameter.getMetaClass() + " to native pointer; does not respond to :" + callSite.getMethodName()); } return method; }
public static DynamicMethod getConversionMethod(IRubyObject parameter, CachingCallSite callSite) { DynamicMethod method = callSite.retrieveCache(parameter.getMetaClass(), callSite.getMethodName()).method; if (method.isUndefined()) { throw parameter.getRuntime().newTypeError("cannot convert parameter of type " + parameter.getMetaClass() + " to native pointer; does not respond to :" + callSite.getMethodName()); } return method; }
NativeCallbackPointer newCallback(IRubyObject callable, CachingCallSite callSite) { if (callSite.retrieveCache(callable.getMetaClass(), callSite.getMethodName()).method.isUndefined()) { throw runtime.newArgumentError("callback does not respond to :" + callSite.getMethodName()); } return new NativeCallbackPointer(runtime, callbackClass, closurePool.newClosureHandle(new NativeClosureProxy(runtime, closureInfo, callable, callSite)), callbackInfo, closureInfo); }
NativeCallbackPointer newCallback(IRubyObject callable, CachingCallSite callSite) { if (callSite.retrieveCache(callable.getMetaClass(), callSite.getMethodName()).method.isUndefined()) { throw runtime.newArgumentError("callback does not respond to :" + callSite.getMethodName()); } return new NativeCallbackPointer(runtime, callbackClass, closurePool.newClosureHandle(new NativeClosureProxy(runtime, closureInfo, callable, callSite)), callbackInfo, closureInfo); }
NativeCallbackPointer newCallback(IRubyObject callable, CachingCallSite callSite) { if (callSite.retrieveCache(callable.getMetaClass(), callSite.getMethodName()).method.isUndefined()) { throw runtime.newArgumentError("callback does not respond to :" + callSite.getMethodName()); } return new NativeCallbackPointer(runtime, callbackClass, closurePool.newClosureHandle(new NativeClosureProxy(runtime, closureInfo, callable, callSite)), callbackInfo, closureInfo); }