[lworld] RFR: 8377480: [lworld] incorrect execution due to EA pointer comparison optimization at scalarized call [v2]
Dan Heidinga
heidinga at openjdk.org
Thu Feb 12 13:51:16 UTC 2026
On Thu, 12 Feb 2026 09:31:58 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> src/hotspot/share/opto/escape.cpp line 2150:
>>
>>> 2148: }
>>> 2149: _i_sig_cc++;
>>> 2150: }
>>
>> Is it worth tracking the previous BasicType from the signature rather than reaching back with the `_i_sig_cc-1`?
>>
>> Something like:
>> Suggestion:
>>
>> BasicType prev_bt = T_VOID;
>> while (_i_sig_cc < _sig_cc->length()) {
>> BasicType bt = _sig_cc->at(_i_sig_cc)._bt;
>> if (bt == T_METADATA) {
>> _depth++;
>> } else if (bt == T_VOID && (prev_bt != T_LONG && prev_bt != T_DOUBLE)) {
>> _depth--;
>> if (_depth == 0) {
>> _i_domain++;
>> }
>> } else {
>> return;
>> }
>> prev_bt = bt;
>> _i_sig_cc++;
>> }
>
> I pushed a new commit that does that.
> When `_sig_cc->at(_i_sig_cc)._bt = T_LONG`, the method exits. So next time it's called, with the suggested code above, `prev_bt` is not set to `T_LONG`, the way it should. The `prev_bt` initialization is slightly more complicated as a result.
Thanks. Looks good to me
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/2079#discussion_r2799004141
More information about the valhalla-dev
mailing list