RFR: 8305955: Remove Visual C++ specific workaround in javac [v2]
Jonathan Gibbons
jjg at openjdk.org
Wed Jul 12 00:12:21 UTC 2023
On Fri, 23 Jun 2023 02:45:25 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> Visual C++ no longer requires the use of the i64 literal syntax and instead recommends the use of LL instead, so we should remove this workaround in the JNIWriter (this also helps when users write Windows JNI code meant to be compiled with alternate compilers other than Visual C++)
>
> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>
> - Merge branch 'openjdk:master' into patch-2
> - Remove Visual C++ specific workaround in javac
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java line 274:
> 272: break;
> 273: case LONG:
> 274: valueStr = value.toString() + "LL";
`JNIWriter` has access to the `Context` and thus to options, including "backdoor" options.
I suggest adding a definition of a member variable, something like the following, modeled on `checkAll`
private boolean visualCPlusPlus;
visualCPlusPlus = options.isSet("java:visualCPlusPlus");
then change line 275 to:
valueStr = value.toString() + ((isWindows && visualCPlusPlus) ? "i64" : "LL");
Overall, the intent is that the do-nothing default is the proposed new behavior, but that the command-line option `-XDvisualCPlusPlus` can be specified to recover the current behavior.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13457#discussion_r1260412078
More information about the compiler-dev
mailing list