Skip to content

Commit

Permalink
[IR] Make unboxing analysis a bit more robust and work with closures
Browse files Browse the repository at this point in the history
* Some cleanup and additional removal of hacks.
* Run analysis on closures as well and make it safe to run on
  scopes with closures.
* Analysis now works correctly on loop-based and closure-based
  versions of mandelbrot (type-guards are still missing). Some
  more tweaks are required for the closure version to get rid of
  some spurious boxing instructions.
  • Loading branch information
subbuss committed Jan 7, 2014
1 parent 2a07fbc commit e89c4ff
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 68 deletions.
10 changes: 9 additions & 1 deletion core/src/main/java/org/jruby/ir/dataflow/DataFlowProblem.java
Expand Up @@ -120,6 +120,14 @@ public FlowGraphNode getFlowGraphNode(BasicBlock b) {
return basicBlockToFlowGraph.get(b.getID());
}

public FlowGraphNode getEntryNode() {
return getFlowGraphNode(scope.cfg().getEntryBB());
}

public FlowGraphNode getExitNode() {
return getFlowGraphNode(scope.cfg().getExitBB());
}

/* -------------- Packaged/protected fields and methods below ---------------- */
int addDataFlowVar(DataFlowVar v) {
// We want unique ids for dataflow variables
Expand All @@ -129,7 +137,7 @@ int addDataFlowVar(DataFlowVar v) {
}

/* -------------- Protected fields and methods below ---------------- */
protected List<FlowGraphNode> flowGraphNodes;
protected List<FlowGraphNode> flowGraphNodes;
protected IRScope scope;

/* -------------- Private fields and methods below ---------------- */
Expand Down

0 comments on commit e89c4ff

Please sign in to comment.