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]
Other format: [Raw text]

Re: Class layout question


Steve Ellcey writes:
 > 
 > I have been looking at bringing up the gcj compiler on IA64 HP-UX.  It
 > currently runs on IA64 Linux and with some local changes I can compile
 > (but not run) java programs on HP-UX.  Looking at the differences
 > between HP-UX and Linux I see they are generating the exact same code
 > sequence but different class layouts.
 > 
 > Obviously either the code should be different, or the class layout should
 > be the same.  I was wondering if someone could point me to where the
 > difference in the class layout might be coming from.  For the java program
 > below:
 > 
 > public class x
 > {
 >   public static void main(String[] args)
 >   {
 >   }
 > }
 > 
 > I look at the assembly language file and on HP-UX I see:
 > 
 >         .type   _ZN1x6class$E#, @object
 >         .size   _ZN1x6class$E#, 280
 > _ZN1x6class$E:
 >         data8   _ZTVN4java4lang5ClassE#+16
 >         data8   0      <** This does not get output in Linux
 >         data8   401000
 >         data8   _Utf5#
 >         data2   1
 >         .skip   6
 >         data8   _ZN4java4lang6Object6class$E#
 >         data4   0
 >         .skip   4
 >         data8   0
 >         data8   0
 >         data8   _MT_x#
 > 	(more follows)
 > 
 > In the Linux version the 'data8 0' is not put out and _ZN1x6class$E is 8
 > bytes shorter than on HP-UX.  Note, this is LP64 mode on both HP-UX and
 > Linux so that is not an issue, though maybe the compiler thinks HP-UX is
 > in ILP32 mode and is doing some padding, I don't know.
 > 
 > Anyway, I was looking for some information on class layouts and what my
 > extra number might be, where it is generated, and what macros/functions
 > might be controlling it's output.

Use -fverbose-asm and you'll see field names.

I think this is the hash synchronization field.

Andrew.


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