RFR: 8287223: C1: Inlining attempt through MH::invokeBasic() with null receiver

Vladimir Kozlov kvn at openjdk.java.net
Wed May 25 23:04:35 UTC 2022


On Wed, 25 May 2022 21:58:01 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

> Inlining attempt through `MH::invokeBasic()` when receiver is null. It triggers an assert when attempting to extract a `Method*` from a null constant.
> 
> Proposed fix bails out inlining attempt when receiver is null constant.
> 
> C2 has a similar issue, but the particular bytecode shape of `MH::invokeExact()` invoker hides the bug (dominating `MH::type()` call involves a null check and problematic call isn't compiled at all).  
> 
> Testing: hs-tier1 - hs-tier4

src/hotspot/share/opto/callGenerator.cpp line 1021:

> 1019:       if (receiver->Opcode() == Op_ConP) {
> 1020:         input_not_const = false;
> 1021:         ciObject* recv_obj = receiver->bottom_type()->is_oopptr()->const_oop();

In general ConP could be `NULL_PTR` (AnyPtr). I think you need to use `isa_oopptr()` and check for `NULL` here.
Or it can't be `NULL_PTR` in this case?

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

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


More information about the hotspot-compiler-dev mailing list