Skip to content

Commit

Permalink
temp locl replace var clone missing
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Oct 10, 2014
1 parent 3765605 commit 259b4bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/main/java/org/jruby/ir/IRScope.java
Expand Up @@ -20,6 +20,7 @@
import org.jruby.ir.representations.CFG;
import org.jruby.ir.representations.CFGLinearizer;
import org.jruby.ir.transformations.inlining.CFGInliner;
import org.jruby.ir.transformations.inlining.SimpleCloneInfo;
import org.jruby.parser.StaticScope;
import org.jruby.util.log.Logger;
import org.jruby.util.log.LoggerFactory;
Expand Down Expand Up @@ -509,6 +510,12 @@ private synchronized Instr[] prepareInstructions() {
// Exit BB ipc
cfg().getExitBB().getLabel().setTargetPC(ipc + 1);

System.out.println("CFG.original");
System.out.println(cfg().toStringInstrs());

System.out.println("CFG.new");
System.out.println(cfg().clone(new SimpleCloneInfo(this, false), this).toStringInstrs());

// Set up rescue map
setupRescueMap();

Expand Down
@@ -1,5 +1,7 @@
package org.jruby.ir.operands;

import org.jruby.ir.transformations.inlining.SimpleCloneInfo;

/**
* When we optimize full local variables to be temporary ones we like to keep the name
* of what we renamed them as. This is just enough wrapper for us to maintain a nice
Expand All @@ -15,6 +17,11 @@ public TemporaryLocalReplacementVariable(String oldName, int offset) {
this.oldName = oldName;
}

@Override
public Variable clone(SimpleCloneInfo ii) {
return new TemporaryLocalReplacementVariable(oldName, offset);
}

@Override
public String getPrefix() {
return "%t_" + oldName + "_";
Expand Down

0 comments on commit 259b4bd

Please sign in to comment.