Class layout question
Steve Ellcey
sje@cup.hp.com
Wed Jul 13 16:21:00 GMT 2005
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.
Steve Ellcey
sje@cup.hp.com
More information about the Java
mailing list