RFR: 8255301: Common and strengthen the code in ciMemberName and ciMethodHandle
Aleksey Shipilev
shade at openjdk.java.net
Fri Oct 23 08:43:38 UTC 2020
On Fri, 23 Oct 2020 08:36:52 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>> There is a TODO item in their `get_vm_target`-s. We can clean those up. It looks to me the caller code does not handle `NULL` result well, which means we better `fatal` ourselves before exposing `NULL` to callers and `SEGV`-ing there.
>
> src/hotspot/share/ci/ciMemberName.cpp line 46:
>
>> 44: return CURRENT_ENV->get_method((Method*) vmtarget);
>> 45: } else {
>> 46: fatal("vmtarget should be a method");
>
> There's a slight difference in behavior here: `fatal()` is present in product binaries while `assert()` is not.
> Is the change deliberate?
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.
-------------
PR: https://git.openjdk.java.net/jdk/pull/825
More information about the hotspot-compiler-dev
mailing list