JITWatch tool - why no nested parse tags in buildIR phase?

Chris Newland cnewland at chrisnewland.com
Fri Jun 27 21:07:36 UTC 2014


Hi, hope this is the correct place to discuss the hotspot.log output from
-XX:+LogCompilation ?

I've built a tool called JITWatch
(https://github.com/AdoptOpenJDK/jitwatch/wiki) for visualising the
HotSpot log file and experimenting with JIT'd code and I'm having problems
interpreting some of the output when -XX:+TieredCompilation is enabled.

Given code with a chain of method calls and a loop to call the first
method enough times to invoke the JIT compiler:

public class SandboxTest
{
    public int a(int x) { return 1 + b(x); }

    public int b(int x) { return 1 + c(x); }

    public int c(int x) { return 1 + x; }

    public static void main(String[] args)
    {
        SandboxTest test = new SandboxTest();

        int sum = 0;

        for (int i = 0 ; i < 1_000_000; i++)
        {
            sum = test.a(sum);
        }

        System.out.println("Sum:" + sum);
    }
}

I'm seeing very different output depending on whether tiered compilation
is enabled.

Without tiered compilation (Java 7 or Java 8 with -XX:-TieredCompilation)
I get the log file like:

https://gist.github.com/chriswhocodes/ad26dbbb5fc4703a8489

with a <phase name="parse"> where each method call is inside a nested
<parse></parse> section so I can clearly identify chained method calls.

With tiered compilation enabled I get a log file like:

https://gist.github.com/chriswhocodes/60774526fd00dcf2891a

with only <phase name="buildIR"> which contains only a single parse tag
and I don't think I can differentiate between chained calls and sequential
calls in the same method.

This means that under tiered compilation, I can no longer produce compile
and inlining visualisations like this one:
https://camo.githubusercontent.com/4470d767930acbce193402771cfee54f2cc281b7/687474703a2f2f7777772e63687269736e65776c616e642e636f6d2f696d616765732f6a697477617463682f636f6d70696c65636861696e312e706e67

Can anyone shed any light on how tiered compilation logs work and if there
is any way to pull out the same information as I could from Java 7 /
-XX:-TieredCompilation logs?

Many thanks,

Chris
@chriswhocodes



More information about the hotspot-compiler-dev mailing list