< prev index next >

hotspot/test/runtime/valhalla/valuetypes/VDefaultTest.java

Print this page




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  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 package runtime.valhalla.valuetypes;
  25 
  26 import jdk.test.lib.Asserts;
  27 
  28 /*
  29  * @test VDefaultTest
  30  * @summary vdefault bytecode test
  31  * @library /test/lib
  32  * @compile -XDenableValueTypes Point.java VDefaultTest.java

  33  * @run main/othervm -Xint -XX:+EnableValhalla runtime.valhalla.valuetypes.VDefaultTest
  34  * @run main/othervm -Xcomp -XX:+EnableValhalla runtime.valhalla.valuetypes.VDefaultTest
  35  */
  36 
  37 public class VDefaultTest {
  38 
  39     static __ByValue final class Point {
  40         final int x;
  41         final int y;
  42 
  43         __ValueFactory static Point make() {
  44             Point p = __MakeDefault Point();
  45             return p;
  46         }
  47         
  48         Point() {
  49             x = 0;
  50             y = 0;
  51         }
  52     }




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  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 package runtime.valhalla.valuetypes;
  25 
  26 import jdk.test.lib.Asserts;
  27 
  28 /*
  29  * @test VDefaultTest
  30  * @summary vdefault bytecode test
  31  * @library /test/lib
  32  * @compile -XDenableValueTypes --add-modules jdk.incubator.mvt Point.java
  33  * @compile -XDenableValueTypes VDefaultTest.java
  34  * @run main/othervm -Xint -XX:+EnableValhalla runtime.valhalla.valuetypes.VDefaultTest
  35  * @run main/othervm -Xcomp -XX:+EnableValhalla runtime.valhalla.valuetypes.VDefaultTest
  36  */
  37 
  38 public class VDefaultTest {
  39 
  40     static __ByValue final class Point {
  41         final int x;
  42         final int y;
  43 
  44         __ValueFactory static Point make() {
  45             Point p = __MakeDefault Point();
  46             return p;
  47         }
  48         
  49         Point() {
  50             x = 0;
  51             y = 0;
  52         }
  53     }


< prev index next >