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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a1c709c5f5a6
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 17d78bccf1af
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jun 7, 2016

  1. Use 'null' to represent TOP in AddMissingInitsPass.

    * Cleaner and better.
    subbuss committed Jun 7, 2016
    Copy the full SHA
    537dbee View commit details
  2. Disable AddMissingInitsPass and renable EnsureTempsAssigned

    Let us see if this fixes the broken build.
    subbuss committed Jun 7, 2016
    Copy the full SHA
    17d78bc View commit details
Showing with 15 additions and 12 deletions.
  1. +1 −1 core/src/main/java/org/jruby/ir/IRManager.java
  2. +14 −11 core/src/main/java/org/jruby/ir/dataflow/analyses/DefinedVariableNode.java
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/IRManager.java
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
public class IRManager {
public static final String SAFE_COMPILER_PASSES = "";
public static final String DEFAULT_BUILD_PASSES = "";
public static final String DEFAULT_JIT_PASSES = "LocalOptimizationPass,DeadCodeElimination,OptimizeDynScopesPass,OptimizeDelegationPass,AddCallProtocolInstructions,AddMissingInitsPass";
public static final String DEFAULT_JIT_PASSES = "LocalOptimizationPass,DeadCodeElimination,OptimizeDynScopesPass,OptimizeDelegationPass,AddCallProtocolInstructions,EnsureTempsAssigned";
public static final String DEFAULT_INLINING_COMPILER_PASSES = "LocalOptimizationPass";

private final CompilerPass deadCodeEliminationPass = new DeadCodeElimination();
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@ public DefinedVariableNode(DefinedVariablesProblem prob, BasicBlock n) {
@Override
public void init() {
setSize = problem.getDFVarsCount();
out = new BitSet(setSize);
computed = false;
// 'null' acts as the TOP for this dataflow analysis
out = null;
}

private void addDFVar(Variable v) {
@@ -37,23 +37,28 @@ public void buildDataFlowVars(Instr i) {

@Override
public void applyPreMeetHandler() {
in = new BitSet(setSize);
// Init to all 1's so that when we 'and' with the
// first predecessor, we don't go to all 0's right away!
in.set(0, setSize);
// 'null' acts as the TOP for this dataflow analysis
in = null;
}

@Override
public void compute_MEET(Edge e, DefinedVariableNode pred) {
// Only vars defined at the exit of all predecessors are considered defined on entry
if (pred.computed) {
// If pred.out is TOP, in doesn't change.
if (pred.out != null) {
// if in is TOP, init in to a bitset with all 1's
// so the intersection computes the right value.
if (in == null) {
in = new BitSet(setSize);
in.set(0, setSize);
}

in.and(pred.out);
}
}

@Override
public void initSolution() {
tmp = (BitSet) in.clone();
tmp = in == null ? new BitSet(setSize) : (BitSet) in.clone();
}

@Override
@@ -110,10 +115,8 @@ public boolean solutionChanged() {
@Override
public void finalizeSolution() {
out = tmp;
computed = true;
}

private boolean computed;
private BitSet in; // Variables defined at entry of this node
private BitSet out; // Variables defined at exit of node
private BitSet tmp; // Temporary state while applying transfer function