RFR(S) 8182473: Optimize value type layout to max alignment of fields

David Simms david.simms at oracle.com
Thu Jun 29 08:58:36 UTC 2017

Hi all,

Request for review:

     RFE: https://bugs.openjdk.java.net/browse/JDK-8182473

     Webrev: http://cr.openjdk.java.net/~dsimms/valhalla/8182473/webrev0/

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 
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.

/David Simms

More information about the valhalla-dev mailing list