Created
May 5, 2014 13:18
-
-
Save chrisdennis/6aa514614d9de15be2ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi Chris, | |
Prior to this changeset: https://bugs.openjdk.java.net/browse/JDK-6924259 Hotspot had hardcoded assumptions about the field offsets of the various fields in java.lang.String. This means if you add fields to the String class which cause the class layouting logic to move the existing fields around you will break the JVM. The changeset above moves the JVM to instead compute these offsets at runtime from the real String class layout. The associated bug shows what version this has been back ported to: https://bugs.openjdk.java.net/browse/JDK-6924259. I've not tested anything but I'm pretty sure that @shipilev's example would have worked in a JVM prior to this change anyway since the single boolean didn't shift any of the existing fields. Either way, use a recent JVM and all should be fine. Use an older JVM and mucho breakage can result. | |
Chris (@tall_chris) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment