Adapter sharing is broken with -XX:+ValueTypePassFieldsAsArgs

Roland Westrelin rwestrel at
Mon Mar 27 13:43:22 UTC 2017

Hi Tobias,


Why the change lines 2254-2281?
You skip over the T_VALUETYPE/T_VOID markers, right?
I don't think that's correct. With your change:

class MyValue1 {
    int f1;
    long f2;

class MyValue3 {
    int f1;

class MyValue4 {
    long f2;

class MyValue2 {
    MyValue3 f1;
    MyValue4 f2;

MyValue1 and MyValue2 would share the same adapters but that would only
be correct if they have the same layout (because now adapters embed hard
coded offsets for fields). Is it true? Is it guaranteed that it doesn't
change in the future?


More information about the valhalla-dev mailing list