This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Alpha vs. new ABI
- To: java at gcc dot gnu dot org
- Subject: Alpha vs. new ABI
- From: Jeff Sturm <jeff dot sturm at appnet dot com>
- Date: Tue, 30 Jan 2001 00:35:04 -0500
I think I understand the problem. On the frontend side, in
build_java_array_type there is the comment:
/* We need to force the data field to begin at an alignment at
least equal to the biggest alignment in an object type node
in order to be compatible with the way that JArray is defined
in CNI. However, we can't exceed BIGGEST_FIELD_ALIGNMENT. */
ISTR that libjava requires this somewhere. But gcj/array.h declares
JArray thusly:
template<class T>
class JArray : public __JArray
{
T data[0];
public:
friend T* elements<>(JArray<T>& x);
friend T* elements<>(JArray<T>* x);
// T* getData() { return data; }
// T& operator[](jint i) { return data[i]; }
};
Doesn't seem like any special provisions for alignment are made here...
i.e. if `T' is a jchar, then data will be aligned on a jchar boundary.
On x86 we got lucky because the offset of data is 12 for anything
jobject or shorter. Not so on Alpha. So... how do we fix it?
Jeff