Beispiel #1
0
  public static IRubyObject fallback(
      JRubyCallSite site,
      ThreadContext context,
      IRubyObject caller,
      IRubyObject self,
      String name,
      IRubyObject[] args,
      Block block) {
    RubyClass selfClass = pollAndGetClass(context, self);
    CacheEntry entry = selfClass.searchWithCache(name);

    try {
      if (methodMissing(entry, site.callType(), name, caller)) {
        return callMethodMissing(entry, site.callType(), context, self, name, args, block);
      }
      site.setTarget(createGWT(TEST_N_B, TARGET_N_B, FALLBACK_N_B, entry, site));
      return entry.method.call(context, self, selfClass, name, args, block);
    } catch (JumpException.BreakJump bj) {
      return handleBreakJump(context, bj);
    } catch (JumpException.RetryJump rj) {
      return retryJumpError(context);
    } finally {
      block.escape();
    }
  }
Beispiel #2
0
  public static IRubyObject fallback(
      JRubyCallSite site,
      ThreadContext context,
      IRubyObject caller,
      IRubyObject self,
      String name) {
    RubyClass selfClass = pollAndGetClass(context, self);
    CacheEntry entry = selfClass.searchWithCache(name);
    if (methodMissing(entry, site.callType(), name, caller)) {
      return callMethodMissing(entry, site.callType(), context, self, name);
    }
    site.setTarget(createGWT(TEST_0, TARGET_0, FALLBACK_0, entry, site));

    return entry.method.call(context, self, selfClass, name);
  }