This is the mail archive of the mailing list for the Java project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Alpha vs. new ABI

>>>>> "Jeff" == Jeff Sturm <> writes:

>> jdouble dummy[0];
>> before the data field?

Jeff> Probably.  I first tried "jint pad;" which gave the right
Jeff> answer.  But it seems that jdouble alignment is wrong for 32-bit
Jeff> hosts.  How about:
Jeff> jobject dummy[0];

There was some talk on the gcc list a few weeks ago about 0-length
arrays.  I thought the consensus was that they would only be supported
at the end of a structure.  So while this might work right now, I'm
concerned that it will stop working at some point in the future.

One suggestion that came up before was to change both the compiler and
the runtime to agree on alignment of the data member of JArray.  Then
we could reduce _Jv_GetArrayElementFromElementType to a trivially
inlineable function.

In the runtime we could implement this by putting
__attribute__((aligned (something))) on the `data' field.
`something' would be chosen to be maximal alignment for the platform.
Maybe just `8' would suffice for now.

I don't know what exactly is required for the compiler side of this
change.  Maybe there is just the one place to change.  Alex would

I also don't know how risky it is, but I think it is likely the test
suite would catch errors.  On the alpha I currently see that
`helloworld' fails, and for other failures I seem to recall that we
added at least one test case specifically to detect array data
alignment bugs.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]