RFR: 8171855: Move package name transformations during module bootstrap into VM

Lois Foltan lois.foltan at oracle.com
Tue Jan 3 15:56:43 UTC 2017

On 1/2/2017 1:27 PM, Claes Redestad wrote:
> Hi,
> during jigsaw bootstrap, package names - represented in external form,
> "java.lang" - are transformed into VM internal form, "java/lang",
> before calling into the VM.
> This, however, can effectively be moved into the VM, which removes the
> need to generate a lot of short-lived strings during bootstrap and heat
> up various String.replace-related methods.  This has a noticeable impact
> on startup metrics.
> Webrev: http://cr.openjdk.java.net/~redestad/8171855/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8171855
> JPRT -testset hotspot pass, and I've prepared to push this into jdk9/hs
> if there are no objections.
> Char-based replace on a UTF-8 source should be correct as long as the
> from and to chars are ASCII (0x00 through 0x7F).  A more general method
> would be needed to safely deal with char values above 0x7F, so adding
> some asserts to that effect should be considered.

Hi Claes,

I have some concerns about this change in that it will break the 
precedence that currently the only internal form of names that the VM 
deals with are binary names as they appear in class files, where the 
periods (.) have been replaced by forward slashes (/).  I think I would 
like to discuss this with the runtime team before you proceed.

As far as the actual changes go, if we do proceed with this, there are 
places in modules.cpp that have been missed.  After line #535, #665, 
#749 (the replace should be moved before the verify of the package name 
occurs), #820.


> Thanks!
> /Claes

More information about the jigsaw-dev mailing list