Superword - Aligning arrays

John Rose John.Rose at Sun.COM
Wed Jan 21 17:36:06 PST 2009


The simplest way is to make alignment strength depend only on size  
with no extra header bits. When allocating an array (this includes GC  
relocation) if the size is large enough,  allocate a dummy object just  
before (a byte array, e.g.). Size the dummy so that the first element  
of your array will be strongly aligned. Seems pretty simple to me.

-- John  (on my iPhone)

On Jan 21, 2009, at 4:57 PM, James Walsh  
<groundskeeperwiley at yahoo.com> wrote:

> What would be the best way of allocating the arrays on the proper  
> boundry?  Would it be better to add an alignment flag or just assume  
> that any array of (sizebytes%16-bytes==0) and any array of greater  
> than 64bytes should be aligned?  I'm guessing I would then need to  
> adjust the klass header to align it to the boundry too.  Then with  
> garbage collection I assume I would have to make sure the new  
> location is also aligned.
>
>
>
>



More information about the hotspot-dev mailing list