[foreign] RFR: replace internal nicl types with layout API

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Thu May 10 01:14:14 UTC 2018


Looks good

-Sundar

On 10/05/18, 2:04 AM, Maurizio Cimadamore wrote:
> Hi,
> this patch removes the layout classes from jdk/internal/nicl/types and 
> rewires the binder to use the public Layout API.
>
> The patch is mostly straightforward, but its size is daunting - here 
> are the major changes involved:
>
> * references to internal types have been replaced with references to 
> the layout API, more specifically:
>
> types.Array -> layout.Sequence
> types.Pointer -> layout.Address
> types.Function -> layout.Function
> types.Bitfield -> layout.Value
> types.Scalar -> layout.Scalar
> types.Container -> layout.Group
>
> * Since Function is not a layout, there's no common root type between 
> Function and Layout, meaning that some parser routines 
> (DescriptorParser) and some utility functions (Util) had to be 
> rewritten to take the split into account.
>
> * DescriptorParser is still based on the old description language (to 
> be replaced), but it creates Layout instances now
>
> * Since Layout::bitsSize returns sizes in bits, I had to divide 
> everything by 8, esp. in the logic for computing calling sequence recipe
>
> * All test pass, but one DescriptorTest has been ignored; the reason 
> is that this test relies heavily on the layout description of layouts, 
> and on the assumption that there's a 1-1 mapping between such 
> description and the output of the toString method. Since we're in a 
> transitional phase where we are going to move to a new layout 
> description soon, there's no point in converting this test - just to 
> convert it again in few weeks.
>
> The webrev is here:
>
> http://cr.openjdk.java.net/~mcimadamore/panama/binder%2blayout/
>
> Comments welcome.
>
> Cheers
> Maurizio
>
>


More information about the panama-dev mailing list