19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 import java.lang.management.MemoryPoolMXBean; 26 27 import sun.hotspot.WhiteBox; 28 import jdk.test.lib.Asserts; 29 30 /** 31 * @test ValueTypeDensity 32 * @summary Heap density test for ValueTypes 33 * @library /test/lib 34 * @compile -XDenableValueTypes ValueTypeDensity.java 35 * @run main ClassFileInstaller sun.hotspot.WhiteBox 36 * @run main/othervm -Xint -XX:+EnableValhalla -XX:+ValueArrayFlatten 37 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 38 * -XX:+WhiteBoxAPI ValueTypeDensity 39 * @run main/othervm -Xcomp -XX:+EnableValhalla -XX:+ValueArrayFlatten 40 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 41 * -XX:+WhiteBoxAPI ValueTypeDensity 42 */ 43 44 public class ValueTypeDensity { 45 46 private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); 47 48 public ValueTypeDensity() { 49 if (!WHITE_BOX.getBooleanVMFlag("ValueArrayFlatten")) { 50 throw new IllegalStateException("ValueArrayFlatten false"); 51 } 52 } 53 54 interface LocalDate { 55 public int getYear(); 56 public short getMonth(); 57 public short getDay(); 58 } | 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 import java.lang.management.MemoryPoolMXBean; 26 27 import sun.hotspot.WhiteBox; 28 import jdk.test.lib.Asserts; 29 30 /** 31 * @test ValueTypeDensity 32 * @summary Heap density test for ValueTypes 33 * @library /test/lib 34 * @compile -XDenableValueTypes ValueTypeDensity.java 35 * @run main ClassFileInstaller sun.hotspot.WhiteBox 36 * @run main/othervm -Xint -XX:+EnableValhalla -XX:+ValueArrayFlatten 37 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 38 * -XX:+WhiteBoxAPI ValueTypeDensity 39 */ 40 41 42 /* 43 * @run main/othervm -Xcomp -XX:+EnableValhalla -XX:+ValueArrayFlatten 44 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 45 * -XX:+WhiteBoxAPI ValueTypeDensity 46 */ 47 48 public class ValueTypeDensity { 49 50 private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); 51 52 public ValueTypeDensity() { 53 if (!WHITE_BOX.getBooleanVMFlag("ValueArrayFlatten")) { 54 throw new IllegalStateException("ValueArrayFlatten false"); 55 } 56 } 57 58 interface LocalDate { 59 public int getYear(); 60 public short getMonth(); 61 public short getDay(); 62 } |