in core/src/main/java/org/adoptopenjdk/jitwatch/parser/hotspot/HotSpotLogParser.java [240:337]
private void handleLogLine(final String inCurrentLine)
{
String currentLine = inCurrentLine;
NumberedLine numberedLine = new NumberedLine(parseLineNumber++, currentLine);
if (TAG_TTY.equals(currentLine))
{
inHeader = false;
return;
}
else if (currentLine.startsWith(TAG_XML))
{
inHeader = true;
}
if (inHeader)
{
// HotSpot log header XML can have text nodes so consume all lines
splitLog.addHeaderLine(numberedLine);
}
else
{
if (currentLine.startsWith(TAG_OPEN_CDATA) || currentLine.startsWith(TAG_CLOSE_CDATA)
|| currentLine.startsWith(TAG_OPEN_CLOSE_CDATA))
{
// ignore, TagProcessor will recognise from <fragment> tag
}
else if (currentLine.startsWith(S_OPEN_ANGLE))
{
// After the header, XML nodes do not have text nodes
splitLog.addCompilationLine(numberedLine);
}
else if (currentLine.startsWith(LOADED))
{
splitLog.addClassLoaderLine(numberedLine);
}
else if (currentLine.startsWith(S_AT))
{
// possible PrintCompilation was enabled as well as
// LogCompilation?
// jmh does this with perf annotations
// Ignore this line
}
else if (currentLine.indexOf(S_OPEN_ANGLE + TAG_NMETHOD) != -1)
{
// need to cope with nmethod appearing on same line as last hlt
// 0x0000 hlt <nmethod compile_id= ....
int indexNMethod = currentLine.indexOf(S_OPEN_ANGLE + TAG_NMETHOD);
if (DEBUG_LOGGING)
{
logger.debug("detected nmethod tag mangled with assembly");
}
String assembly = currentLine.substring(0, indexNMethod);
String remainder = currentLine.substring(indexNMethod);
numberedLine.setLine(assembly);
splitLog.addAssemblyLine(numberedLine);
handleLogLine(remainder);
}
else if (currentLine.indexOf(S_OPEN_ANGLE + S_SLASH + TAG_PRINT_NMETHOD) != -1)
{
// need to cope with </print_nmethod> appearing on same last as
// last assembly statement
// ImmutableOopMap{rsi=Oop }pc offsets: 182 192 197 206 215
// </print_nmethod>
int indexClosePrintNmethod = currentLine.indexOf(S_OPEN_ANGLE + S_SLASH + TAG_PRINT_NMETHOD);
if (DEBUG_LOGGING)
{
logger.debug("detected </print_nmethod> tag mangled with assembly");
}
String assembly = currentLine.substring(0, indexClosePrintNmethod);
String remainder = currentLine.substring(indexClosePrintNmethod);
numberedLine.setLine(assembly);
splitLog.addAssemblyLine(numberedLine);
handleLogLine(remainder);
}
else
{
splitLog.addAssemblyLine(numberedLine);
}
}
}