RFR: 8375046: C2: Incremental inlining step asserts when processing empty late inlines list [v4]

Aleksey Shipilev shade at openjdk.org
Thu Jan 29 07:47:53 UTC 2026


On Tue, 20 Jan 2026 19:39:24 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>>> The code implicitly assumes that `_late_inlines` is not empty and it's a reasonable assumption. Any particular reason to handle empty case instead of finishing early?
>> 
>> The case shows up in CTW -- and fairly rarely at that -- so I think there is no reason for us to care all that much about that corner case, as long as it does not break correctness. Current code just creates the noise in testing, so we are fixing that noise.
>
>> The case shows up in CTW -- and fairly rarely at that -- so I think there is no reason for us to care all that much about that corner case, as long as it does not break correctness. Current code just creates the noise in testing, so we are fixing that noise.
> 
> The point I'm trying to make is `Compile::inline_incrementally_one()` assumes `_late_inlines` is not empty. Both callers (`Compile::inline_incrementally()` and `Compile::process_late_inline_calls_no_inline()`) do have `_late_inlines.length() > 0` guards, but it seems it doesn't hold when `PhaseIdealLoop` removes remaining elements from `_late_inlines`. 
> 
> The behavior is counter-intuitive and can cause other surprises later. Instead, I suggest to add ` if (_late_inlines.length() == 0) return;` in `Compile::inline_incrementally()` before calling into `inline_incrementally_one()`.

Thanks @iwanowww! I think I need another quick Review, since Kim effectively reviewed completely different code. @TobiHartmann, @chhagedorn, maybe?

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

PR Comment: https://git.openjdk.org/jdk/pull/29171#issuecomment-3816014750


More information about the hotspot-dev mailing list