@@ -1253,7 +1253,7 @@ static value class FlatUnAlignedObjectBackfill2 {
1253
1253
}
1254
1254
1255
1255
@ Test (priority =3 , invocationCount =2 )
1256
- static public void testLayoutsWithPrimitives () throws Throwable {
1256
+ static public void testLayoutsWithNullRestrictedFields () throws Throwable {
1257
1257
SingleBackfill ! singleBackfillInstance = new SingleBackfill (defaultLong , defaultObject , defaultInt );
1258
1258
assertEquals (singleBackfillInstance .i , defaultInt );
1259
1259
assertEquals (singleBackfillInstance .o , defaultObject );
@@ -1784,6 +1784,42 @@ static public void testIdentityObjectOnRef() throws Throwable {
1784
1784
assertTrue (IdentityObject .class .isIdentity ());
1785
1785
}
1786
1786
1787
+ @ Test (priority =1 )
1788
+ static public void testIsValueClassOnValueType () throws Throwable {
1789
+ assertTrue (ValueLong .class .isValue ());
1790
+ assertFalse (ValueLong .class .isIdentity ());
1791
+ }
1792
+
1793
+ private interface TestInterface {}
1794
+
1795
+ @ Test (priority =1 )
1796
+ static public void testIsValueClassOnInterface () throws Throwable {
1797
+ assertFalse (TestInterface .class .isValue ());
1798
+ assertFalse (TestInterface .class .isIdentity ());
1799
+ }
1800
+
1801
+ @ Test (priority =1 )
1802
+ static public void testIsValueClassOnAbstractClass () throws Throwable {
1803
+ assertFalse (HeavyAbstractClass .class .isValue ());
1804
+ assertTrue (HeavyAbstractClass .class .isIdentity ());
1805
+ }
1806
+
1807
+ @ Test (priority =1 )
1808
+ static public void testIsValueOnValueArrayClass () throws Throwable {
1809
+ assertFalse (ValueLong .class .arrayType ().isValue ());
1810
+ assertTrue (ValueLong .class .arrayType ().isIdentity ());
1811
+ }
1812
+
1813
+ static class TestIsValueOnRefArrayClass {
1814
+ long longField ;
1815
+ }
1816
+
1817
+ @ Test (priority =1 )
1818
+ static public void testIsValueOnRefArrayClass () throws Throwable {
1819
+ assertFalse (TestIsValueOnRefArrayClass .class .arrayType ().isValue ());
1820
+ assertTrue (TestIsValueOnRefArrayClass .class .arrayType ().isIdentity ());
1821
+ }
1822
+
1787
1823
static value class ValueIntPoint2D {
1788
1824
final ValueInt x , y ;
1789
1825
@@ -1826,6 +1862,17 @@ static value class ClassWithOnlyStaticFieldsWithSingleAlignment {
1826
1862
static Triangle2D ! tri2 ;
1827
1863
}
1828
1864
1865
+ /* Prioritize before static fields are set by testStaticFieldsWithSingleAlignment */
1866
+ @ Test (priority =3 , invocationCount =2 )
1867
+ static public void testStaticFieldsWithSingleAlignmenDefaultValues () throws Throwable {
1868
+ assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .tri );
1869
+ assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .point );
1870
+ assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .line );
1871
+ assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .i );
1872
+ assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .f );
1873
+ assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .tri2 );
1874
+ }
1875
+
1829
1876
@ Test (priority =4 )
1830
1877
static public void testStaticFieldsWithSingleAlignment () throws Throwable {
1831
1878
ClassWithOnlyStaticFieldsWithSingleAlignment .tri = new Triangle2D (defaultTrianglePositions );
@@ -1843,16 +1890,6 @@ static public void testStaticFieldsWithSingleAlignment() throws Throwable {
1843
1890
ClassWithOnlyStaticFieldsWithSingleAlignment .tri2 .checkEqualTriangle2D (defaultTrianglePositions );
1844
1891
}
1845
1892
1846
- @ Test (priority =5 , invocationCount =2 )
1847
- static public void testStaticFieldsWithSingleAlignmenDefaultValues () throws Throwable {
1848
- assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .tri );
1849
- assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .point );
1850
- assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .line );
1851
- assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .i );
1852
- assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .f );
1853
- assertNotNull (ClassWithOnlyStaticFieldsWithSingleAlignment .tri2 );
1854
- }
1855
-
1856
1893
static value class ClassWithOnlyStaticFieldsWithLongAlignment {
1857
1894
static Point2D ! point ;
1858
1895
static FlattenedLine2D ! line ;
@@ -1863,6 +1900,18 @@ static value class ClassWithOnlyStaticFieldsWithLongAlignment {
1863
1900
static Triangle2D ! tri ;
1864
1901
}
1865
1902
1903
+ /* Prioritize before static fields are set by testStaticFieldsWithLongAlignment */
1904
+ @ Test (priority =3 , invocationCount =2 )
1905
+ static public void testStaticFieldsWithLongAlignmenDefaultValues () throws Throwable {
1906
+ assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .point );
1907
+ assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .line );
1908
+ assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .o );
1909
+ assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .l );
1910
+ assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .d );
1911
+ assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .i );
1912
+ assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .tri );
1913
+ }
1914
+
1866
1915
@ Test (priority =4 )
1867
1916
static public void testStaticFieldsWithLongAlignment () throws Throwable {
1868
1917
ClassWithOnlyStaticFieldsWithLongAlignment .point = new Point2D (defaultPointPositions1 );
@@ -1882,17 +1931,6 @@ static public void testStaticFieldsWithLongAlignment() throws Throwable {
1882
1931
ClassWithOnlyStaticFieldsWithLongAlignment .tri .checkEqualTriangle2D (defaultTrianglePositions );
1883
1932
}
1884
1933
1885
- @ Test (priority =5 , invocationCount =2 )
1886
- static public void testStaticFieldsWithLongAlignmenDefaultValues () throws Throwable {
1887
- assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .point );
1888
- assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .line );
1889
- assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .o );
1890
- assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .l );
1891
- assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .d );
1892
- assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .i );
1893
- assertNotNull (ClassWithOnlyStaticFieldsWithLongAlignment .tri );
1894
- }
1895
-
1896
1934
static value class ClassWithOnlyStaticFieldsWithObjectAlignment {
1897
1935
static Triangle2D ! tri ;
1898
1936
static Point2D ! point ;
@@ -1903,6 +1941,18 @@ static value class ClassWithOnlyStaticFieldsWithObjectAlignment {
1903
1941
static Triangle2D ! tri2 ;
1904
1942
}
1905
1943
1944
+ /* Prioritize before static fields are set by testStaticFieldsWithObjectAlignment */
1945
+ @ Test (priority =3 , invocationCount =2 )
1946
+ static public void testStaticFieldsWithObjectAlignmentDefaultValues () throws Throwable {
1947
+ assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .tri );
1948
+ assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .point );
1949
+ assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .line );
1950
+ assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .o );
1951
+ assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .i );
1952
+ assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .f );
1953
+ assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .tri2 );
1954
+ }
1955
+
1906
1956
@ Test (priority =4 )
1907
1957
static public void testStaticFieldsWithObjectAlignment () throws Throwable {
1908
1958
ClassWithOnlyStaticFieldsWithObjectAlignment .tri = new Triangle2D (defaultTrianglePositions );
@@ -1922,17 +1972,6 @@ static public void testStaticFieldsWithObjectAlignment() throws Throwable {
1922
1972
ClassWithOnlyStaticFieldsWithObjectAlignment .tri2 .checkEqualTriangle2D (defaultTrianglePositions );
1923
1973
}
1924
1974
1925
- @ Test (priority =5 , invocationCount =2 )
1926
- static public void testStaticFieldsWithObjectAlignmentDefaultValues () throws Throwable {
1927
- assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .tri );
1928
- assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .point );
1929
- assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .line );
1930
- assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .o );
1931
- assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .i );
1932
- assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .f );
1933
- assertNotNull (ClassWithOnlyStaticFieldsWithObjectAlignment .tri2 );
1934
- }
1935
-
1936
1975
//*******************************************************************************
1937
1976
// GC tests
1938
1977
//*******************************************************************************
@@ -2034,7 +2073,7 @@ static public void testGCFlattenedMegaObjectArray() throws Throwable {
2034
2073
/*
2035
2074
* Create large number of value types and instantiate them
2036
2075
*
2037
- * value Point2D# {
2076
+ * value Point2D {
2038
2077
* int x;
2039
2078
* int y;
2040
2079
* }
@@ -2551,7 +2590,7 @@ static public void testValueTypeHasSynchMethods() throws Throwable {
2551
2590
* Create a value type and read the fields before
2552
2591
* they are set. The test should Verify that the
2553
2592
* flattenable fields are set to the default values.
2554
- * NULL should never be observed for Qtypes .
2593
+ * NULL should never be observed for nullrestricted fields .
2555
2594
*/
2556
2595
@ Test (priority =4 )
2557
2596
static public void testDefaultValues () throws Throwable {
@@ -2589,6 +2628,9 @@ static public void testDefaultValues() throws Throwable {
2589
2628
/*
2590
2629
* Create Array Objects with Point Class without initialization
2591
2630
* The array should be set to a Default Value.
2631
+ *
2632
+ * TODO not sure if this array needs to be nullrestricted, currently the ri
2633
+ * is not up to date on this. Revisit this later.
2592
2634
*/
2593
2635
@ Test (priority =4 , invocationCount =2 )
2594
2636
static public void testDefaultValueInPointArray () throws Throwable {
@@ -2812,8 +2854,8 @@ static public void testCyclicalStaticFieldDefaultValues3() throws Throwable {
2812
2854
static public void testCheckCastValueTypeOnInvalidClass () throws Throwable {
2813
2855
String fields [] = {"longField:J" };
2814
2856
Class valueClass = ValueTypeGenerator .generateValueClass ("TestCheckCastOnInvalidClass" , fields );
2815
- MethodHandle checkCastOnInvalidLtype = lookup .findStatic (valueClass , "testCheckCastOnInvalidClass" , MethodType .methodType (Object .class ));
2816
- checkCastOnInvalidLtype .invoke ();
2857
+ MethodHandle checkCastOnInvalidClass = lookup .findStatic (valueClass , "testCheckCastOnInvalidClass" , MethodType .methodType (Object .class ));
2858
+ checkCastOnInvalidClass .invoke ();
2817
2859
}
2818
2860
2819
2861
/*
0 commit comments