RFR: 8219816: Add IsArray/RemoveArray type traits utilities

Erik Österlund erik.osterlund at oracle.com
Tue Mar 5 15:01:56 UTC 2019


Hi Per,

Looks good to me.

Thanks,
/Erik

On 2019-03-04 10:48, Per Liden wrote:
> On 2/27/19 9:21 PM, Kim Barrett wrote:
>>> On Feb 27, 2019, at 10:08 AM, Kim Barrett <kim.barrett at oracle.com> 
>>> wrote:
>>>
>>>> On Feb 27, 2019, at 3:53 AM, Per Liden <per.liden at oracle.com> wrote:
>>>>
>>>> Add IsArray/RemoveArray to our collection of type traits 
>>>> metaprogramming utilities.
>>>>
>>>> This patch only adds the IsArray/RemoveArray utilities and their 
>>>> respective tests. A later patch I have in my queue that will 
>>>> actually make use of these.
>>>>
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8219816
>>>> Webrev: http://cr.openjdk.java.net/~pliden/8219816/webrev.0
>>>>
>>>> /Per
>>>
>>> For completeness, there should probably be IsArray test cases for
>>> const/volatile with size.
>>>
>>> Otherwise, looks good.  I don't need another webrev for those
>>> additional test cases.
>>
>> HotSpot's metaprogramming utilities have been intentionally modelled
>> on those from <type_traits>, both in naming and (with some limitations
>> in a few cases) behavior.  The C++11 type trait for removing array
>> dimensions from an array type is "remove_extent" (and 
>> "remove_all_extents"
>> to remove all of them from a multi-dimensional array type).
>>
>> So what this change calls RemoveArray ought to be called RemoveExtent.
>> Sorry that I forgot to check on this earlier.
>
> Ah, good catch. Renamed accordingly. I'm not implementing 
> remove_all_extents at this time, let's add that when there's a use 
> case for it.
>
> Updated webrev: http://cr.openjdk.java.net/~pliden/8219816/webrev.1
>
> /Per



More information about the hotspot-dev mailing list