RFR: 8370251: C2: Inlining checks for method handle intrinsics are too strict
Chen Liang
liach at openjdk.org
Mon Oct 20 22:00:12 UTC 2025
On Mon, 20 Oct 2025 21:32:03 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> C2 performs access checks during inlining attempts through method handle
>> intrinsic calls. But there are no such checks happening at runtime when
>> executing the calls. (Access checks are performed when corresponding method
>> handle is resolved.) So, inlining may fail due to access checks failure while
>> the call always succeeds at runtime.
>>
>> The fix is to skip access checks when inlining through method handle intrinsics.
>>
>> Testing: hs-tier1 - hs-tier4
>
> src/hotspot/share/opto/doCall.cpp line 245:
>
>> 243: receiver_method = callee->resolve_invoke(jvms->method()->holder(),
>> 244: speculative_receiver_type,
>> 245: check_access);
>
> Can you explain why only here you pass `check_access` and expect it is `true` in all other places?
Similar question, should we add an assert for check_access before the resolve_invoke in Compile::optimize_inlining?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27908#discussion_r2446225242
More information about the hotspot-compiler-dev
mailing list