Mercurial > hg > graal-compiler
changeset 18642:133d5a98c547
generalized semantics of DebugDumpHandler.close() to mean reset so that closing a handler flushes and releases all its resources but leaves it operational (i.e. subsequent uses will (re)create and (re)open the required resources)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 08 Dec 2014 14:32:21 +0100 |
parents | e22a21b27036 |
children | 3e71078c2efe |
files | graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugDumpHandler.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/DecompilerDebugDumpHandler.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java |
diffstat | 4 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugDumpHandler.java Sun Dec 07 20:43:33 2014 +0100 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugDumpHandler.java Mon Dec 08 14:32:21 2014 +0100 @@ -28,6 +28,11 @@ void dump(Object object, String message); + /** + * Flushes and releases resources managed by this dump handler. A subsequent call to + * {@link #dump(Object, String)} will create and open new resources. That is, this method can be + * used to reset the handler. + */ @Override void close(); }
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Sun Dec 07 20:43:33 2014 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Mon Dec 08 14:32:21 2014 +0100 @@ -98,9 +98,9 @@ if (!method.equals(curMethod) || !curDecorators.equals(decorators)) { cfgPrinter.printCompilation(method); TTY.println("CFGPrinter: Dumping method %s to %s", method, cfgFile); - curMethod = method; - curDecorators = decorators; } + curMethod = method; + curDecorators = decorators; return true; } @@ -206,6 +206,7 @@ public void close() { if (cfgPrinter != null) { cfgPrinter.close(); + cfgPrinter = null; } } }
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/DecompilerDebugDumpHandler.java Sun Dec 07 20:43:33 2014 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/DecompilerDebugDumpHandler.java Mon Dec 08 14:32:21 2014 +0100 @@ -108,6 +108,8 @@ try { printStream.close(); fos.close(); + printStream = null; + fos = null; } catch (IOException e) { throw new IllegalStateException(e); }
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Sun Dec 07 20:43:33 2014 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Mon Dec 08 14:32:21 2014 +0100 @@ -160,7 +160,7 @@ final Graph graph = (Graph) object; if (printer != null) { - // Get all current RiResolvedMethod instances in the context. + // Get all current JavaMethod instances in the context. List<String> inlineContext = getInlineContext(); // Reverse list such that inner method comes after outer method. @@ -272,6 +272,7 @@ } if (printer != null) { printer.close(); + printer = null; } } }