Mon, 14 Jul 2014 03:28:13 -0700
8049532: LogCompilation: C1: inlining tree is flat (no depth is stored)
Reviewed-by: roland, iveresov
1.1 --- a/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java Mon Jul 14 03:27:21 2014 -0700 1.2 +++ b/src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java Mon Jul 14 03:28:13 2014 -0700 1.3 @@ -406,9 +406,17 @@ 1.4 } else if (scopes.peek().getCalls().size() > 2 && m == scopes.peek().last(-2).getMethod()) { 1.5 scopes.push(scopes.peek().last(-2)); 1.6 } else { 1.7 - System.out.println(site.getMethod()); 1.8 - System.out.println(m); 1.9 - throw new InternalError("call site and parse don't match"); 1.10 + // C1 prints multiple method tags during inlining when it narrows method being inlinied. 1.11 + // Example: 1.12 + // ... 1.13 + // <method id="813" holder="694" name="toString" return="695" flags="1" bytes="36" iicount="1"/> 1.14 + // <call method="813" instr="invokevirtual"/> 1.15 + // <inline_success reason="receiver is statically known"/> 1.16 + // <method id="814" holder="792" name="toString" return="695" flags="1" bytes="5" iicount="3"/> 1.17 + // <parse method="814"> 1.18 + // ... 1.19 + site.setMethod(m); 1.20 + scopes.push(site); 1.21 } 1.22 } 1.23 } else if (qname.equals("parse_done")) {
2.1 --- a/src/share/vm/c1/c1_GraphBuilder.cpp Mon Jul 14 03:27:21 2014 -0700 2.2 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp Mon Jul 14 03:28:13 2014 -0700 2.3 @@ -3960,10 +3960,15 @@ 2.4 // Clear out bytecode stream 2.5 scope_data()->set_stream(NULL); 2.6 2.7 + CompileLog* log = compilation()->log(); 2.8 + if (log != NULL) log->head("parse method='%d'", log->identify(callee)); 2.9 + 2.10 // Ready to resume parsing in callee (either in the same block we 2.11 // were in before or in the callee's start block) 2.12 iterate_all_blocks(callee_start_block == NULL); 2.13 2.14 + if (log != NULL) log->done("parse"); 2.15 + 2.16 // If we bailed out during parsing, return immediately (this is bad news) 2.17 if (bailed_out()) 2.18 return false;