On Mon, 3 Aug 2026 17:06:12 GMT, Marc Chevalier <[email protected]> wrote:
>> src/hotspot/share/opto/inlinetypenode.cpp line 1029:
>>
>>> 1027:
>>> 1028: const Type* arg_type = igvn.type(arg);
>>> 1029: assert(!arg_type->maybe_null(), "must check null beforehand");
>>
>> Why is this guaranteed? Isn't this only done in the intrinsic slow path but
>> not in the general case?
>
> I don't think so. The intrinsics starts by doing something like
>
> if (arg == null) {
> if (static) { return 0; }
> throw NullPointerException();
> }
> // Here, arg != null
> // the rest of the intrinsics ... with cache path, fast path and slow path.
>
> Here, we are expanding the slow path (that is the runtime call), so we should
> already be after the null check. Am I missing something?
But what if we disable the intrinsic or we bail out from intrinsifying for
another reason? The call could still be optimized and this code would assume
that the receiver is null checked, which it isn't, right?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/32144#discussion_r3734293399