RFR(S): 8142329: [JVMCI] pass Handle by value

Christian Thalinger christian.thalinger at oracle.com
Mon Nov 9 19:23:16 UTC 2015

> On Nov 9, 2015, at 8:09 AM, Roland Schatz <roland.schatz at oracle.com> wrote:
> On 11/09/2015 06:07 PM, Carsten Varming wrote:
>> Dear Roland,
>> Coleen recently changes a bunch of handle values to references (see http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/6ab7e19c9220 <http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/6ab7e19c9220>, https://bugs.openjdk.java.net/browse/JDK-8140274 <https://bugs.openjdk.java.net/browse/JDK-8140274>). Perhaps the comment in handles.hpp should be updated to reflect the efficiency goal of Coleen's recent change. Your change has both constantPoolHandles and methodHandles, so it would be nice to not go backwards.
> Whoops, I missed that constantPoolHandle and methodHandle are different from Handle, they have more fields.
> Sorry about that.
> To be consistent with http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/6ab7e19c9220 <http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/6ab7e19c9220>, I changed them to `const methodHandle&` (adding the `const`).
> For the normal (oop) Handle, I guess the change makes sense, since the implementation of Handle only has one field an no copy constructor.
> What about KlassHandle? Looking at the implementation, it looks like we want to pass it by value, too, right?
> (I did a grep for "KlassHandle&" in the source tree, and found nothing)
> I updated the webrev:
> http://cr.openjdk.java.net/~rschatz/JDK-8142329/webrev.01/ <http://cr.openjdk.java.net/~rschatz/JDK-8142329/webrev.01/>

Thanks.  I’ve found two occurrences of methodHandle which you didn’t change:

-void JVMCICompiler::compile_method(methodHandle method, int entry_bci, JVMCIEnv* env) {
+void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JVMCIEnv* env) {


-oop CompilerToVM::get_jvmci_method(methodHandle method, TRAPS) {
+oop CompilerToVM::get_jvmci_method(const methodHandle& method, TRAPS) {

Also, I’ve made a small change to CompileBroker::invoke_compiler_on_method because Eclipse couldn’t follow the implicit conversion anymore:

     JVMCIEnv env(task, system_dictionary_modification_counter);
-    jvmci->compile_method(target_handle, osr_bci, &env);
+    methodHandle method(thread, target_handle);
+    jvmci->compile_method(method, osr_bci, &env);

> - Roland
>> Carsten
>> On Mon, Nov 9, 2015 at 11:36 AM, Roland Schatz <roland.schatz at oracle.com <mailto:roland.schatz at oracle.com>> wrote:
>> Hi,
>> In JVMCI we have a few methods using `Handle&` as argument, according to the comment in handle.hpp this should be `Handle` directly.
>> JIRA:
>> https://bugs.openjdk.java.net/browse/JDK-8142329 <https://bugs.openjdk.java.net/browse/JDK-8142329>
>> Webrev:
>> http://cr.openjdk.java.net/~rschatz/JDK-8142329/webrev.00/ <http://cr.openjdk.java.net/%7Erschatz/JDK-8142329/webrev.00/>
>> Please review.
>> Thanks,
>> Roland

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20151109/14f43268/attachment.html>

More information about the hotspot-compiler-dev mailing list