Пример #1
0
 public DynamicMethod searchWithCache(RubyClass clazz, int index, String name1) {
   CacheEntry entry = clazz.searchWithCache(name1);
   DynamicMethod method = entry.method;
   if (entry.method == UndefinedMethod.INSTANCE) {
     return RuntimeHelpers.selectMethodMissing(
         clazz, method.getVisibility(), name1, CallType.FUNCTIONAL);
   }
   methodCache[index] = entry;
   return method;
 }
Пример #2
0
 private DynamicMethod cacheAndGet(
     ThreadContext context, RubyClass selfType, int index, String methodName) {
   CacheEntry entry = selfType.searchWithCache(methodName);
   DynamicMethod method = entry.method;
   if (method.isUndefined()) {
     return RuntimeHelpers.selectMethodMissing(
         context, selfType, method.getVisibility(), methodName, CallType.FUNCTIONAL);
   }
   methodCache[index] = entry;
   return method;
 }
Пример #3
0
 private static IRubyObject callMethodMissing(
     CacheEntry entry,
     CallType callType,
     ThreadContext context,
     IRubyObject self,
     String name,
     IRubyObject arg) {
   return RuntimeHelpers.selectMethodMissing(
           context, self, entry.method.getVisibility(), name, callType)
       .call(context, self, self.getMetaClass(), name, arg, Block.NULL_BLOCK);
 }