< prev index next >

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

Print this page

        

*** 29,45 **** import jdk.test.lib.combo.ComboInstance; import jdk.test.lib.combo.ComboParameter; import jdk.test.lib.combo.ComboTask.Result; import jdk.test.lib.combo.ComboTestHelper; import jdk.test.lib.combo.ComboTestHelper.ArrayDimensionKind; ! import jdk.experimental.value.ValueType; - import java.io.File; - import java.io.FileInputStream; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; - import java.lang.invoke.MethodType; import static java.lang.invoke.MethodType.methodType; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.net.URL; import java.net.URLClassLoader; --- 29,42 ---- import jdk.test.lib.combo.ComboInstance; import jdk.test.lib.combo.ComboParameter; import jdk.test.lib.combo.ComboTask.Result; import jdk.test.lib.combo.ComboTestHelper; import jdk.test.lib.combo.ComboTestHelper.ArrayDimensionKind; ! import jdk.incubator.mvt.ValueType; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import static java.lang.invoke.MethodType.methodType; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.net.URL; import java.net.URLClassLoader;
*** 195,205 **** return buf.toString(); } } public static final String VCC_TEMPLATE = ! "@jvm.internal.value.ValueCapableClass\n" + "public final class Test {\n\n" + " // Declare fields...\n" + " #{ARITY.FIELD_DECL}\n" + " // Private Constructor...\n" + " private Test(#{ARITY.CONSTR_FORMALS}) {\n" + --- 192,202 ---- return buf.toString(); } } public static final String VCC_TEMPLATE = ! "@jdk.incubator.mvt.ValueCapableClass\n" + "public final class Test {\n\n" + " // Declare fields...\n" + " #{ARITY.FIELD_DECL}\n" + " // Private Constructor...\n" + " private Test(#{ARITY.CONSTR_FORMALS}) {\n" +
*** 296,305 **** --- 293,303 ---- @Override public void doWork() throws Throwable { Result<Iterable<? extends JavaFileObject>> result = newCompilationTask() .withSourceFromTemplate(VCC_TEMPLATE) + .withOption("--add-modules=jdk.incubator.mvt") .generate(); //System.out.println("COMP: " + result.compilationInfo()); // Print the generated source if (result.hasErrors()) { fail("ERROR " + result.compilationInfo()); }
*** 320,339 **** if (!ValueType.classHasValueType(testSubject)) { throw new IllegalArgumentException("Not a VCC: " + testSubject); } ValueType<?> vt = ValueType.forClass(testSubject); Class<?> boxClass = vt.boxClass(); - Class<?> sourceClass = vt.sourceClass(); Class<?> vtClass = vt.valueClass(); Class<?> arrayClass = vt.arrayValueClass(); Class<?> mArrayClass = vt.arrayValueClass(4); if (boxClass != testSubject) { throw new RuntimeException("Box class != VCC"); } - if (sourceClass != testSubject) { - throw new RuntimeException("Source class != VCC"); - } if (vt.toString() == null) { throw new RuntimeException("No toString() return"); } } --- 318,333 ----
*** 365,375 **** if (!isEqual) { System.out.println("PROBLEM:"); printFieldValues(MethodHandles.filterReturnValue(vt.defaultValueConstant(), box)); System.out.println("VERSUS value from array:"); printFieldValues(MethodHandles.filterReturnValue(arrayGetter, box).invoke(array, i)); ! throw new IllegalStateException("Failed equality test for class: " + vt.sourceClass().getName() + " at index: " + i); } } // populate the last element with some values... int testIndex = testArrayLen - 1; --- 359,369 ---- if (!isEqual) { System.out.println("PROBLEM:"); printFieldValues(MethodHandles.filterReturnValue(vt.defaultValueConstant(), box)); System.out.println("VERSUS value from array:"); printFieldValues(MethodHandles.filterReturnValue(arrayGetter, box).invoke(array, i)); ! throw new IllegalStateException("Failed equality test for class: " + vt.boxClass().getName() + " at index: " + i); } } // populate the last element with some values... int testIndex = testArrayLen - 1;
< prev index next >