Permalink
Switch branches/tags
Commits on May 26, 2012
Commits on May 25, 2012
  1. Global $~ raises a TypeError if assigned an object that is not nil or…

    ileitch committed May 25, 2012
    … an instance of MatchData.
  2. Specs for rb_lastline_get

    ileitch committed May 25, 2012
  3. Merge pull request rubinius#1745 from dtykocki/master

    ileitch committed May 25, 2012
    Fix for OpenStruct#initialize_copy (MRI issue #6028)
  4. Remove initialize_copy tag

    dtykocki committed May 25, 2012
Commits on May 24, 2012
  1. Revert "Move immix under rubinius::"

    ryoqun committed May 24, 2012
    This reverts commit 04923cf.
  2. Revert "Move config under rubinius::"

    ryoqun committed May 24, 2012
    This reverts commit 1c2981e.
  3. Revert "Move thread under rubinius::thread"

    ryoqun committed May 24, 2012
    This reverts commit 46e615e.
Commits on May 23, 2012
  1. Remove old LLVM task

    dbussink committed May 22, 2012
  2. Revert "Remove unused LLVM file"

    dbussink committed May 22, 2012
    This reverts commit c20a599.
  3. Move immix under rubinius::

    ryoqun committed May 23, 2012
  4. Move config under rubinius::

    ryoqun committed May 23, 2012
Commits on May 22, 2012
  1. Optimize GlobalCache for faster boot and require

    ryoqun committed Mar 20, 2012
    After a typical cachegrind session, a bottle neck is found in the startup phase
    of Rubinius. As shown by Cachegrind results at bottom, there are too many CPU
    L1 data cache misses.
    
    Namely, the bottle neck is GlobalCache::clear(STATE, Symbol* name), which is
    inlined into System::vm_reset_method_cache(STATE, rubinius::Symbol*). This is
    confirmed by OProfile result at bottom.
    
    clear() is frequently called when defining classes and modules (eg, starting up
    Rubinius itself and loading source files).
    
    The cause of the bottle neck is that clear() writes to non-continuous memory in
    its extremely-tight loop. Of course, that's not CPU cache friendly.
    
    This commit simply arranges memory layout to make clear()'s write memory access
    pattern contiguous. This layout change incurs a tiny trade-off.  It is that
    GlobalCache's lookup-related functions get slow by a negligible fraction in
    relation to the entire VM execution. And they are not heavily called as much as
    clear(). By these reasons, no hot code path is affected by this tiny trade-off.
    Thus, the trade-off is justified.
    
    As show below, Rubinius's startup gets faster by about ~10%.
    
    Benchmark results
    
    Before:
      $ ./bin/benchmark ./benchmark/real_world/bench_startup.rb
      === bin/rbx ===
       startup        3.2 (±0.0%) i/s -         96 in  30.231348s (cycle=1)
    
    After:
      $ ./bin/benchmark ./benchmark/real_world/bench_startup.rb
      === bin/rbx ===
        startup        3.5 (±0.0%) i/s -        105 in  30.205996s (cycle=1)
    
    Cachegrind results
    
    Before:
      Command:          ./bin/rbx -e nil
    
      --------------------------------------------------------------------------------
               Ir    I1mr  ILmr         Dr       D1mr    DLmr        Dw    D1mw    DLmw  file:function
      --------------------------------------------------------------------------------
      154,972,950     768     1 25,825,280 19,371,341      10    12,762   1,231       0  /home/ryoqun/rubinius-master/vm/global_cache.hpp:rubinius::System::vm_reset_method_cache(rubinius::State*, rubinius::Symbol*)
       54,637,620 149,561    64  7,544,407      2,882      46 4,077,709      22       0  /build/buildd/eglibc-2.15/stdlib/../stdlib/strtol_l.c:____strtol_l_internal
       33,793,180 106,669    20  8,502,053        979      10 5,318,282      21       0  /build/buildd/gcc-4.6-4.6.3/build/x86_64-linux-gnu/libstdc++-v3/include/bits/istream.tcc:std::istream::sentry::sentry(std::istream&, bool)
       29,731,837   8,233    30  8,504,145    195,451   6,440 2,953,027     126       2  /home/ryoqun/rubinius-master/vm/symboltable.cpp:rubinius::SymbolTable::lookup(char const*, unsigned long, unsigned int)
       25,182,478  24,355    24  6,715,362          1       0 3,693,388       0       0  /build/buildd/gcc-4.6-4.6.3/build/x86_64-linux-gnu/libstdc++-v3/src/../../../../src/libstdc++-v3/src/istream.cc:std::istream::getline(char*, long, char)
    
    After:
      Command:          ./bin/rbx -e nil
      --------------------------------------------------------------------------------
               Ir    I1mr ILmr         Dr      D1mr    DLmr        Dw    D1mw    DLmw  file:function
      --------------------------------------------------------------------------------
      129,143,424     833    1 25,825,280 3,152,848   2,026    12,768   3,240     250  /home/ryoqun/rubinius-master/vm/global_cache.hpp:rubinius::System::vm_reset_method_cache(rubinius::State*, rubinius::Symbol*)
       54,637,620 149,494   64  7,544,407     2,888      46 4,077,709      10       0  /build/buildd/eglibc-2.15/stdlib/../stdlib/strtol_l.c:____strtol_l_internal
       33,793,180 106,660   20  8,502,053       728       9 5,318,282      18       0  /build/buildd/gcc-4.6-4.6.3/build/x86_64-linux-gnu/libstdc++-v3/include/bits/istream.tcc:std::istream::sentry::sentry(std::istream&, bool)
       29,733,057   7,809   30  8,504,495   195,446   6,076 2,953,147     144       5  /home/ryoqun/rubinius-master/vm/symboltable.cpp:rubinius::SymbolTable::lookup(char const*, unsigned long, unsigned int)
       25,182,478  24,552   24  6,715,362         0       0 3,693,388       0       0  /build/buildd/gcc-4.6-4.6.3/build/x86_64-linux-gnu/libstdc++-v3/src/../../../../src/libstdc++-v3/src/istream.cc:std::istream::getline(char*, long, char)
    
    OProfile's opannotate results (after running "./bin/rbx -e nil" several times)
    
    Before:
      $ opannotate --merge all image:/home/ryoqun/rubinius-master/bin/rbx -t 1 \
                   --source
                     :    void clear(STATE, Symbol* name) {
                     :      thread::SpinLock::LockGuard guard(lock_);
        4490 18.6323 :      for(size_t i = 0; i < CPU_CACHE_SIZE; i++) {
         228  0.9461 :        if(entries[i].name == name) {
                     :          entries[i].clear();
                     :        }
                     :      }
                     :    }
    
    After:
      $ opannotate --merge all image:/home/ryoqun/rubinius-master/bin/rbx -t 1 \
                   --source
                     :    void clear(STATE, Symbol* name) {
                     :      thread::SpinLock::LockGuard guard(lock_);
         957  6.6648 :      for(size_t i = 0; i < CPU_CACHE_SIZE; i++) {
         687  4.7845 :        if(entry_names[i] == name) {
                     :          entry_names[i] = NULL;
           1  0.0070 :          entries[i].clear();
                     :        }
                     :      }
                     :    }
    
    OProfile's opreport results (after running "./bin/rbx -e nil" several times)
    
    Before:
      $ opreport --merge all image:/home/ryoqun/rubinius-master/bin/rbx --symbols -t 1
      samples  %        symbol name
      1105     19.4611  rubinius::System::vm_reset_method_cache(rubinius::State*, rubinius::Symbol*)
      770      13.5611  rubinius::SymbolTable::lookup(char const*, unsigned long, unsigned int)
      563       9.9155  rubinius::VMMethod::interpreter(rubinius::State*, rubinius::VMMethod*, rubinius::InterpreterCallFrame*)
      272       4.7904  rubinius::BakerGC::saw_object(rubinius::Object*)
      201       3.5400  rubinius::InlineCacheRegistry::clear(rubinius::State*, rubinius::Symbol*)
    
    After:
      $ opreport --merge all image:/home/ryoqun/rubinius-master/bin/rbx --symbols -t 1
      samples  %        symbol name
      2375     12.4190  rubinius::SymbolTable::lookup(char const*, unsigned long, unsigned int)
      2101     10.9862  rubinius::VMMethod::interpreter(rubinius::State*, rubinius::VMMethod*, rubinius::InterpreterCallFrame*)
      2099     10.9757  rubinius::System::vm_reset_method_cache(rubinius::State*, rubinius::Symbol*)
      1073      5.6108  rubinius::BakerGC::saw_object(rubinius::Object*)
      822       4.2983  rubinius::InlineCacheRegistry::clear(rubinius::State*, rubinius::Symbol*)
  2. Merge pull request rubinius#1737 from ryoqun/libffi-with-clang

    dbussink committed May 22, 2012
    Fix libffi build issue with Clang
  3. Remove unused LLVM file

    dbussink committed May 22, 2012
Commits on May 21, 2012
  1. Exit after -Xconfig.print

    ileitch committed May 21, 2012
  2. Fix libffi build issue with Clang

    ryoqun committed May 20, 2012
    This cherry-picks a commit by hand to fix a libffi build failure with clang.
    In particular, I applied the following patch from the official libffi
    repository:
      https://github.com/atgreen/libffi/blob/master/patches/x86_pcrel_test
    
    References:
      http://bugs.python.org/issue12812
      https://bugzilla.mozilla.org/show_bug.cgi?id=631928
      http://sourceware.org/ml/libffi-discuss/2011/msg00024.html
Commits on May 20, 2012
  1. Fix IO#popen tags.

    ileitch committed May 20, 2012
  2. Update to libffi 3.0.11

    dbussink committed May 20, 2012
  3. Don't use unions for cmsghdr

    ryoqun committed May 20, 2012
    Work around build issues on mac instroduced this commmit:
      e2e7b25 Use union instead of struct for cmsghdr
    
    Reference:
      http://alas.matf.bg.ac.rs/manuals/lspe/snode=153.html
  4. Use union instead of struct for cmsghdr

    ryoqun committed May 20, 2012
    Use of struct with cmsghdr and pad is a GNU extension. When built with
    Clang, warnings are issued as such. So take the union approach instead.
    
    To fix this, I used an example at:
      http://www.rootr.net/man/man/CMSG_SPACE
    
    This is a second try to fix clang warnings in io.cpp. The reverted first try
    was:
      a9648cf Ignore all GNU-extension warnings
    
    As an alternative approach to it, I fixed the code itself.