8003983: LogCompilation tool is broken since c1 support
Summary: Fixed emitting and parsing
Reviewed-by: jrose, kvn
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java Mon Dec 03 15:48:49 2012 -0800
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java Mon Nov 26 15:11:55 2012 +0100
@@ -37,7 +37,7 @@
public class LogCompilation extends DefaultHandler implements ErrorHandler, Constants {
public static void usage(int exitcode) {
- System.out.println("Usage: LogCompilation [ -v ] [ -c ] [ -s ] [ -e | -N ] file1 ...");
+ System.out.println("Usage: LogCompilation [ -v ] [ -c ] [ -s ] [ -e | -n ] file1 ...");
System.out.println(" -c: clean up malformed 1.5 xml");
System.out.println(" -i: print inlining decisions");
System.out.println(" -S: print compilation statistics");
--- a/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java Mon Dec 03 15:48:49 2012 -0800
+++ b/hotspot/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java Mon Nov 26 15:11:55 2012 +0100
@@ -224,7 +224,6 @@
throw new InternalError("can't find " + name);
}
int indent = 0;
- String compile_id;
String type(String id) {
String result = types.get(id);
@@ -268,7 +267,7 @@
if (qname.equals("phase")) {
Phase p = new Phase(search(atts, "name"),
Double.parseDouble(search(atts, "stamp")),
- Integer.parseInt(search(atts, "nodes")),
+ Integer.parseInt(search(atts, "nodes", "0")),
Integer.parseInt(search(atts, "live")));
phaseStack.push(p);
} else if (qname.equals("phase_done")) {
@@ -278,7 +277,7 @@
throw new InternalError("phase name mismatch");
}
p.setEnd(Double.parseDouble(search(atts, "stamp")));
- p.setEndNodes(Integer.parseInt(search(atts, "nodes")));
+ p.setEndNodes(Integer.parseInt(search(atts, "nodes", "0")));
p.setEndLiveNodes(Integer.parseInt(search(atts, "live")));
compile.getPhases().add(p);
} else if (qname.equals("task")) {
@@ -323,13 +322,16 @@
m.setName(search(atts, "name"));
m.setReturnType(type(search(atts, "return")));
m.setArguments(search(atts, "arguments", "void"));
- m.setBytes(search(atts, "bytes"));
- m.setIICount(search(atts, "iicount"));
- m.setFlags(search(atts, "flags"));
+
+ if (search(atts, "unloaded", "0").equals("0")) {
+ m.setBytes(search(atts, "bytes"));
+ m.setIICount(search(atts, "iicount"));
+ m.setFlags(search(atts, "flags"));
+ }
methods.put(id, m);
} else if (qname.equals("call")) {
site = new CallSite(bci, method(search(atts, "method")));
- site.setCount(Integer.parseInt(search(atts, "count")));
+ site.setCount(Integer.parseInt(search(atts, "count", "0")));
String receiver = atts.getValue("receiver");
if (receiver != null) {
site.setReceiver(type(receiver));
--- a/hotspot/src/share/vm/c1/c1_Compilation.cpp Mon Dec 03 15:48:49 2012 -0800
+++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp Mon Nov 26 15:11:55 2012 +0100
@@ -129,7 +129,15 @@
CHECK_BAILOUT();
// setup ir
+ CompileLog* log = this->log();
+ if (log != NULL) {
+ log->begin_head("parse method='%d' ",
+ log->identify(_method));
+ log->stamp();
+ log->end_head();
+ }
_hir = new IR(this, method(), osr_bci());
+ if (log) log->done("parse");
if (!_hir->is_valid()) {
bailout("invalid parsing");
return;