RFR: 8264732: Clean up LinkResolver::vtable_index_of_interface_method() [v2]
Coleen Phillimore
coleenp at openjdk.java.net
Tue Apr 6 14:23:20 UTC 2021
On Tue, 6 Apr 2021 13:37:53 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>> src/hotspot/share/jvmci/jvmciCompilerToVM.cpp line 731:
>>
>>> 729: C2V_VMENTRY_0(jint, getVtableIndexForInterfaceMethod, (JNIEnv* env, jobject, jobject jvmci_type, jobject jvmci_method))
>>> 730: Klass* klass = JVMCIENV->asKlass(jvmci_type);
>>> 731: Method* method = JVMCIENV->asMethod(jvmci_method);
>>
>> The reason that resolved_method was a methodHandle is in case of redefinition, we need to know if code is referring to this version of the method so that it's not deallocated. It's enough for one of the callers to create a methodHandle but passing the methodHandle will guarantee it. I'm not sure why you needed to make this change.
>
> I refactored `getVtableIndexForInterfaceMethod` and kept the handle in place while dereferencing it when passing into `vtable_index_of_interface_method`. Does it look better now?
Ok, this is fine. Be careful if you have new callers for this function.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3346
More information about the hotspot-runtime-dev
mailing list