1 /* 2 * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 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.inlinetypes; 25 26 import jdk.internal.vm.annotation.ImplicitlyConstructible; 27 import jdk.internal.vm.annotation.LooselyConsistentValue; 28 import jdk.test.lib.Asserts; 29 30 @ImplicitlyConstructible 31 @LooselyConsistentValue 32 public final value class Long8Inline { 33 34 final long longField1; 35 final long longField2; 36 final long longField3; 37 final long longField4; 38 final long longField5; 39 final long longField6; 40 final long longField7; 41 final long longField8; 42 43 public Long8Inline(long l1, long l2, long l3, long l4, long l5, long l6, long l7, long l8) { 44 longField1 = l1; 45 longField2 = l2; 46 longField3 = l3; 47 longField4 = l4; 48 longField5 = l5; 49 longField6 = l6; 50 longField7 = l7; 51 longField8 = l8; 52 } 53 54 public long getLongField1() { return longField1; } 55 public long getLongField2() { return longField2; } 56 public long getLongField3() { return longField3; } 57 public long getLongField4() { return longField4; } 58 public long getLongField5() { return longField5; } 59 public long getLongField6() { return longField6; } 60 public long getLongField7() { return longField7; } 61 public long getLongField8() { return longField8; } 62 63 static void check(Long8Inline value, 64 long long1, 65 long long2, 66 long long3, 67 long long4, 68 long long5, 69 long long6, 70 long long7, 71 long long8) { 72 Asserts.assertEquals(value.getLongField1(), long1, "Field 1 incorrect"); 73 Asserts.assertEquals(value.getLongField2(), long2, "Field 2 incorrect"); 74 Asserts.assertEquals(value.getLongField3(), long3, "Field 3 incorrect"); 75 Asserts.assertEquals(value.getLongField4(), long4, "Field 4 incorrect"); 76 Asserts.assertEquals(value.getLongField5(), long5, "Field 5 incorrect"); 77 Asserts.assertEquals(value.getLongField6(), long6, "Field 6 incorrect"); 78 Asserts.assertEquals(value.getLongField7(), long7, "Field 7 incorrect"); 79 Asserts.assertEquals(value.getLongField8(), long8, "Field 8 incorrect"); 80 } 81 82 }