RFR: 8175026: Capture build-time parameters to --generate-jli-classes
mandy.chung at oracle.com
Wed Feb 15 19:09:36 UTC 2017
> On Feb 15, 2017, at 9:12 AM, Claes Redestad <claes.redestad at oracle.com> wrote:
> currently the file we generate at build time as input to
> --generate-jli-classes is lost when linking custom images, which means
> user generate images may perform worse in certain ways, mostly
> generating more classes during startup.
> Additionally, there's a strong assumption in --generate-jli-classes that
> the VM running jlink is going to generate compatible classes with the
> image being linked, which we can only really guarantee if the java.base
> in the linked image is of the same version as the java.base in the VM
> running jlink. This patch tightens these checks to ensure we have
> freedom to evolve and re-evaluate the implementation in future
> JDK: http://cr.openjdk.java.net/~redestad/8175026/jdk.01/
> Top: http://cr.openjdk.java.net/~redestad/8175026/top.01/
This restriction sounds reasonable and we can enhance this in a future release. I think the plugin can record the configuration in its own format to be independent of the trace output format.
Instead of throwing ISA, you can have a test method to return a boolean to indicate if the default trace file should be read.
Instead of running java.base from the runtime, you can use Runtime.version() instead and I think comparing Version::major should be adequate.
This change disables this default setting entirely if the image being created is not the same version as this plugin (defaultSpecies and defaultInvokers, etc). Is it intended?
In addition, if the main argument is specified but the version does not match, it will ignore the given argument. Should it be an error instead? We are the one who will generate a trace file and specify it in the jlink plugin option. It’s okay to ignore the default trace output if no plugin option is specified and I think no warning should be printed in this case. It’s just like this plugin is disabled. You may want to add a suboption to turn on verbose that will trace what is generated and what is ignored.
More information about the build-dev