Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8253944: Certain method references to VarHandle methods should fail #487

Closed

Conversation

@PaulSandoz
Copy link
Member

@PaulSandoz PaulSandoz commented Oct 2, 2020

A regression was introduced in javac when processing method references to signature polymorphic methods whose return type is not polymorphic.

It is possible to successfully target type a method reference for a VarHandle sig-poly method to a functional interface whose methods return type is incompatible with the VarHandle method. This results in a runtime linkage error rather than a source compile time error.

See the following email thread for more details:

https://mail.openjdk.java.net/pipermail/compiler-dev/2020-October/015088.html

The fix is to "patch-back" the method's return type if it is not polymorphic. As a result it was possible to simplify the inference logic and keep it focused more on inference.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8253944: Certain method references to VarHandle methods should fail

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/487/head:pull/487
$ git checkout pull/487

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 2, 2020

👋 Welcome back psandoz! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Oct 2, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Oct 2, 2020

@PaulSandoz The following label will be automatically applied to this pull request:

  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the compiler label Oct 2, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 2, 2020

Webrevs

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Looks good!

@openjdk
Copy link

@openjdk openjdk bot commented Oct 2, 2020

@PaulSandoz This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for more details.

After integration, the commit message for the final commit will be:

8253944: Certain method references to VarHandle methods should fail

Reviewed-by: mcimadamore

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1 new commit pushed to the master branch:

  • 123e786: 8239105: Add exception for expiring Digicert root certificates to VerifyCACerts test

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Oct 2, 2020
@PaulSandoz
Copy link
Member Author

@PaulSandoz PaulSandoz commented Oct 5, 2020

/integrate

@openjdk openjdk bot closed this Oct 5, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Oct 5, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Oct 5, 2020

@PaulSandoz Since your change was applied there have been 13 commits pushed to the master branch:

  • 88d75c9: 8156071: List.of: reduce array copying during creation
  • ea27a54: 8224509: Incorrect alignment in CDS related allocation code on 32-bit platforms
  • 4d29116: 8253433: Remove -XX:+Debugging product option
  • 81dae70: 8253948: Memory leak in ImageFileReader
  • 65cab55: 8253971: ZGC: Flush mark stacks after processing concurrent roots
  • 19219a9: 8253960: Memory leak in Java_java_lang_ClassLoader_defineClass0()
  • 5d4a135: 8253842: [JVMCI] Allow implicit exception to dispatch to other address in jvmci compilers.
  • 289ae79: 8252998: ModuleWrapper.gmk doesn't consult include path
  • 9604ee8: 8248238: Implementation: JEP 388: Windows AArch64 Support
  • 1c2754b: 8253269: The CheckCommonColors test should provide more info on failure
  • ... and 3 more: https://git.openjdk.java.net/jdk/compare/22f091608d7ea2f84fea5450bb20c29354d5e329...master

Your commit was automatically rebased without conflicts.

Pushed as commit b29e108.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@PaulSandoz PaulSandoz deleted the PaulSandoz:JDK-8253944-VH-method-ref branch Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants