[foreign+linkToNative] RFR: Fill out missing Windows upcall stub generation

Jorn Vernee jbvernee at xs4all.nl
Tue Feb 12 13:27:13 UTC 2019


Thanks for bringing this up.

I remember seeing that JEP discussed on build-dev a while ago, so I 
thought trying out constexpr (a C++11 feature) and thought the compiler 
would reject it if usage was not yet allowed by the build system. e.g. 
through a flag like -std=c++03.

But, reading more into it now, it looks like such a flag is only 
supported since MSVC 2017, and the minimal setting is C++14 [1].

 From the JEP it seems that use of `constexpr` is not officially allowed 
yet. What I added can be changed to use `const`. I was using constexpr 
to make sure I had a constant expression to declare the array in 
upcall_context, but the compiler will also throw an error if the 
expression is not constant, so it's not super important.

I have tested the following patch, which should fix the issue: 
http://cr.openjdk.java.net/~jvernee/panama/webrevs/constexprfix/webrev.00/

Jorn

[1] : 
https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=vs-2017

Sundararajan Athijegannathan schreef op 2019-02-12 06:36:
> This is in response to
> https://mail.openjdk.java.net/pipermail/panama-dev/2019-February/004199.html
> 
> Change in directUpcallHandler_x86.cpp uses "constexpr".
> 
>     https://openjdk.java.net/jeps/347 (a candidate JEP)
> 
> says
> 
> " With JDK 11, the code has been updated to support building with
> newer versions of the C++ standard, although it is not yet using any
> new features. This includes being able to build with recent versions
> of various compilers that support C++11/14 language features."
> 
> FWIW I searched for "constexpr" in current hotspot code and I didn't
> find any usage.
> 
> -Sundar


More information about the panama-dev mailing list