On Mon, 2 Mar 2026 13:38:22 GMT, Damon Fenacci <[email protected]> wrote:

> `CompiledEntrySignature::initialize_from_fingerprint()` was building 
> `_sig_cc` and `_sig_cc_ro` the same way, but for virtual methods with an 
> inline‑type receiver they must differ: `_sig_cc` should include the 
> receiver’s scalarized fields, while `_sig_cc_ro` should represent the 
> receiver as a single `T_OBJECT`.
> This change fixes `_sig_cc_ro` construction so that when the receiver is an 
> inline type, its fields are skipped and a single object entry is emitted 
> instead.
> It also adds asserts for `_sig_cc_ro` as a regression test proved to be hard 
> to isolate and the asserts trigger immediately with any test if the RO 
> signature is wrong.
> 
> Tests: 
> * Tier 1-3+
> * Assert makes even build crash without fix

`skipping_inline_recv` is initially false. We set it to `ŧrue` if

        if (!skipping_inline_recv) {
          if (_has_inline_recv && value_object_count == 0) {

so, at the beginning of the receiver scalarized type. At the end in

          if (!skipping_inline_recv) {
            SigEntry::add_entry(_sig_cc_ro, T_VOID, nullptr, offset);
          } else if (value_object_count == 0) {
            skipping_inline_recv = false;
          }

We set it back to `false`. But then, if I now see another `T_METADATA`, I have 
`skipping_inline_recv == false`, `value_object_count == 0` and 
`_has_inline_recv` didn't change value. So why aren't we setting 
`skipping_inline_recv` to true again if we see a `T_METADATA` then?

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

PR Comment: https://git.openjdk.org/valhalla/pull/2185#issuecomment-4082204922

Reply via email to