Shared "box" in DefaultMethod breaking visibility re-checks in some cases
-------------------------------------------------------------------------

                 Key: JRUBY-3861
                 URL: http://jira.codehaus.org/browse/JRUBY-3861
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
            Reporter: Charles Oliver Nutter
             Fix For: JRuby 1.4


We added a "box" to DefaultMethod so that when methods get dup'ed they would 
hold references to the same callCount and "realMethod" and would not end up 
re-jitting repeatedly.

Somewhat after that I modified caching logic in RubyModule to cache the 
"realMethod" directly, thus cutting the intermediate DefaultMethod object out 
of the call stack after jitting had happened.

Unfortunately these two changes cause visibility change to be handled 
incorrectly for dup'ed methods (i.e. as a result of cloning a class).

This only affects jitted execution of methods that have been dup'ed and then 
had their visibility changed. Here's a simple test, distilled out of 
test/rubicon/test_module.rb, which has been failing since the second change 
above when run in jitted mode:

{noformat}
class TestModule
  class AClass
    def AClass.cm1
      "cm1"
    end
    def AClass.cm2
      cm1
    end
    
    private_class_method :cm1

  end
  MyClass = AClass.clone
  class MyClass
    public_class_method :cm1
  end

  def test_public_class_method
    AClass.cm2
    MyClass.cm1
  end
end

TestModule.new.test_public_class_method
{noformat}

Our test_all run will continue to fail until this is resolved. I really don't 
want to back out the improved caching, since it reduced most of the perf 
difference between precompiled and jitted to zero.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to