Alpha vs. new ABI

Jeff Sturm jeff.sturm@appnet.com
Mon Jan 29 21:34:00 GMT 2001


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /