in core/src/main/java/org/adoptopenjdk/jitwatch/model/JITDataModel.java [160:257]
public void updateStats(IMetaMember member, Map<String, String> attrs)
{
String fullSignature = member.toString();
for (String modifier : MODIFIERS)
{
if (fullSignature.contains(modifier + S_SPACE))
{
String incMethodName = "incCount" + modifier.substring(0, 1).toUpperCase() + modifier.substring(1);
try
{
MethodType mt = MethodType.methodType(void.class);
MethodHandle mh = MethodHandles.lookup().findVirtual(JITStats.class, incMethodName, mt);
mh.invokeExact(stats);
}
catch (Throwable t)
{
logger.error("Exception: {}", t.getMessage(), t);
}
}
}
String level = attrs.get(ATTR_LEVEL);
if (level != null)
{
if ("1".equals(level))
{
stats.incCountLevel1();
}
else if ("2".equals(level))
{
stats.incCountLevel2();
}
else if ("3".equals(level))
{
stats.incCountLevel3();
}
else if ("4".equals(level))
{
stats.incCountLevel4();
}
}
else
{
stats.incCountLevel4();
}
String compiler = attrs.get(ATTR_COMPILER);
if (compiler != null)
{
if (C1.equalsIgnoreCase(compiler))
{
stats.incCountC1();
}
else if (C2.equalsIgnoreCase(compiler))
{
stats.incCountC2();
}
}
String compileKind = attrs.get(ATTR_COMPILE_KIND);
boolean isC2N = false;
if (compileKind != null)
{
if (OSR.equalsIgnoreCase(compileKind))
{
stats.incCountOSR();
}
else if (C2N.equalsIgnoreCase(compileKind))
{
stats.incCountC2N();
isC2N = true;
}
}
String compileID = attrs.get(ATTR_COMPILE_ID);
Compilation compilation = member.getCompilationByCompileID(compileID);
if (compilation != null)
{
if (!isC2N)
{
stats.recordDelay(compilation.getCompilationDuration());
}
}
else
{
logger.warn("Didn't find compilation with ID {} on member {}", compileID, member.getFullyQualifiedMemberName());
}
}