RFR: 7903910: JMH: Strengthen manual hierarchical padding

Aleksey Shipilev shade at openjdk.org
Fri Dec 13 17:36:50 UTC 2024


On Fri, 13 Dec 2024 16:27:47 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Generated code uses 256 byte fields to provide hierarchical padding. JMH infrastructure classes, however, only do 128 boolean fields. We need to make sure we use the same padding code in manual infra as in the generated code.

Thanks!

> More generally do you think there could be any benefit from changing to `long` padding fields to reduce size of generated code, or would that have too many issues with layout on different VM impls?

We pad with `byte`-s deliberately to avoid exposing any holes in superclasses that can be taken by subclass fields with JDK 15+ field layouter: https://shipilev.net/jvm/objects-inside-out/#_observation_hierarchy_tower_padding_trick_collapse_in_jdk_15 :)

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

PR Comment: https://git.openjdk.org/jmh/pull/146#issuecomment-2541930474


More information about the jmh-dev mailing list