private int pendingInterruptCheckMask(ThreadContext context, IRubyObject err) { List<IRubyObject> ancestors = err.getMetaClass().getAncestorList(); int ancestorsLen = ancestors.size(); List<RubyHash> maskStack = interruptMaskStack; int maskStackLen = maskStack.size(); for (int i = 0; i < maskStackLen; i++) { RubyHash mask = maskStack.get(maskStackLen - (i + 1)); for (int j = 0; j < ancestorsLen; j++) { IRubyObject klass = ancestors.get(j); IRubyObject sym; if (!(sym = mask.op_aref(context, klass)).isNil()) { String symStr = sym.toString(); switch (symStr) { case "immediate": return INTERRUPT_IMMEDIATE; case "on_blocking": return INTERRUPT_ON_BLOCKING; case "never": return INTERRUPT_NEVER; default: throw context.runtime.newThreadError("unknown mask signature"); } } } } return INTERRUPT_NONE; }
private int pendingInterruptCheckMask(ThreadContext context, IRubyObject err) { List<IRubyObject> ancestors = err.getMetaClass().getAncestorList(); int ancestorsLen = ancestors.size(); List<RubyHash> maskStack = interruptMaskStack; int maskStackLen = maskStack.size(); for (int i = 0; i < maskStackLen; i++) { RubyHash mask = maskStack.get(maskStackLen - (i + 1)); for (int j = 0; j < ancestorsLen; j++) { IRubyObject klass = ancestors.get(j); IRubyObject sym; if (!(sym = mask.op_aref(context, klass)).isNil()) { String symStr = sym.toString(); switch (symStr) { case "immediate": return INTERRUPT_IMMEDIATE; case "on_blocking": return INTERRUPT_ON_BLOCKING; case "never": return INTERRUPT_NEVER; default: throw context.runtime.newThreadError("unknown mask signature"); } } } } return INTERRUPT_NONE; }
/** * Invokes all the defined read_completed methods. */ /*package*/ static void callReadCompleted(IRubyObject o) { Ruby runtime = o.getRuntime(); RubySymbol read_completed = runtime.newSymbol("read_completed"); List<IRubyObject> ancestors = o.getType().getAncestorList(); for (int i = ancestors.size() - 1; i >= 0; i--) { RubyModule t= (RubyModule) ancestors.get(i); if (t.callMethod("method_defined?", read_completed).isTrue() || t.callMethod("private_method_defined?", read_completed).isTrue()) { ThreadContext c = runtime.getCurrentContext(); IRubyObject m = t.callMethod("instance_method", read_completed); m.callMethod(c,"bind",o).callMethod(c, "call"); } } }
for ( IRubyObject ancestorObject: clazz.getAncestorList() ) { RubyModule ancestor = (RubyModule) ancestorObject; if (ancestor instanceof RubyClass) {
for ( IRubyObject ancestorObject: clazz.getAncestorList() ) { RubyModule ancestor = (RubyModule) ancestorObject; if (ancestor instanceof RubyClass) {
List<Class<?>> interfaceList = new ArrayList<Class<?>>(); List<IRubyObject> ancestors = clazz.getAncestorList(); boolean skipRemainingClasses = false; for (IRubyObject ancestorObject: ancestors) {
List<Class<?>> interfaceList = new ArrayList<Class<?>>(); List<IRubyObject> ancestors = clazz.getAncestorList(); boolean skipRemainingClasses = false; for (IRubyObject ancestorObject: ancestors) {