Skip to content


Add comment explaining why scope loads can't move later.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Oct 28, 2014
1 parent 579b8f2 commit c93c7bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/java/org/jruby/ir/
Expand Up @@ -1657,6 +1657,9 @@ private IRMethod defineMethodInner(MethodDefNode defNode, IRMethod method, IRSco

addInstr(method, new ReceiveSelfInstr(method.getSelf()));

// These instructions need to be toward the top of the method because they may both be needed for
// processing optional arguments as in def foo(a = Object).
// Set %current_scope = <current-scope>
// Set %current_module = isInstanceMethod ? %self.metaclass : %self
int nearestScopeDepth = parent.getNearestModuleReferencingScopeDepth();
Expand Down

0 comments on commit c93c7bb

Please sign in to comment.