(2013/02/16 18:31), charliesome (Charlie Somerville) wrote:
> 
> Issue #7816 has been updated by charliesome (Charlie Somerville).
> 
> File feature-7816-v3.patch added
> Subject changed from Don't invalidate method caches when defining a new method on a class without subclasses to Don't invalidate method caches when defining a new method on a class without subclasses
> 
> I have updated my patch to not clear the cache when a class is garbage collected.
> 
> My reasoning is that if a class is garbage collected, then no objects of that class could possibly exist, so the method cache would never be hit.

I found another problem:

Now VM caches method_missing.

class C0
  def method_missing *args
  end
end

class C1 < C0
end

obj = C1.new

2.times{
  obj.foo
  class C1
    def foo; end
  end unless obj.respond_to? :foo
}

In this case, C0#method_missing will be called twice if cache is not
invalidated.

-- 
// SASADA Koichi at atdot dot net