changeset 6960:72056acf27ab

improved toString() of the anonymous CodeInfo class used by the CFGPrinterObserver
author Doug Simon <doug.simon@oracle.com>
date Sun, 18 Nov 2012 21:15:48 +0100
parents 9c71ad0a0652
children 72b8f81ef9c4
files graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Sun Nov 18 21:10:55 2012 +0100
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Sun Nov 18 21:15:48 2012 +0100
@@ -154,7 +154,7 @@
             final byte[] code = Arrays.copyOf(tm.getTargetCode(), tm.getTargetCodeSize());
             CodeInfo info = new CodeInfo() {
                 public ResolvedJavaMethod getMethod() {
-                    return null;
+                    return curMethod;
                 }
                 public long getStart() {
                     return 0L;
@@ -162,6 +162,11 @@
                 public byte[] getCode() {
                     return code;
                 }
+                @Override
+                public String toString() {
+                    int size = code == null ? 0 : code.length;
+                    return getMethod() + " installed code; length = " + size;
+                }
             };
             cfgPrinter.printMachineCode(runtime.disassemble(info, tm), message);
         } else if (isCompilationResultAndCodeInfo(object)) {