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: 7b8a61f8a44e
Choose a base ref
...
head repository: jruby/jruby
compare: 8d34a507cc0b
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Oct 12, 2014

  1. (Closure)LocalVariable hashCode should include both name & offset.

    * Since an identically-named local variable in a nested closure refers
      to the same runtime variable as a local variable in the parent scope,
      in IR, we consider them "same" variables as well (for the purposes of
      cloning, LVA, etc.).
    
      However, because of shadowing when variables are declared in block
      args, to prevent mixing up different variables across scopes, we have
      to include offset in the hashCode. See code snippet below where
      _, n, s shadow similarly named variables in surrounding scopes.
    
      FIXME: Do we need a different LocalVariable type for these?
    
    -------------------------------------
      def yielder
        [1,2].each { |i| yield "boo", i }
      end
    
      def foo
        yielder do |_, n|
          p "1: n=#{n}"
          yielder do |s, _|
            p "2: s=#{s}"
            yielder do |n,s|
              p "3: n=#{n}, s=#{s}"
            end
          end
        end
      end
    
      foo
    -------------------------------------
    subbuss committed Oct 12, 2014
    Copy the full SHA
    2fe209d View commit details
    Browse the repository at this point in the history
  2. Clone instructions before interpretation.

    * Followup on 7a8bf5f.
    
    * Prevent JIT/opts passes from clobbering the instructions that
      interpreter is working on. This sets the stage for enabling
      multiple versions of a scope to be active on the execution stack
      at the same time.
    
    * The following fields in IRScope are still referenced at runtime
      Of these, 3 are immutable and are safe. But, there are 2 fields
      that could be clobbered by opt passes / JIT and need to made
      available to the interpreter context.
      - scope name -- immutable
      - scope type -- immutable
      - parameter list -- immutable
      - tmp var count
      - scope ir flags
    subbuss committed Oct 12, 2014
    2
    Copy the full SHA
    8d34a50 View commit details
    Browse the repository at this point in the history