< prev index next >

hotspot/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java

Print this page




  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 // TODO add bugid and summary
  25 
  26 /*
  27  * @test
  28  * @library /testlibrary /test/lib /compiler/whitebox /
  29  * @requires os.simpleArch == "x64"
  30  * @modules java.base/jdk.internal.misc:+open


  31  * @compile -XDenableValueTypes ValueCapableClass1.java ValueCapableClass2.java ValueTypeTestBench.java
  32  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  33  * @run main ClassFileInstaller jdk.test.lib.Platform
  34  * @run main/othervm -Xbootclasspath/a:. -ea -noverify -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  35  *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+VerifyAdapterSharing -XX:+VerifyStack
  36  *                   -XX:+EnableValhalla -XX:+EnableMVT -XX:+ValueTypePassFieldsAsArgs -XX:+ValueTypeReturnedAsFields -XX:+ValueArrayFlatten
  37  *                   -XX:ValueArrayElemMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatOops=-1
  38  *                   -Djdk.lang.reflect.DVT=true
  39  *                   compiler.valhalla.valuetypes.ValueTypeTestBench
  40  * @run main/othervm -Xbootclasspath/a:. -ea -noverify -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  41  *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+VerifyStack
  42  *                   -XX:+EnableValhalla -XX:+EnableMVT -XX:-ValueTypePassFieldsAsArgs -XX:-ValueTypeReturnedAsFields -XX:-ValueArrayFlatten
  43  *                   -Djdk.lang.reflect.DVT=true
  44  *                   compiler.valhalla.valuetypes.ValueTypeTestBench
  45  * @run main/othervm -Xbootclasspath/a:. -ea -noverify -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  46  *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+AlwaysIncrementalInline
  47  *                   -XX:+EnableValhalla -XX:+EnableMVT -XX:+ValueTypePassFieldsAsArgs -XX:+ValueTypeReturnedAsFields -XX:+ValueArrayFlatten
  48  *                   -XX:ValueArrayElemMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatOops=-1
  49  *                   -Djdk.lang.reflect.DVT=true
  50  *                   compiler.valhalla.valuetypes.ValueTypeTestBench
  51  */
  52 
  53 package compiler.valhalla.valuetypes;
  54 
  55 import compiler.whitebox.CompilerWhiteBoxTest;
  56 import jdk.internal.misc.Unsafe;

  57 import jdk.test.lib.Asserts;
  58 import jdk.test.lib.management.InputArguments;
  59 import jdk.test.lib.Platform;
  60 import jdk.test.lib.process.ProcessTools;
  61 import jdk.test.lib.process.OutputAnalyzer;
  62 import jdk.test.lib.Utils;
  63 import sun.hotspot.WhiteBox;
  64 
  65 import java.lang.annotation.Retention;
  66 import java.lang.annotation.RetentionPolicy;
  67 import java.lang.annotation.Repeatable;
  68 import java.lang.invoke.*;
  69 import java.lang.reflect.Method;
  70 import java.util.ArrayList;
  71 import java.util.Arrays;
  72 import java.util.Hashtable;
  73 import java.util.LinkedHashMap;
  74 import java.util.List;
  75 import java.util.Map;
  76 import java.util.regex.Matcher;
  77 import java.util.regex.Pattern;
  78 import jdk.experimental.value.*;
  79 
  80 // Test value types
  81 __ByValue final class MyValue1 {
  82     static int s;
  83     static final long sf = ValueTypeTestBench.rL;
  84     final int x;
  85     final long y;
  86     final short z;
  87     final Integer o;
  88     final int[] oa;
  89     final MyValue2 v1;
  90     final MyValue2 v2;
  91     static final MyValue2 v3 = MyValue2.createWithFieldsInline(ValueTypeTestBench.rI, true);
  92     final int c;
  93 
  94     private MyValue1() {
  95         s = 0;
  96         this.x = 0;
  97         this.y = 0;
  98         this.z = 0;




  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 // TODO add bugid and summary
  25 
  26 /*
  27  * @test
  28  * @library /testlibrary /test/lib /compiler/whitebox /
  29  * @requires os.simpleArch == "x64"
  30  * @modules java.base/jdk.experimental.value
  31  *          java.base/jdk.internal.misc:+open
  32  *          jdk.incubator.mvt
  33  * @compile -XDenableValueTypes ValueCapableClass1.java ValueCapableClass2.java ValueTypeTestBench.java
  34  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  35  * @run main ClassFileInstaller jdk.test.lib.Platform
  36  * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -noverify -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  37  *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+VerifyAdapterSharing -XX:+VerifyStack
  38  *                   -XX:+EnableValhalla -XX:+EnableMVT -XX:+ValueTypePassFieldsAsArgs -XX:+ValueTypeReturnedAsFields -XX:+ValueArrayFlatten
  39  *                   -XX:ValueArrayElemMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatOops=-1
  40  *                   -Djdk.lang.reflect.DVT=true
  41  *                   compiler.valhalla.valuetypes.ValueTypeTestBench
  42  * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -noverify -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  43  *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+VerifyStack
  44  *                   -XX:+EnableValhalla -XX:+EnableMVT -XX:-ValueTypePassFieldsAsArgs -XX:-ValueTypeReturnedAsFields -XX:-ValueArrayFlatten
  45  *                   -Djdk.lang.reflect.DVT=true
  46  *                   compiler.valhalla.valuetypes.ValueTypeTestBench
  47  * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -noverify -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  48  *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+AlwaysIncrementalInline
  49  *                   -XX:+EnableValhalla -XX:+EnableMVT -XX:+ValueTypePassFieldsAsArgs -XX:+ValueTypeReturnedAsFields -XX:+ValueArrayFlatten
  50  *                   -XX:ValueArrayElemMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatOops=-1
  51  *                   -Djdk.lang.reflect.DVT=true
  52  *                   compiler.valhalla.valuetypes.ValueTypeTestBench
  53  */
  54 
  55 package compiler.valhalla.valuetypes;
  56 
  57 import compiler.whitebox.CompilerWhiteBoxTest;
  58 import jdk.experimental.value.MethodHandleBuilder;
  59 import jdk.incubator.mvt.ValueType;
  60 import jdk.test.lib.Asserts;
  61 import jdk.test.lib.management.InputArguments;
  62 import jdk.test.lib.Platform;
  63 import jdk.test.lib.process.ProcessTools;
  64 import jdk.test.lib.process.OutputAnalyzer;
  65 import jdk.test.lib.Utils;
  66 import sun.hotspot.WhiteBox;
  67 
  68 import java.lang.annotation.Retention;
  69 import java.lang.annotation.RetentionPolicy;
  70 import java.lang.annotation.Repeatable;
  71 import java.lang.invoke.*;
  72 import java.lang.reflect.Method;
  73 import java.util.ArrayList;
  74 import java.util.Arrays;
  75 import java.util.Hashtable;
  76 import java.util.LinkedHashMap;
  77 import java.util.List;
  78 import java.util.Map;
  79 import java.util.regex.Matcher;
  80 import java.util.regex.Pattern;

  81 
  82 // Test value types
  83 __ByValue final class MyValue1 {
  84     static int s;
  85     static final long sf = ValueTypeTestBench.rL;
  86     final int x;
  87     final long y;
  88     final short z;
  89     final Integer o;
  90     final int[] oa;
  91     final MyValue2 v1;
  92     final MyValue2 v2;
  93     static final MyValue2 v3 = MyValue2.createWithFieldsInline(ValueTypeTestBench.rI, true);
  94     final int c;
  95 
  96     private MyValue1() {
  97         s = 0;
  98         this.x = 0;
  99         this.y = 0;
 100         this.z = 0;


< prev index next >