Change in JDK9 LogCompilation XML header

Chris Newland cnewland at chrisnewland.com
Sat Sep 12 13:39:12 UTC 2015


Hi,

Recently it looks like the code to output the XML LogCompilation header
has changed resulting in two of the tags <args> and <flags> not printing a
cr before the closing tag:

<args>
-XX:+UnlockDiagnosticVMOptions -XX:+TraceClassLoading -XX:+LogCompilation
</args>

Historically the opening tag, text content, and closing tag have always
been on separate lines. The other header tags still insert a cr before the
closing tag.

Difference is in share/vm/runtime/arguments.cpp

jdk8u-dev:

void Arguments::print_jvm_args_on(outputStream* st) {
  if (_num_jvm_args > 0) {
    for (int i=0; i < _num_jvm_args; i++) {
      st->print("%s ", _jvm_args_array[i]);
    }
    st->cr();
  }
}

jdk9:

void Arguments::print_jvm_args_on(outputStream* st) {
  if (_num_jvm_args > 0) {
    for (int i=0; i < _num_jvm_args; i++) {
      st->print("%s ", _jvm_args_array[i]);
    }
  }
}

If the cr was removed from arguments.cpp for a good reason then it can be
added into utilities/ostream.cpp with

    if (Arguments::num_jvm_args() > 0) {
      xs->head("args");
      Arguments::print_jvm_args_on(xs->text());
+     xs->cr();
      xs->tail("args");
    }

Thanks,

Chris



More information about the hotspot-dev mailing list