rfr [lworld] add comments and fix test

Harold David Seigel harold.seigel at oracle.com
Thu Jan 10 14:18:13 UTC 2019


Hi Ioi,

Thanks for the review.

And thanks for your suggestion about generating the tests.  I have a 
local version of jasm that sort of 'works' with value types.  When I 
need to change the tests, I compile a Java file. Then, I translate it 
into jasm using my local version of jasm, modify it, and use that jasm 
to generate a new class file. Finally, I translate it into a jcod file 
so that jtreg can compile it.

I will look at the CDS method.  It can't be worse than what I'm 
currently doing.

Thanks, Harold

On 1/9/2019 9:01 PM, Ioi Lam wrote:
> 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