# HG changeset patch # User Gilles Duboscq # Date 1327599122 -3600 # Node ID daaee28c65c63e37773ef25f235d6b3c02a04bb4 # Parent d13bfce7b3dd786a1981015162e4adc90fb2e824 Adding a few utility methods to Loop diff -r d13bfce7b3dd -r daaee28c65c6 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/loop/Loop.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/loop/Loop.java Thu Jan 26 12:23:00 2012 +0100 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/loop/Loop.java Thu Jan 26 18:32:02 2012 +0100 @@ -134,4 +134,27 @@ } return loopVariant; } + + public int depth() { + if (parent() == null) { + return 0; + } + return parent().depth() + 1; + } + + public int directFixedNodesCount() { + return directCFGNodes.cardinality(); + } + + public int fixedNodesCount() { + int count = directFixedNodesCount(); + for (Loop child : children()) { + count += child.directFixedNodesCount(); + } + return count; + } + + public int exitsCount() { + return exits().cardinality(); + } } diff -r d13bfce7b3dd -r daaee28c65c6 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/BoxingEliminationPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/BoxingEliminationPhase.java Thu Jan 26 12:23:00 2012 +0100 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/BoxingEliminationPhase.java Thu Jan 26 18:32:02 2012 +0100 @@ -36,7 +36,7 @@ @Override protected void run(StructuredGraph graph) { - if (graph.getNodes(UnboxNode.class).iterator().hasNext()) { + if (graph.getNodes(UnboxNode.class).isNotEmpty()) { Map phiReplacements = new HashMap<>(); for (UnboxNode unboxNode : graph.getNodes(UnboxNode.class)) { diff -r d13bfce7b3dd -r daaee28c65c6 mx/sanitycheck.py --- a/mx/sanitycheck.py Thu Jan 26 12:23:00 2012 +0100 +++ b/mx/sanitycheck.py Thu Jan 26 18:32:02 2012 +0100 @@ -27,7 +27,6 @@ import re import mx import os -import commands from os.path import isfile, join, exists dacapoSanityWarmup = {