On Wed, 4 Mar 2026 06:08:18 GMT, Axel Boldt-Christmas <[email protected]> wrote:
>> Right now some of the call sites assets that ResolvedFieldEntry corresponds >> to the correct fieldDescriptor, and that these fields are in fact flattened. >> It was suggested that this would be more robust if this was folded into the >> construction of the FlatFieldPayload construction. >> >> I moved these asserts up the construction hierarchy so that we also verify >> the unsafe flat field access. Because these can access nested flat values, >> some extra utility was added to find nested flat fields from an offset. >> >> After this change the `FlatFieldPayload` check that the `fieldDescriptor*` >> constructor and the `ResolvedFieldEntry*` is a valid non-nested flat field >> in the containing object. >> >> And the `FlatValuePayload::construct_from_parts` verifies that there is an >> field at that offset of of the correct InlineKlass. (Either a direct field >> or array element, or a nested flat field inside an flat field or array >> element) >> >> _Also the unsafe access logging was missing a ResourceMark, and changed it >> so it does not assert on bad offset, as I moved the assertions into the >> FlatValuePayload construction._ >> >> Testing: >> * Running tier 1 - 4 with `--enable-preview` >> * Running all Valhalla tests > > Axel Boldt-Christmas has updated the pull request with a new target base due > to a merge or a rebase. The incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull request contains three additional > commits since the last revision: > > - Rename `from_offset` to `containing_offset` > - Merge remote-tracking branch 'upstream_valhalla/lworld' into JDK-8378519 > - 8378519: [lworld] Fold fieldDescriptor / ResolvedFieldEntry checks into > the FlatFieldPayload constructor Looks good to me. ------------- Marked as reviewed by fparain (Committer). PR Review: https://git.openjdk.org/valhalla/pull/2186#pullrequestreview-3898810720
