Permalink
Switch branches/tags
Commits on Mar 25, 2013
  1. Use correct scope by setting CompiledCode::scope

    ryoqun committed Mar 25, 2013
    In some cases, wrong ConstantScope can be used when JIT is enabled.
    
    For example, ConstantScope should be different with each invocation of
    class_exec in the following code:
    
        definition_block = proc do
          proc do
            def baz
            end
          end.call
        end
        Foo.class_exec(&definition_block)
        Bar.class_exec(&definition_block)
    
    But, it becomes always same after this code is JIT-ted.
    
    The cause is the following commit's modification for perfmance. It changed to
    only initialize CompiledCode::scope if it's nil:
    
        e3e2306 Improve block creation speed
    
        // TODO: We don't need to be doing this everytime.
        -    cm->scope(state, call_frame->static_scope());
        +    if(cm->scope()->nil_p()) {
        +      cm->scope(state, call_frame->static_scope());
        +    }
    
    But this is wrong, as shown above, there are cases where unconditional
    overwriting of ConstantScope is needed.
    
    Also, this diverges from the code of the create_block VM instruction defined
    at vm/instructions.def. This also indicates something wrong.
    
    So, always initialize CompiledCode::scope here too.
  2. Fix indent

    ryoqun committed Mar 25, 2013
  3. Fix thread safety issue for flushing variable scopes

    dbussink committed Mar 25, 2013
    There was a race condition when flushing the variable scope, because
    another thread might already see isolated set to true, before the heap
    locals were properly initialized.
    
    This result in this other thread seeing nil as the local value instead
    of the proper value. This commit changes the flushing strategy to be
    both safe for reads and writes of the locals.
    
    The first step is to delay the allocation of the heap locals tuple. We
    then atomically indicate that this scope uses heap locals. If any other
    thread also wants to use the scope, it will spin until the heap locals
    have been allocated. Spinning for both the read and write ensures that
    we don't see any intermediate state during the move from stack to heap
    locals. This means no writes are lost and no stale reads occur.
    
    We then create the heap locals and only store then in the heap_locals_
    ivar after initializing them, so any reads or writes will see the proper
    locals and write to the correct slots.
    
    Fixes #2124
Commits on Mar 24, 2013
  1. Merge pull request #2231 from kachick/update-spec-tags

    jc00ke committed Mar 24, 2013
    Remove disused tags in String for 1.9+
  2. Merge pull request #2230 from kachick/fix-array-delete

    jc00ke committed Mar 24, 2013
    Fix Array#delete for 1.9
  3. Fix Array#delete for 1.9

    kachick committed Mar 24, 2013
  4. Remove disused tags

    kachick committed Mar 24, 2013
Commits on Mar 23, 2013
  1. Fix typos.

    carlosgaldino committed Mar 23, 2013
  2. Fixed Range#last for 1.9.

    brixen committed Mar 23, 2013
Commits on Mar 22, 2013
  1. Setup type guards for reading and writing ivars

    dbussink committed Mar 22, 2013
    We must ensure that the self object we see is actually of the same class
    that we optimized for. These types can be different, for example for
    subclasses of a certain class that might end up with a different memory
    layout for variables.
Commits on Mar 21, 2013
  1. Regen'd website.

    brixen committed Mar 21, 2013
  2. Merge pull request #2216 from ryoqun/oprofile-blog-post-final

    ryoqun committed Mar 21, 2013
    Add a blog post for profiling JIT-ted code with OProfile
  3. Remove unused extra_ field

    dbussink committed Mar 21, 2013
  4. Allow for compiled blocks to also have a receiver class

    dbussink committed Mar 21, 2013
    Before the additional data was either a block environment or a receiver
    class, but having a receiver class is also useful for compiling blocks.
    This matters for example for inlining instance variable reads if just a
    block is compiled.
    
    Improves benchmark/tiers/0/bm_vm1_ivar.rb significantly:
    
    Before:
    === bin/rbx ===
      ivar read 58492061.6 (±3.0%) i/s -  289205872 in   4.948913s
       ivar set 41165744.5 (±2.6%) i/s -  204915000 in   4.982051s
    
    After:
    === bin/rbx ===
      ivar read 266371814.2 (±5.6%) i/s - 1283690000 in   4.836606s
       ivar set 224551559.4 (±4.0%) i/s - 1110346272 in   4.953298s
  5. Setup self class for block based on creator info

    dbussink committed Mar 21, 2013
    This allows the JIT to inline ivar reads inside inlined blocks, for
    example in cases like this:
    
    def foo
      ary.each {|e| e == @bar }
    end
  6. Print class name we read ivar from in JIT debugging

    dbussink committed Mar 21, 2013
    Make it easier to see what the class is we guard the ivar read against.
Commits on Mar 20, 2013
  1. Remove exports for symbols that are available for libc_nonshared

    dbussink committed Mar 20, 2013
    Apperently on RHEL / CentOS 5.9 this breaks the compile since these
    symbols are exported there. Also checked against Ubuntu and the symbols
    are available there too.
    
    Fixes #2217
  2. Merge pull request #2218 from adzankich/io19_typo

    r-obert committed Mar 20, 2013
    Fix typo in io19.rb
  3. Fix typo

    zankich committed Mar 20, 2013
  4. Regen'd website.

    brixen committed Mar 20, 2013
  5. Blog post: PDX Summit Recap.

    brixen committed Mar 20, 2013