changeset 22705:76e1d16c28cc

Make sure that at least a dummy Method is filled in during LogCompilation parsing
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Fri, 23 Oct 2015 10:09:48 -0700
parents ce4bec6db0b2
children 5cae0a06ca7d
files src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Fri Oct 23 13:24:08 2015 +0200
+++ b/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Fri Oct 23 10:09:48 2015 -0700
@@ -199,9 +199,11 @@
                 if (ble instanceof NMethod) {
                     NMethod nm = (NMethod) ble;
                     // Native wrappers for methods don't have a compilation and Graal methods don't either.
-                    if (c != null) {
-                        c.setNMethod(nm);
+                    if (c == null) {
+                        c = new Compilation(Integer.parseInt(nm.getId()));
+                        log.compiles.put(ble.getId(), c);
                     }
+                    c.setNMethod(nm);
                 } else {
                     if (c == null) {
                         // throw new InternalError("can't find compilation " + ble.getId() + " for " + ble);
@@ -306,9 +308,14 @@
             compile.setBCount(search(atts, "backedge_count", "0"));
 
             String method = atts.getValue("method");
+            Method m = new Method();
             int space = method.indexOf(' ');
-            method = method.substring(0, space) + "::" +
-                    method.substring(space + 1, method.indexOf(' ', space + 1) + 1);
+            m.setHolder(method.substring(0, space));
+            m.setName(method.substring(space + 1, method.indexOf(' ', space + 1) + 1));
+            m.setReturnType(method.substring(method.lastIndexOf(')') + 1));
+            m.setArguments(method.substring(method.indexOf('(') + 1, method.lastIndexOf(')')));
+            m.setFlags("0");
+            compile.setMethod(m);
             String compiler = atts.getValue("compiler");
             if (compiler == null) {
                 compiler = "";
@@ -320,10 +327,11 @@
             if (kind.equals("osr")) {
                 compile.setOsr(true);
                 compile.setOsr_bci(Integer.parseInt(search(atts, "osr_bci")));
+                compile.setMethod(m);
             } else if (kind.equals("c2i")) {
                 compile.setSpecial("--- adapter " + method);
             } else {
-                compile.setSpecial(compile.getId() + " " + method + " (0 bytes)");
+                compile.setMethod(m);
             }
             events.add(compile);
             compiles.put(makeId(atts), compile);