Usage of C++ features
vitalyd at gmail.com
Thu Feb 6 05:57:03 PST 2014
C++11 has a lot of nice productivity/performance features as well; just to
name a few:
2) auto keyword
4) move ctors
5) range based for loops
6) ctor chaining
7) final/override keywords
8) strongly typed enums
9) static assert
There's more, but I could definitely see some of the above making the
hotspot code more maintainable and readable (assuming compiler
compatibility isn't an issue).
Sent from my phone
On Feb 6, 2014 6:34 AM, "David Holmes" <david.holmes at oracle.com> wrote:
> Hi Goetz,
> On 6/02/2014 8:33 PM, Lindenmaier, Goetz wrote:
>> wrt. our (SAPs) various ports which are running on old machines, built
>> with old compilers for compatibility, I would like to find out about
>> the OpenJDK policy regarding 'real' C++ features.
> I don't think there is such a thing as "OpenJDK policy" for this. Things
> need to be evaluated on their merits taking into account a range of
> factors, including compiler compatibility issues.
> Recently, we found increasing usage of C++ features.
>> - 'throw()' in nmethod operator new
>> - usage of namespace std::
> AFAICS only std::nothrow is in use, which combines with the use of throw()
> in numerous (most?) operator new definitions to make it clear that these
> don't throw any exceptions.
> That said the compiler folk have expressed interest in using C++
> exceptions within the compiler.
> - template template parameters in binaryTreeDictionary.hpp|cpp
> Can't comment on that.
> We would like to know whether you are planning to increase the
>> usage of C++ or even use C++11 features. Or, whether you are planning
>> to keep the policy to avoid C++ features that caused problems to
>> compilers in the past.
> I can envisage usage of C++11 atomics at some point. But it depends on it
> being supported across sufficient compilers. What else is coming in C++11?
> I think everything has to be considered on a case-by-case basis. You
> presumably have some things in mind ?
> Just my 2c. I'm not a policy maker. :)
> Best regards,
More information about the hotspot-dev