Skip to content

Commit

Permalink
IR: Addresses FIXME to remove null check
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Mar 6, 2012
1 parent 961cb46 commit 1f572d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
5 changes: 1 addition & 4 deletions src/org/jruby/compiler/ir/dataflow/DataFlowProblem.java
Expand Up @@ -51,10 +51,6 @@ public IRScope getScope() {
public void compute_MOP_Solution() {
/** Are there are available data flow facts to run this problem? SSS FIXME: Silly optimization? */
if (!isEmpty()) {
for (FlowGraphNode fg: flowGraphNodes) {
fg.init();
}

// 2. Initialize work list based on flow direction to make processing efficient!
LinkedList<FlowGraphNode> workList = getInitialWorkList();

Expand Down Expand Up @@ -146,6 +142,7 @@ private void buildFlowGraph() {

for (BasicBlock bb: scope.cfg().getBasicBlocks()) {
FlowGraphNode fgNode = buildFlowGraphNode(bb);
fgNode.init();
fgNode.buildDataFlowVars();
flowGraphNodes.add(fgNode);
basicBlockToFlowGraph.put(bb.getID(), fgNode);
Expand Down
Expand Up @@ -67,14 +67,11 @@ public List<Variable> getVarsLiveOnScopeEntry() {
List<Variable> liveVars = new ArrayList<Variable>();
BitSet liveIn = ((LiveVariableNode) getFlowGraphNode(getScope().cfg().getEntryBB())).getLiveOutBitSet();

// When accessed before LVP is run, this can be null. SSS FIXME: Initialize in bitset to non-null always?
if (liveIn != null) {
for (int i = 0; i < liveIn.size(); i++) {
if (liveIn.get(i) == true) {
Variable v = getVariable(i);
liveVars.add(v);
// System.out.println("variable " + v + " is live on entry!");
}
for (int i = 0; i < liveIn.size(); i++) {
if (liveIn.get(i) == true) {
Variable v = getVariable(i);
liveVars.add(v);
// System.out.println("variable " + v + " is live on entry!");
}
}

Expand Down

0 comments on commit 1f572d6

Please sign in to comment.