RFR: 8255301: Common and strengthen the code in ciMemberName and ciMethodHandle [v2]

Aleksey Shipilev shade at openjdk.java.net
Fri Oct 23 09:03:53 UTC 2020


On Fri, 23 Oct 2020 08:52:52 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Yes. Because AFAICS, the `get_vmtarget` callers use the result without any null checks, calling member methods off that `ciMethod*`, and thus release bits would (hopefully) `SEGV` if this path is taken. In this case, it seems prudent to `fatal()` at sensible point before that happens.
>
> Ok. I took a closer look and noticed that `java_lang_invoke_MemberName::vmtarget` already returns `Method*`. So, the code can be rewritten as follows:
>   Method* vmtarget = java_lang_invoke_MemberName::vmtarget(get_oop());
>   return CURRENT_ENV->get_method(vmtarget);

Oh, good stuff. I missed that! This means we can simplify the whole patch, and avoid the new method and the dependency between `ciMethodHandle` and `ciMemberName`. Please see new patch.

-------------

PR: https://git.openjdk.java.net/jdk/pull/825


More information about the hotspot-compiler-dev mailing list