On 8/12/13 8:41 AM, Alan Bateman wrote:
On 12/08/2013 14:26, harold seigel wrote:

The change to the MakeClasslist tool to use TraceClassLoadingPreorder
was made prior to my changes.  The following code has been in
MakeClasslist.java for a long time.  I was unable to determine who had
made this change or why.

            // Understand only "Loading" from
-XX:+TraceClassLoadingPreorder.
            // This ignores old "Loaded" from -verbose:class to force
correct
            // classlist generation on Mustang.
            if (t.equals("Loading")) {
              t = tok.nextToken();
              t = t.replace('.', '/');

So, I don't know why TraceClassLoadingPreorder was chosen instead of
-verbose:class or TraceClassLoading.

The purpose of my changes are to update the comments to accurately
reflect what the code currently does and to fix a bug in
MakeClasslist.java's 'for' loop where the wrong set of strings is used.

Okay, I see this was changed to use TraceClassLoadingPreorder in 2006
(prior to OpenJDK). Brent might know more about the history.

I know that for a long while, -verbose:class output was used to generate the classlist. I did some digging...

In JDK 6, we started using TraceClassLoadingPreorder because it helped line things up better for cold start [1] - better order of disk reads, cut down on seeks, etc. I myself am not familiar with the details of how this was made to work.

There was a short-lived version of MakeClasslist that understood output from both -verbose:class and -XX:+TraceClassLoadingPreorder. The nightly build scripts at the time were used for building both JDK 5 & JDK 6 trains, so it had to work with both.

Later, support for -verbose:class was removed to ensure that the classlist for 6+ was always created based on TraceClassLoadingPreorder, to be sure we'd get the cold start benefit.

So that's what the comment about ignoring -verbose:class output is about.

-Brent

[1] http://bugs.sun.com/view_bug.do?bug_id=6449635 : "Optimize shared archive object ordering for better cold startup performance"

Reply via email to