< prev index next >

test/runtime/valhalla/valuetypes/ValueTypeDensity.java

Print this page




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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 -noverify -Xint -XX:+EnableValhalla -XX:+ValueArrayFlatten
  37  *                   -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  38  *                    -XX:+WhiteBoxAPI ValueTypeDensity
  39  * @run main/othervm -noverify -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     }
  59 




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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     }
  59 


< prev index next >