RFR: 8318364: Add an FFM-based implementation of harfbuzz OpenType layout

Jorn Vernee jvernee at openjdk.org
Wed Oct 18 20:08:00 UTC 2023


On Tue, 17 Oct 2023 22:53:30 GMT, Phil Race <prr at openjdk.org> wrote:

>  I'm unclear why it is "better". It seems more obscure to me.

Ok. I think it's better because it doesn't require creating a maximum size sequence layout in order to then make a var handle out of, which is a bit of a hack IMO. One that was required in the previous version of the API.

This kind of use-case, where the size of the sequence is not known statically, is one of the reasons why we added the extra base offset parameter to the var handles.

Another way of writing this would be to use the base var handle, with its extra leading offset parameter, and then pass e.g. `i * PositionLayout.byteSize()` as the offset at every call site (where `i` is the array index). The two extra combination steps essentially create a var handle with that behavior baked in.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15476#discussion_r1363114533


More information about the core-libs-dev mailing list