changeset 13583:8431727f44a1 mvt

8187670: [MVT] Enable verifier for compiler tests Reviewed-by: lfoltan
author thartmann
date Wed, 20 Sep 2017 08:44:32 +0200
parents e2676828062c
children a72b048d682d
files test/compiler/valhalla/valuetypes/TestBoundValueTypes.java test/compiler/valhalla/valuetypes/TestUnloadedValueTypeArray.java test/compiler/valhalla/valuetypes/ValueCapableClass2.java test/compiler/valhalla/valuetypes/ValueTypeTestBench.java
diffstat 4 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/test/compiler/valhalla/valuetypes/TestBoundValueTypes.java	Tue Sep 19 21:44:50 2017 -0700
+++ b/test/compiler/valhalla/valuetypes/TestBoundValueTypes.java	Wed Sep 20 08:44:32 2017 +0200
@@ -36,7 +36,7 @@
  * @modules java.base/jdk.experimental.value
  *          jdk.incubator.mvt
  * @compile -XDenableValueTypes ValueCapableClass2.java TestBoundValueTypes.java
- * @run main/othervm -noverify -XX:+EnableMVT -XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.TestBoundValueTypes::*
+ * @run main/othervm -XX:+EnableMVT -XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.TestBoundValueTypes::*
  *                   -XX:CompileCommand=compileonly,java.lang.invoke.*::* compiler.valhalla.valuetypes.TestBoundValueTypes
  */
 public class TestBoundValueTypes {
--- a/test/compiler/valhalla/valuetypes/TestUnloadedValueTypeArray.java	Tue Sep 19 21:44:50 2017 -0700
+++ b/test/compiler/valhalla/valuetypes/TestUnloadedValueTypeArray.java	Wed Sep 20 08:44:32 2017 +0200
@@ -27,8 +27,7 @@
  * @summary Array of unloaded value class should consistently use L signature
  * @modules jdk.incubator.mvt
  * @compile -XDenableValueTypes TestUnloadedValueTypeArray.java
- * @run main/othervm -XX:+EnableValhalla -noverify -Xcomp -XX:CompileOnly=TestUnloadedValueTypeArray::test TestUnloadedValueTypeArray
- *
+ * @run main/othervm -XX:+EnableValhalla -Xcomp -XX:CompileOnly=TestUnloadedValueTypeArray::test TestUnloadedValueTypeArray
  */
 
 __ByValue final class MyValue {
--- a/test/compiler/valhalla/valuetypes/ValueCapableClass2.java	Tue Sep 19 21:44:50 2017 -0700
+++ b/test/compiler/valhalla/valuetypes/ValueCapableClass2.java	Wed Sep 20 08:44:32 2017 +0200
@@ -43,7 +43,7 @@
         ValueType<?> VT = ValueType.forClass(ValueCapableClass2.class);
         try {
             FACTORY = VT.unreflectWithers(lookup, true, VT.valueFields());
-        } catch(NoSuchFieldException|IllegalAccessException e) {
+        } catch (NoSuchFieldException|IllegalAccessException e) {
             throw new RuntimeException("method handle lookup fails");
         }
     }
--- a/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java	Tue Sep 19 21:44:50 2017 -0700
+++ b/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java	Wed Sep 20 08:44:32 2017 +0200
@@ -27,24 +27,25 @@
  * @test
  * @library /testlibrary /test/lib /compiler/whitebox /
  * @requires os.simpleArch == "x64"
- * @modules java.base/jdk.experimental.value
+ * @modules java.base/jdk.experimental.bytecode
+ *          java.base/jdk.experimental.value
  *          java.base/jdk.internal.misc:+open
  *          jdk.incubator.mvt
  * @compile -XDenableValueTypes ValueCapableClass1.java ValueCapableClass2.java ValueTypeTestBench.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller jdk.test.lib.Platform
- * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -noverify -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+VerifyAdapterSharing -XX:+VerifyStack
  *                   -XX:+EnableValhalla -XX:+EnableMVT -XX:+ValueTypePassFieldsAsArgs -XX:+ValueTypeReturnedAsFields -XX:+ValueArrayFlatten
  *                   -XX:ValueArrayElemMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatOops=-1
  *                   -Djdk.lang.reflect.DVT=true
  *                   compiler.valhalla.valuetypes.ValueTypeTestBench
- * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -noverify -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+VerifyStack
  *                   -XX:+EnableValhalla -XX:+EnableMVT -XX:-ValueTypePassFieldsAsArgs -XX:-ValueTypeReturnedAsFields -XX:-ValueArrayFlatten
  *                   -Djdk.lang.reflect.DVT=true
  *                   compiler.valhalla.valuetypes.ValueTypeTestBench
- * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -noverify -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
+ * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-TieredCompilation -XX:+AlwaysIncrementalInline
  *                   -XX:+EnableValhalla -XX:+EnableMVT -XX:+ValueTypePassFieldsAsArgs -XX:+ValueTypeReturnedAsFields -XX:+ValueArrayFlatten
  *                   -XX:ValueArrayElemMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatOops=-1
@@ -55,6 +56,8 @@
 package compiler.valhalla.valuetypes;
 
 import compiler.whitebox.CompilerWhiteBoxTest;
+import jdk.experimental.bytecode.MacroCodeBuilder.CondKind;
+import jdk.experimental.bytecode.TypeTag;
 import jdk.experimental.value.MethodHandleBuilder;
 import jdk.incubator.mvt.ValueType;
 import jdk.test.lib.Asserts;
@@ -1775,7 +1778,7 @@
                     CODE.
                     aconst_null().
                     vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                    getfield(ValueCapableClass1.class, "t", "J").
+                    getfield(ValueType.forClass(ValueCapableClass1.class).valueClass(), "t", "J").
                     lreturn();
                 }
                 );
@@ -1906,12 +1909,13 @@
                     CODE.
                     iload_1().
                     iconst_1().
-                    if_icmpne((short)14).
+                    ifcmp(TypeTag.I, CondKind.NE, "not_equal").
                     aload_0().
                     vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
                     vbox(ValueCapableClass1.class).
                     getfield(ValueCapableClass1.class, "t", "J").
                     lreturn().
+                    label("not_equal").
                     aload_0().
                     vunbox(ValueType.forClass(ValueCapableClass2.class).valueClass()).
                     vbox(ValueCapableClass1.class).