RFR 8183938: [MVT] Add test for mock vector API

Paul Sandoz paul.sandoz at oracle.com
Thu Jul 6 14:41:47 UTC 2017


> On 6 Jul 2017, at 06:28, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> 
> Hi,
> this changeset adds the mock vector API test that Vlad has worked on. I cleaned it up a bit and converted to a working testng test.
> 
> http://cr.openjdk.java.net/~mcimadamore/8183938/
> 

Looks good. Minor stuff:

Utils
--

  33     // Copied from jdk.experimental.value.ValueType
  34     public static Field[] valueFields(ValueType vt) {
  35         int valFieldMask = Modifier.FINAL;
  36         return Stream.of(vt.sourceClass().getDeclaredFields())
  37                 .filter(f -> (f.getModifiers() & (valFieldMask | Modifier.STATIC)) == valFieldMask)
  38                 .toArray(Field[]::new);
  39     }

There is now a public method on ValueType to obtain the value fields, but also see the following.


VectorUtils
—

 106     static MethodHandle valueFactory(Class<?> vcc, MethodHandles.Lookup lookup) {

This method could be removed and calls replaced with the unreflectWithers, or probably better is to replace the implementation with unreflectWithers.

Since your Point test already has a combo constructor i think we have this case covered.

Paul.


More information about the valhalla-dev mailing list