rfr [lworld] add comments and fix test

Ioi Lam ioi.lam at oracle.com
Thu Jan 10 02:01:08 UTC 2019


Hi Harold,

The changes look good to me.

As a aside, I must admit that I won't be able to read or modify the jcod 
files. I know jasm doesn't support value types yet. How about this:

1. Write a test with valid Java code. Compile it with jtreg

value class Val {
   final int x = 0;
}

class Test {
   static void foo(Object[] o) {}
   static void bar(Val[] v) {
     foo(v);
   }
}

2. read the Test.class file into a byte array, replace all occurrences 
of [LVal; with [QVal;

3. load the byte array using a custom class loader.

With the CDS tests, we have a utility that does this kind of bytecode 
hacking:

http://hg.openjdk.java.net/valhalla/valhalla/file/ca37a22640e7/test/hotspot/jtreg/runtime/appcds/test-classes/Util.java#l38

Alternatively, we can use ClassWriter as in the following test, but 
that's kind of messy, too.

http://hg.openjdk.java.net/valhalla/valhalla/file/ca37a22640e7/test/jdk/valhalla/valuetypes/ValueBootstrapMethods.java

Thanks

- Ioi


On 1/9/19 12:22 PM, Harold David Seigel wrote:
> Hi,
>
> Please review this small change to add value-type array co-variance 
> comments to the verifier and to fix a broken test.
>
> Open Webrev: 
> http://cr.openjdk.java.net/~hseigel/lworld_verf_nocovar/webrev/index.html
>
> Thanks, Harold
>


More information about the valhalla-dev mailing list