review request (L): 6984311 JSR 292 needs optional bootstrap method parameters

Christian Thalinger christian.thalinger at oracle.com
Fri Oct 29 04:09:42 PDT 2010


On Oct 28, 2010, at 8:40 PM, John Rose wrote:
> 6984311: JSR 292 needs optional bootstrap method parameters
>
> http://cr.openjdk.java.net/~jrose/6984311/webrev.02/
>
> This is a rework of an earlier review request.  (The subject line  
> mentioned bug 6981777.)
>
> The changes are (1) the structure of the CONSTANT_MethodApply node  
> is merged into the CONSTANT_InvokeDynamic node, and (2) the extra- 
> argument structure is N-ary, not binary.
>
> Both of these changes reduce the number of constant pool nodes,  
> relative to the binary MethodApply version.
>
> (Motivation:  This change will support injection of additional  
> metadata parameters at dynamic call sites.  A key use is for Java  
> closures, where the additional metadata parameter is a closure body  
> method.  There are many other language-specific uses for such  
> metadata.  Previously, such metadata had to be mangled into the  
> name, or coded into a unique per-call-site bootstrap method.  Both  
> of those older workarounds are significantly more costly in  
> complexity, class file size, and constant pool entry count.)


src/share/vm/oops/constantPoolOop.cpp:
576     // Benign race condition:  f1 may already be filled in while  
we were trying to lock.
I guess we don't care here because the exception to be thrown is  
expected to be the same for different threads, right?

1613         Bytes::put_Java_u2((address) (bytes+5), argc);
1614         for (int arg_i = 0; arg_i < argc; arg_i++) {
1615           int arg = invoke_dynamic_argument_index_at(idx, arg_i);
1616           Bytes::put_Java_u2((address) (bytes+5+2*arg_i), arg);
1617         }
Isn't argc here overwritten with the first arg?


src/share/vm/utilities/constantTag.cpp:

Only the copyright year is changed.


Otherwise looks good.

-- Christian


More information about the mlvm-dev mailing list