Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
base: 974016f5522b
Choose a base ref
...
head repository: jruby/jruby
compare: 699c8334b16a
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 5, 2015

  1. Fix bug in LVA + simplify it

    * LVA was attempting to analyze closures in the context of their
      parent scope's LVA context. The code was general enough that if
      we knew more information about specific call sites, it would have
      done better.
    
      However, in reality, given that we don't know too much about
      call sites, (a) all that code was extra complexity (b) it was
      really doing anything in terms of not being conservative (because
      all calls are being treated as dataflow barriers right now)
      (c) in the only case where it would not have been conservative,
      it was actually making an incorrect assumption that the closure
      will execute at the call site where it is defined and hence
      incorrectly marking a variable dead when it wasn't.
    
    * The fix was to simply eliminate the analysis of closures in the
      context of the parent's scope. We already had support for
      independent LVA of closures which takes care of scenario (c) above
      by marking all dirtied vars live on "entry" (which in the case of
      LVA, which is a backwards pass, is the control flow exit).
    
      This now fixes the failing snippet (see below) and should also
      eliminate the remaining test:mri:jit failures.
    [subbu@earth ir] jruby -Xjit.threshold=0 -e "z = 5; x = Hash.new {|h,kk| z = kk }; z=0; x[22]; p z"
    22
    
    Conflicts:
    	core/src/main/java/org/jruby/ir/dataflow/analyses/LiveVariableNode.java
    	core/src/main/java/org/jruby/ir/passes/LiveVariableAnalysis.java
    subbuss committed Mar 5, 2015
    Copy the full SHA
    f48c871 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    699c833 View commit details
    Browse the repository at this point in the history