# HG changeset patch # User Christian Wimmer # Date 1410918060 25200 # Node ID 3db919d1c8d5ab81e760186e073f7863c77f10be # Parent 7a0bff31df98cd1ed8adcf78ce19e77f78342437 Add option to disable Graal graph verification (which takes very long for big graphs) diff -r 7a0bff31df98 -r 3db919d1c8d5 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Tue Sep 16 18:40:04 2014 -0700 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Tue Sep 16 18:41:00 2014 -0700 @@ -30,12 +30,18 @@ import com.oracle.graal.debug.*; import com.oracle.graal.graph.Node.ValueNumberable; import com.oracle.graal.graph.iterators.*; +import com.oracle.graal.options.*; /** * This class is a graph container, it contains the set of nodes that belong to this graph. */ public class Graph { + static class Options { + @Option(help = "Verify graphs often during compilation when assertions are turned on")// + public static final OptionValue VerifyGraalGraphs = new OptionValue<>(true); + } + public final String name; /** @@ -566,7 +572,7 @@ * mark}. */ public NodeIterable getNewNodes(Mark mark) { - final int index = mark.getValue(); + final int index = mark == null ? 0 : mark.getValue(); return new NodeIterable() { @Override @@ -752,17 +758,19 @@ } public boolean verify() { - for (Node node : getNodes()) { - try { + if (Options.VerifyGraalGraphs.getValue()) { + for (Node node : getNodes()) { try { - assert node.verify(); - } catch (AssertionError t) { - throw new GraalInternalError(t); - } catch (RuntimeException t) { - throw new GraalInternalError(t); + try { + assert node.verify(); + } catch (AssertionError t) { + throw new GraalInternalError(t); + } catch (RuntimeException t) { + throw new GraalInternalError(t); + } + } catch (GraalInternalError e) { + throw GraalGraphInternalError.transformAndAddContext(e, node).addContext(this); } - } catch (GraalInternalError e) { - throw GraalGraphInternalError.transformAndAddContext(e, node).addContext(this); } } return true;