Permalink
Commits on May 18, 2011
  1. Merge branch 'require_protection'

    nahi committed May 18, 2011
    ant spec passes, ant test passes.
    
    No performance degrade for startup time:
      [before]
        time jruby -rubygems -e 0  2.72s user 0.19s system 209% cpu 1.387 total
        time jruby -rubygems -e 0  2.72s user 0.29s system 213% cpu 1.407 total
        time jruby -rubygems -e 0  2.73s user 0.28s system 209% cpu 1.438 total
        time jruby -rubygems -e 0  2.78s user 0.22s system 215% cpu 1.395 total
        time jruby -rubygems -e 0  2.72s user 0.30s system 216% cpu 1.396 total
      [after]
        time jruby -rubygems -e 0  2.83s user 0.24s system 214% cpu 1.433 total
        time jruby -rubygems -e 0  2.71s user 0.33s system 213% cpu 1.427 total
        time jruby -rubygems -e 0  2.77s user 0.27s system 220% cpu 1.382 total
        time jruby -rubygems -e 0  2.75s user 0.29s system 212% cpu 1.430 total
        time jruby -rubygems -e 0  2.76s user 0.34s system 216% cpu 1.430 total
    
    bench_time_require.rb gets faster:
      [before]
        require 'time' * 10000:          0.139 [sec]
        require 'active_record' * 10000: 0.159 [sec]
      [after]
        require 'time' * 10000:          0.019 [sec]
        require 'active_record' * 10000: 0.031 [sec]
    
    Conflicts:
    	src/org/jruby/runtime/load/LoadService.java
    	src/org/jruby/util/collections/StringArraySet.java
  2. feature loaded checking perf optimization

    nahi committed May 18, 2011
    Add StringArraySet#containsString() which gets Java String (not RubyString) for
    checking the element existense.
    bench/bench_time_require.rb gets faster:
    
      require 'time' * 10000:          0.031 [sec]
      require 'active_record' * 10000: 0.037 [sec]
    ->
      require 'time' * 10000:          0.019 [sec]
      require 'active_record' * 10000: 0.031 [sec]
    
    See https://gist.github.com/976190 for more details.
Commits on May 17, 2011
  1. Add a special RubyArray subclass for LOADED_FEATURES, to speed up sea…

    headius committed with nahi May 16, 2011
    …rches during Kernel#require.
    
    Signed-off-by: Hiroshi Nakamura <nahi@ruby-lang.org>
    
    For require_protection branch, I changed the signature of featureAlreadyLoaded(RubyString) to
    featureAlreadyLoaded(String).
  2. Circular require by autoload should not be warned

    nahi committed May 17, 2011
    Based on current require implementation of JRuby, autoload triggers circular require
    when the autoload-defined feature is explicitly required such as;
    
      autoload :Java, 'java'
      ...
      require 'java'
    
    For such case, we should not warn users for 'circular require considered harmful'.
    NB: circular require warnings are from 1.9 mode.
  3. JRUBY-3194: Make autoload thread-safe.

    nahi committed May 17, 2011
    To make autoload thread-safe, remove loadMethod from loadService.autoloadMap after loading file, not before.
    Removing loadMethod before loading file would cause the second thread raising NameError since the target constant could not be defined yet.
    
    And this commit introduces 3 states as a resulting value of internal require method: LoadService#requireCommon()
     * LOADED ........... specified file is loaded.
     * ALREADY_LOADED ... specified file is already loaded.
     * CIRCULAR ......... circular require.
    
    For Kernel.require, ALREADY_LOADED and CIRCULAR are treated as 'false' as a resulting value.
    For Kenrel.autoload, when it gets CIRCULAR from requireCommon(), it returns nil instead of defined constant.
    CIRCULAR helps the following autoload situation.
    
      autoload :Java, 'java'
      require 'java' #=> 'module Java ...' => invoke autoload for :Java => circular require of 'java' => NameError since Java is not yet defined.
    
    NB: JRuby 1.6.1 does not have this circular autoload problem because 1.6.1 was using $LOADED_FEATURES for protecting runtime from threaded require.
    Recursive autoload just returns nil since the feature is marked as 'already loaded'.
Commits on May 16, 2011
  1. Add a special RubyArray subclass for LOADED_FEATURES, to speed up sea…

    headius committed May 16, 2011
    …rches during Kernel#require.
  2. Reenable 3-arg-with-block indy call path through DynamicMethod.call, …

    headius committed May 16, 2011
    …since catchExceptionb bug is now fixed in MLVM.
  3. Temporal fix for build failure of IR compiler

    nahi committed May 16, 2011
    1d06ff5 changes some methods of RuntimeHelpers for 'defined?' optimization. Let IR compiler use it just for build.
  4. Improve perf of defined? by avoiding the constant encoding of Java St…

    headius committed May 16, 2011
    …ring + ByteList construction + Ruby String.
Commits on May 14, 2011
  1. Tweaks for invokedynamic native binding.

    headius committed May 14, 2011
    * Fix arg conversion for native bindings that are non-static or have typed return values.
    * Attempt to bind AttrReader/WriterMethod more directly, to get them to inline. Crashes current MLVM.
Commits on May 13, 2011
  1. Revert "LoadSearcher refactoring: reduce featureAlreadyLoaded usage"

    nahi committed May 13, 2011
    This reverts commit 1bb5fe0.
    
    I gathered featureAlreadyLoaded() invoking by thi commit, then tried to
    change the method to use HashSet<String>(loadedFeaturesInternal) but it
    slows down a little for require 'active_record'... I abondoned this
    change for now.
    
    Conflicts:
    
    	src/org/jruby/runtime/load/LoadService.java
  2. LoadSearcher refactoring: reduce RubyString usage.

    nahi committed May 13, 2011
    CAUTION: I refactored caseInsensitiveFS == true case but it doesn't have
    a test so it's not tested yet.
  3. LoadSearcher refactoring: reduce featureAlreadyLoaded usage

    nahi committed May 13, 2011
    Move featureAlreadyLoaded() check from smartLoadInternal() to
    LoadSearcher.
  4. LoadSearcher refactoring: LoadError detection cleanup

    nahi committed May 13, 2011
    Throw LoadError after all search done and state.library == null. Before
    this change, the last part of ScriptClassSearcher throwed LoadError.
    ScriptClassSearcher located at the last of searchers so it worked as we
    expected. Clean-up.
  5. LoadSearcher refactoring: avoid to use Exception for flow control

    nahi committed May 13, 2011
    Change LoadSearcher#trySearch signature to return boolean instead of
    throwing an AlreadyLoaded exception for performance.  'ant spec' passes.
    
    [BEFORE]
    % jruby bench/bench_time_require.rb 10
                                        user     system      total        real
    require 'time'                  1.279000   0.000000   1.279000 (  1.137000)
    require 'time'                  0.233000   0.000000   0.233000 (  0.233000)
    require 'time'                  0.124000   0.000000   0.124000 (  0.124000)
    require 'time'                  0.126000   0.000000   0.126000 (  0.126000)
    require 'time'                  0.123000   0.000000   0.123000 (  0.123000)
    require 'time'                  0.117000   0.000000   0.117000 (  0.117000)
    require 'time'                  0.119000   0.000000   0.119000 (  0.119000)
    require 'time'                  0.120000   0.000000   0.120000 (  0.120000)
    require 'time'                  0.121000   0.000000   0.121000 (  0.122000)
    require 'time'                  0.145000   0.000000   0.145000 (  0.146000)
    
    [AFTER]
    % jruby bench/bench_time_require.rb 10
                                        user     system      total        real
    require 'time'                  1.104000   0.000000   1.104000 (  1.037000)
    require 'time'                  0.183000   0.000000   0.183000 (  0.184000)
    require 'time'                  0.073000   0.000000   0.073000 (  0.073000)
    require 'time'                  0.031000   0.000000   0.031000 (  0.031000)
    require 'time'                  0.035000   0.000000   0.035000 (  0.036000)
    require 'time'                  0.036000   0.000000   0.036000 (  0.036000)
    require 'time'                  0.020000   0.000000   0.020000 (  0.021000)
    require 'time'                  0.021000   0.000000   0.021000 (  0.022000)
    require 'time'                  0.021000   0.000000   0.021000 (  0.021000)
    require 'time'                  0.020000   0.000000   0.020000 (  0.020000)
    
    The signature
      boolean trySearch();
    looks ugly so we should change the name if a better name exists...
Commits on May 12, 2011
  1. Change colon3 to use Object scope and then revert SearchConst to only…

    enebo committed May 12, 2011
    … be created in terms of MetaObjects
  2. Fix ClassVar

    enebo committed May 12, 2011
  3. Add new method containingClassVariableFor so we can generate the appr…

    enebo committed May 12, 2011
    …opriate instr+oper for the case where we sometimes want self and sometimes want self.class. Also make ClassVar{Asgn,Decl} use it
  4. Add new ClassOf instruction

    enebo committed May 12, 2011
  5. remove unused imports

    enebo committed May 12, 2011
  6. Merge pull request #35 from stepheneb/fix-ant-install-dev-gem

    nicksieger committed May 12, 2011
    [JRUBY-5791] ant uses JRuby's gem home
  7. [JRUBY-5791] ant uses JRuby's gem home

    stepheneb committed May 12, 2011
    RVM defines GEM_HOME and JRuby installs it's development
    gems in the wrong place. 
    
    The install-dev-gems ant task now proactively defines
    GEM_HOME to reference JRuby's gem home for 1.8 gems.
    
    Having GEM_HOME reference another Ruby is still a problem for 
    JRuby, this patch just fixes the ant task.
  8. Allow call with IRubyObject[] to IRubyObject[]-receiving native targe…

    headius committed May 12, 2011
    …t to bind straight through.
Commits on May 11, 2011
  1. Merge branch 'require_protection'

    nahi committed May 11, 2011
  2. Refactor native handle binding in indy logic.

    headius committed May 11, 2011
    * Methods that take block are bound now (still no call sites that pass block though)
    * Simpler logic for permuting incoming arguments into place
    * Easier path to getting other target forms binding (only forms that take ThreadContext bind now)