8003983: LogCompilation tool is broken since c1 support

Mon, 26 Nov 2012 15:11:55 +0100

author
neliasso
date
Mon, 26 Nov 2012 15:11:55 +0100
changeset 4320
c5d414e98fd4
parent 4319
dd38cfd12c3a
child 4322
228a94f37a67
child 4323
f0c2369fda5a

8003983: LogCompilation tool is broken since c1 support
Summary: Fixed emitting and parsing
Reviewed-by: jrose, kvn

src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java file | annotate | diff | comparison | revisions
src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_Compilation.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java	Mon Dec 03 15:48:49 2012 -0800
     1.2 +++ b/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java	Mon Nov 26 15:11:55 2012 +0100
     1.3 @@ -37,7 +37,7 @@
     1.4  public class LogCompilation extends DefaultHandler implements ErrorHandler, Constants {
     1.5  
     1.6      public static void usage(int exitcode) {
     1.7 -        System.out.println("Usage: LogCompilation [ -v ] [ -c ] [ -s ] [ -e | -N ] file1 ...");
     1.8 +        System.out.println("Usage: LogCompilation [ -v ] [ -c ] [ -s ] [ -e | -n ] file1 ...");
     1.9          System.out.println("  -c:   clean up malformed 1.5 xml");
    1.10          System.out.println("  -i:   print inlining decisions");
    1.11          System.out.println("  -S:   print compilation statistics");
     2.1 --- a/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Mon Dec 03 15:48:49 2012 -0800
     2.2 +++ b/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Mon Nov 26 15:11:55 2012 +0100
     2.3 @@ -224,7 +224,6 @@
     2.4          throw new InternalError("can't find " + name);
     2.5      }
     2.6      int indent = 0;
     2.7 -    String compile_id;
     2.8  
     2.9      String type(String id) {
    2.10          String result = types.get(id);
    2.11 @@ -268,7 +267,7 @@
    2.12          if (qname.equals("phase")) {
    2.13              Phase p = new Phase(search(atts, "name"),
    2.14                      Double.parseDouble(search(atts, "stamp")),
    2.15 -                    Integer.parseInt(search(atts, "nodes")),
    2.16 +                    Integer.parseInt(search(atts, "nodes", "0")),
    2.17                      Integer.parseInt(search(atts, "live")));
    2.18              phaseStack.push(p);
    2.19          } else if (qname.equals("phase_done")) {
    2.20 @@ -278,7 +277,7 @@
    2.21                  throw new InternalError("phase name mismatch");
    2.22              }
    2.23              p.setEnd(Double.parseDouble(search(atts, "stamp")));
    2.24 -            p.setEndNodes(Integer.parseInt(search(atts, "nodes")));
    2.25 +            p.setEndNodes(Integer.parseInt(search(atts, "nodes", "0")));
    2.26              p.setEndLiveNodes(Integer.parseInt(search(atts, "live")));
    2.27              compile.getPhases().add(p);
    2.28          } else if (qname.equals("task")) {
    2.29 @@ -323,13 +322,16 @@
    2.30              m.setName(search(atts, "name"));
    2.31              m.setReturnType(type(search(atts, "return")));
    2.32              m.setArguments(search(atts, "arguments", "void"));
    2.33 -            m.setBytes(search(atts, "bytes"));
    2.34 -            m.setIICount(search(atts, "iicount"));
    2.35 -            m.setFlags(search(atts, "flags"));
    2.36 +
    2.37 +            if (search(atts, "unloaded", "0").equals("0")) {
    2.38 +               m.setBytes(search(atts, "bytes"));
    2.39 +               m.setIICount(search(atts, "iicount"));
    2.40 +               m.setFlags(search(atts, "flags"));
    2.41 +            }
    2.42              methods.put(id, m);
    2.43          } else if (qname.equals("call")) {
    2.44              site = new CallSite(bci, method(search(atts, "method")));
    2.45 -            site.setCount(Integer.parseInt(search(atts, "count")));
    2.46 +            site.setCount(Integer.parseInt(search(atts, "count", "0")));
    2.47              String receiver = atts.getValue("receiver");
    2.48              if (receiver != null) {
    2.49                  site.setReceiver(type(receiver));
     3.1 --- a/src/share/vm/c1/c1_Compilation.cpp	Mon Dec 03 15:48:49 2012 -0800
     3.2 +++ b/src/share/vm/c1/c1_Compilation.cpp	Mon Nov 26 15:11:55 2012 +0100
     3.3 @@ -129,7 +129,15 @@
     3.4    CHECK_BAILOUT();
     3.5  
     3.6    // setup ir
     3.7 +  CompileLog* log = this->log();
     3.8 +  if (log != NULL) {
     3.9 +    log->begin_head("parse method='%d' ",
    3.10 +                    log->identify(_method));
    3.11 +    log->stamp();
    3.12 +    log->end_head();
    3.13 +  }
    3.14    _hir = new IR(this, method(), osr_bci());
    3.15 +  if (log)  log->done("parse");
    3.16    if (!_hir->is_valid()) {
    3.17      bailout("invalid parsing");
    3.18      return;

mercurial