This is the mail archive of the java@gcc.gnu.org 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]

Alpha vs. new ABI


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

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