8003983: LogCompilation tool is broken since c1 support

Fixed emitting and parsing

Reviewed-by: jrose, kvn
This commit is contained in:
Nils Eliasson 2012-11-26 15:11:55 +01:00
parent c5240e7c53
commit 42c0192ee6
3 changed files with 18 additions and 8 deletions

View file

@ -37,7 +37,7 @@ import org.xml.sax.helpers.*;
public class LogCompilation extends DefaultHandler implements ErrorHandler, Constants { public class LogCompilation extends DefaultHandler implements ErrorHandler, Constants {
public static void usage(int exitcode) { 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(" -c: clean up malformed 1.5 xml");
System.out.println(" -i: print inlining decisions"); System.out.println(" -i: print inlining decisions");
System.out.println(" -S: print compilation statistics"); System.out.println(" -S: print compilation statistics");

View file

@ -224,7 +224,6 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
throw new InternalError("can't find " + name); throw new InternalError("can't find " + name);
} }
int indent = 0; int indent = 0;
String compile_id;
String type(String id) { String type(String id) {
String result = types.get(id); String result = types.get(id);
@ -268,7 +267,7 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
if (qname.equals("phase")) { if (qname.equals("phase")) {
Phase p = new Phase(search(atts, "name"), Phase p = new Phase(search(atts, "name"),
Double.parseDouble(search(atts, "stamp")), Double.parseDouble(search(atts, "stamp")),
Integer.parseInt(search(atts, "nodes")), Integer.parseInt(search(atts, "nodes", "0")),
Integer.parseInt(search(atts, "live"))); Integer.parseInt(search(atts, "live")));
phaseStack.push(p); phaseStack.push(p);
} else if (qname.equals("phase_done")) { } else if (qname.equals("phase_done")) {
@ -278,7 +277,7 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
throw new InternalError("phase name mismatch"); throw new InternalError("phase name mismatch");
} }
p.setEnd(Double.parseDouble(search(atts, "stamp"))); 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"))); p.setEndLiveNodes(Integer.parseInt(search(atts, "live")));
compile.getPhases().add(p); compile.getPhases().add(p);
} else if (qname.equals("task")) { } else if (qname.equals("task")) {
@ -323,13 +322,16 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
m.setName(search(atts, "name")); m.setName(search(atts, "name"));
m.setReturnType(type(search(atts, "return"))); m.setReturnType(type(search(atts, "return")));
m.setArguments(search(atts, "arguments", "void")); m.setArguments(search(atts, "arguments", "void"));
if (search(atts, "unloaded", "0").equals("0")) {
m.setBytes(search(atts, "bytes")); m.setBytes(search(atts, "bytes"));
m.setIICount(search(atts, "iicount")); m.setIICount(search(atts, "iicount"));
m.setFlags(search(atts, "flags")); m.setFlags(search(atts, "flags"));
}
methods.put(id, m); methods.put(id, m);
} else if (qname.equals("call")) { } else if (qname.equals("call")) {
site = new CallSite(bci, method(search(atts, "method"))); 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"); String receiver = atts.getValue("receiver");
if (receiver != null) { if (receiver != null) {
site.setReceiver(type(receiver)); site.setReceiver(type(receiver));

View file

@ -129,7 +129,15 @@ void Compilation::build_hir() {
CHECK_BAILOUT(); CHECK_BAILOUT();
// setup ir // 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()); _hir = new IR(this, method(), osr_bci());
if (log) log->done("parse");
if (!_hir->is_valid()) { if (!_hir->is_valid()) {
bailout("invalid parsing"); bailout("invalid parsing");
return; return;