@Override public CacheEntry newCacheEntry(String id, DynamicMethod method, int token) { return new CacheEntry(method, token); } };
public final CacheEntry retrieveCache(RubyClass selfType, String methodName) { // This must be retrieved *once* to avoid racing with other threads. CacheEntry cache = this.cache; if (cache.typeOk(selfType)) { return cache; } return cacheAndGet(selfType, methodName); }
public final CacheEntry retrieveCache(RubyClass selfType) { // This must be retrieved *once* to avoid racing with other threads. CacheEntry cache = this.cache; if (cache.typeOk(selfType)) { return cache; } return cacheAndGet(selfType, methodName); }
@Override public CacheEntry newCacheEntry(DynamicMethod method, int token) { return new CacheEntry(method, token); } };
public CacheEntry retrieveCache(RubyClass selfType, String methodName) { CacheEntry myCache = cache; if (CacheEntry.typeOk(myCache, selfType)) { return myCache; } return cacheAndGet(selfType, methodName); }
@Override public CacheEntry newCacheEntry(String id, DynamicMethod method, int token) { return new CacheEntry(method, token); } };
public DynamicMethod getMethod(ThreadContext context, RubyClass selfType, int index, String methodName) { CacheEntry myCache = getCacheEntry(index); if (myCache.typeOk(selfType)) { return myCache.method; } return cacheAndGet(context, selfType, index, methodName); }
@Override public CacheEntry newCacheEntry(String id, DynamicMethod method, int token) { if (method.isUndefined()) return new CacheEntry(method, token); CacheEntry delegated = previous.newCacheEntry(id, method, token); DynamicMethod enhancedMethod = getMethodEnhancer().enhance(id, delegated.method); return new CacheEntry(enhancedMethod, delegated.token); } }
public final boolean isBuiltin(RubyClass selfType) { // This must be retrieved *once* to avoid racing with other threads. CacheEntry cache = this.cache; if (cache.typeOk(selfType)) { return cache.method.isBuiltin(); } return cacheAndGetBuiltin(selfType, methodName); }
@Override public CacheEntry newCacheEntry(String id,DynamicMethod method, int token) { if (method.isUndefined()) { return new CacheEntry(method, token); } // delegate up the chain CacheEntry delegated = previous.newCacheEntry(id, method, token); return new CacheEntry(new SynchronizedDynamicMethod(delegated.method), delegated.token); } }
public DynamicMethod getMethod(ThreadContext context, RubyClass selfType, int index, String methodName) { CacheEntry myCache = getCacheEntry(index); if (CacheEntry.typeOk(myCache, selfType)) { return myCache.method; } return cacheAndGet(context, selfType, index, methodName); }
@Override public CacheEntry newCacheEntry(DynamicMethod method, int token) { if (method.isUndefined()) { return new CacheEntry(method, token); } CacheEntry delegated = previous.newCacheEntry(method, token); return new CacheEntry(new ProfilingDynamicMethod(delegated.method), delegated.token); } }
public DynamicMethod getMethod(ThreadContext context, RubyClass selfType, int index, String methodName) { CacheEntry myCache = getCacheEntry(index); if (myCache.typeOk(selfType)) { return myCache.method; } return cacheAndGet(context, selfType, index, methodName); }
@Override public CacheEntry newCacheEntry(String id,DynamicMethod method, int token) { if (method.isUndefined()) { return new CacheEntry(method, token); } // delegate up the chain CacheEntry delegated = previous.newCacheEntry(id, method, token); return new CacheEntry(new SynchronizedDynamicMethod(delegated.method), delegated.token); } }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject... args) { RubyClass selfType = getMetaClass(self);; // This must be retrieved *once* to avoid racing with other threads. CacheEntry cache = this.cache; if (cache.typeOk(selfType)) { return cache.method.call(context, self, selfType, methodName, args); } return cacheAndCall(caller, selfType, args, context, self); }
@Override public CacheEntry newCacheEntry(String id, DynamicMethod method, int token) { if (method.isUndefined()) return new CacheEntry(method, token); CacheEntry delegated = previous.newCacheEntry(id, method, token); DynamicMethod enhancedMethod = getMethodEnhancer().enhance(id, delegated.method); return new CacheEntry(enhancedMethod, delegated.token); } }
public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject[] args, Block block) { RubyClass selfType = getMetaClass(self); // This must be retrieved *once* to avoid racing with other threads. CacheEntry cache = this.cache; if (cache.typeOk(selfType)) { return cache.method.call(context, self, selfType, methodName, args, block); } return cacheAndCall(caller, selfType, block, args, context, self); }
public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, Block block) { RubyClass selfType = getMetaClass(self); // This must be retrieved *once* to avoid racing with other threads. CacheEntry cache = this.cache; if (cache.typeOk(selfType)) { return cache.method.call(context, self, selfType, methodName, block); } return cacheAndCall(caller, selfType, block, context, self); }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self, IRubyObject arg1) { RubyClass selfType = getMetaClass(self); // This must be retrieved *once* to avoid racing with other threads. CacheEntry cache = this.cache; if (cache.typeOk(selfType)) { return cache.method.call(context, self, selfType, methodName, arg1); } return cacheAndCall(caller, selfType, context, self, arg1); }
@Override public IRubyObject call(ThreadContext context, IRubyObject caller, IRubyObject self) { RubyClass selfType = getMetaClass(self); // This must be retrieved *once* to avoid racing with other threads. CacheEntry cache = this.cache; if (cache.typeOk(selfType)) { return cache.method.call(context, self, selfType, methodName); } return cacheAndCall(caller, selfType, context, self); }