RFR (XS) JDK-8006280 - structure packing for 64-bit (resend)
David Holmes
david.holmes at oracle.com
Wed Jan 23 20:21:28 PST 2013
Hi Ioi,
On 24/01/2013 1:07 PM, Ioi Lam wrote:
> (re-sending with public-accessible bug URL).
>
> WebRev:
> http://cr.openjdk.java.net/~iklam/8006280/reorder_metadata_001/
>
> Bug: Need to reorder metadata structures to reduce size (64-bit)
> http://bugs.sun.com/view_bug.do?bug_id=8006280
>
> Sponsor: Jiangli
>
> Summary:
>
> On x64:
>
> + Klass: 8 byte reduction
I assume this is only in product mode? And we gain an extra 4 bytes as
there is no need to padd out to 64-bit alignment.
> + InstanceKlass: 8 byte reduction (in addition to reduction in Klass)
Ditto re padding.
> + Method: 8 byte reduction
Ditto re padding.
> This is verified by using the "pahole" script (as described in bug report)
>
> On ARM-EABI:
>
> I also manually verify that this change for ARM-EABI (which requires
> 8-byte alignment for jlong but not pointers):
32-bit ARM requires 4 byte pointer alignment. I'm not sure what point
you are making here. Is gcc performing automatic 8-byte alignment for
"jlong" class members? And is this different to other platforms?
> + Klass: 8 byte reduction
> + InstanceKlass: no change (apart from Klass reduction) -- no jlong fields
What changes that you made to instanceKlass relate to jlong fields ??
> + Method: no change -- no jlong fields
Only because TIERED is not enabled?
Are the C++ compilers actually required to layout class instances in
declaration order? I thought they might optimize some of this themselves :(
Thanks,
David
> Before: (linux_armvfp_2.6-productEmb/jre/lib/arm/minimal/libjvm.diz
>
> (gdb) p&((Klass*)0)->_alloc_count
> $1 = (juint *) 0x58
> (gdb) p&((Klass*)0)->_last_biased_lock_bulk_revocation_time
> $2 = (jlong *) 0x60
> (gdb) p sizeof(Klass)
> $3 = 120
>
> The "hole" was at address 0x5c
>
> After:
>
> (gdb) p&((Klass*)0)->_access_flags
> $7 = (AccessFlags *) 0x54
> (gdb) p&((Klass*)0)->_last_biased_lock_bulk_revocation_time
> $8 = (jlong *) 0x58
> (gdb) p sizeof(Klass)
> $6 = 112
>
> Tests run:
>
> + JPRT -- (hotspot only, on hotspotwest queue, including embedded builds)
>
> + UTE/vm.quick.testlist, 100% passed
>
>
> Thanks
> Ioi
>
>
>
>
>
>
>
More information about the hotspot-runtime-dev
mailing list