RFR (M): 8183927: Hotspot needs C++ type_traits metaprogramming utilities

Erik Österlund erik.osterlund at oracle.com
Fri Jul 7 07:40:12 UTC 2017

Hi Kim,

Thanks for the review.


On 2017-07-06 20:55, Kim Barrett wrote:
>> On Jul 6, 2017, at 9:08 AM, Erik Österlund <erik.osterlund at oracle.com> wrote:
>> Hi,
>> I'm sure we have all had moments when we wished we could use the C++11 type_traits header and the nice metaprogramming tools in there, but then suddenly remembered that we can not, because we are building libjvm.so with C++03 and are still arguing whether we can use namespaces.
>> Well.. welcome to the future. I am delighted to announce that now at least some of those tools will become available.
>> A bunch of C++11 compliant metaprogramming tools that can be used already in C++03 have been developed.
>> They have been developed with the most conservative and portable C++03 code possible so that even exotic compilers can support it.
>> Special thanks go to Kim Barret whom I have had many long conversations about many paragraphs of the C++ standard throughout this work. It has helped a lot and improved the code.
>> While this change introduces the traits without using it in the code (more than from gtest), it will become used in already prepared patches for refactoring Atomic and OrderAccess to use templates rather than hand picked types like the JNI-specific jint etc types. That serves as the bottom layer of the upcoming GC barrier interface that also requires these utilities. Since they are rather large changes, I hope it is okay that I separate out the metaprogramming utilities. I argue that they are of value in general in hotspot and will make our lives easier.
>> All metaprogramming tools have been placed in a new hotspot/src/share/vm/metaprogramming directory.
>> Tests have been written and placed in a new test/native/metaprogramming directory.
>> A bug ID can be found here:
>> https://bugs.openjdk.java.net/browse/JDK-8183927
>> A webrev with code can be found here:
>> http://cr.openjdk.java.net/~eosterlund/8183927/webrev.00/
> Looks good.

More information about the hotspot-dev mailing list