Mercurial > hg > graal-compiler
changeset 21592:a9f347ae6f5f
GraalDebugConfig: dump LSRA intervals with -G:+DumpOnError.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Fri, 29 May 2015 11:33:47 +0200 |
parents | 6c5327245831 |
children | 098cc00fbe93 |
files | graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java |
diffstat | 1 files changed, 21 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Fri May 29 10:59:03 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Fri May 29 11:33:47 2015 +0200 @@ -22,18 +22,18 @@ */ package com.oracle.graal.compiler; -import com.oracle.jvmci.code.BailoutException; -import com.oracle.jvmci.meta.JavaMethod; -import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.io.*; import java.util.*; import com.oracle.graal.graph.*; import com.oracle.graal.lir.*; +import com.oracle.graal.lir.alloc.lsra.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.options.*; public class GraalDebugConfig implements DebugConfig { @@ -272,6 +272,8 @@ } Debug.setConfig(Debug.fixedConfig(Debug.DEFAULT_LOG_LEVEL, Debug.DEFAULT_LOG_LEVEL, false, false, false, false, dumpHandlers, verifyHandlers, output)); Debug.log(String.format("Exception occurred in scope: %s", Debug.currentScope())); + boolean dumpedLIR = false; + Interval[] intervals = null; for (Object o : Debug.context()) { if (o instanceof Graph) { Debug.log("Context obj %s", o); @@ -284,9 +286,25 @@ Debug.log("Context obj %s", o); if (DumpOnError.getValue()) { Debug.dump(o, "Exception LIR: " + e); + dumpedLIR = true; + if (intervals != null) { + Debug.dump(intervals, "Exception Intervals: " + e); + intervals = null; + } } else { Debug.log("Use -G:+DumpOnError to enable dumping of graphs on this error"); } + } else if (o instanceof Interval[]) { + if (DumpOnError.getValue()) { + if (dumpedLIR) { + // Can only dump intervals if LIR has been dumped. + Debug.dump(o, "Exception Intervals: " + e); + } else { + intervals = (Interval[]) o; + } + } else { + Debug.log("Use -G:+DumpOnError to enable dumping of intervals on this error"); + } } else if (o instanceof Node) { String location = GraphUtil.approxSourceLocation((Node) o); String node = ((Node) o).toString(Verbosity.Debugger);