Rework memory layout generator, generate VarHandles, rename MethodHandles classes #354

Merged
jwharm merged 10 commits from memory-layouts into main 2026-04-23 21:50:35 +02:00
Owner

The MemoryLayout generator has been largely rewritten to fix a couple edge cases, mostly around padding.
We now also generate a static final VarHandle that is used to read and write fields, which should significantly improve performance of field reads and writes.

The generated "MethodHandles" classes are renamed to "NativeHandles", for two reasons:

  • They now contain VarHandles as well as MethodHandles, so the old name was wrong
  • The old name clashed with the JDK MethodHandles class.
The MemoryLayout generator has been largely rewritten to fix a couple edge cases, mostly around padding. We now also generate a static final VarHandle that is used to read and write fields, which should significantly improve performance of field reads and writes. The generated "MethodHandles" classes are renamed to "NativeHandles", for two reasons: - They now contain VarHandles as well as MethodHandles, so the old name was wrong - The old name clashed with the JDK MethodHandles class.
Changed the hierarchy of record, union and boxed types such that the boxed is not treated as a FieldContainer type anymore.

Created a small new data model for the MemoryLayoutGenerator to simplify and improve the generated layouts. This fixes a few bugs, and should be easier to maintain and use.
The old name, "MethodHandles", does not make sense for VarHandles, and it clashed with the JDK MethodHandles class. So it is now renamed to "NativeHandles".
jwharm changed title from Rework memory layout generator & generate VarHandles for fields to Rework memory layout generator, generate VarHandles, rename MethodHandles classes 2026-04-23 21:44:18 +02:00
jwharm merged commit 41ccf3966b into main 2026-04-23 21:50:35 +02:00
jwharm deleted branch memory-layouts 2026-04-23 21:50:36 +02:00
Sign in to join this conversation.
No description provided.