Skip to content

Commit

Permalink
Follouwp on 5f3422c: Handle breaks that convert to local jumps
Browse files Browse the repository at this point in the history
* Breaks that convert to local jumps need to have ensure code
  cloned since they won't go through the exception handling path.

* Enable dumps of full build IR & CFG in debug mode for IR methods
  as well. a94de2e did it only for IR blocks.
subbuss committed Dec 19, 2015
1 parent 5f3422c commit 8cd8c1c
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -259,6 +259,8 @@ protected void doDebug() {

public void completeBuild(InterpreterContext interpreterContext) {
this.interpreterContext = interpreterContext;
// Reset so that we can see the new instr dump again
this.displayedCFG = false;
}

// Unlike JIT in MixedMode this will always successfully build but if using executor pool it may take a while
4 changes: 4 additions & 0 deletions core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -888,6 +888,10 @@ public Operand buildBreak(BreakNode breakNode) {
Operand rv = build(breakNode.getValueNode());

if (currLoop != null) {
// If we have ensure blocks, have to run those first!
if (!activeEnsureBlockStack.empty()) {
emitEnsureBlocks(currLoop);
}
addInstr(new CopyInstr(currLoop.loopResult, rv));
addInstr(new JumpInstr(currLoop.loopEndLabel));
} else {

0 comments on commit 8cd8c1c

Please sign in to comment.