On Mon, 2 Mar 2026 14:46:34 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 This pull request has now been integrated. Changeset: f9799f4c Author: Axel Boldt-Christmas <[email protected]> URL: https://git.openjdk.org/valhalla/commit/f9799f4c1a35694951413fda0986cdebe49f85d0 Stats: 403 lines in 9 files changed: 333 ins; 56 del; 14 mod 8378519: [lworld] Fold fieldDescriptor / ResolvedFieldEntry checks into the FlatFieldPayload constructor Reviewed-by: fparain ------------- PR: https://git.openjdk.org/valhalla/pull/2186
