RFR(S) 8182473: Optimize value type layout to max alignment of fields
david.simms at oracle.com
Thu Jun 29 08:58:36 UTC 2017
Request for review:
Here is a patch to remove the fixed "jlong" alignment from laying out
values within object and values.
The value type oop base offset remains aligned to "jlong", since "value
type oops" are temporary holders, there is no real memory savings to be
made otherwise. That is to say published values types in object fields
are now no longer padded if no padding is required.
Otherwise field layout will now try to coerce "small" value types
(allocation type sized under NONSTATIC_DOUBLE) into one of other
allocation types (NONSTATIC_BYTE, NONSTATIC_SHORT, NONSTATIC_WORD or
NONSTATIC_OOP). The rest are laid out at the end of the instance jlong
aligned as before (but these are variable jlong aligned size).
Added basic sanity tests for layout involving value types. Generated
layout combination testing needed when/if MVT users are enabled to
declare value type fields in classes.
JPRT, hotspot_tier1, and jdk_valhalla_mvt tests pass.
More information about the valhalla-dev