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

[GR-61443] [GR-61549] Fix which resolution errors are remembered in the constant pool. #10606

Closed
wants to merge 5 commits into from

Conversation

graalvmbot
Copy link
Collaborator

  • Save linkage errors and rethrow them on further attempts.
  • Common out the stick error mechanism for class and condy.
  • Remove unused constant pool entry types.
  • Fix how indy linking failures are remembered: Those should be remembered per call-site.
  • When rethrowing a failure, we make a fresh exception (to get a fresh stack trace) that has the same message and cause as the original. This is similar to hotspot except that hotspot also re-creates the cause. I think re-using the cause directly give a better stack trace for the original problem while still giving an accurate stack trace for the current resolution "attempt".

The diff makes the changes look a bit more complex than they are:

  • ResolvedClassConstant is split into ResolvedFoundClassConstant & ResolvedFailClassConstant.
  • CallSiteLink is split into SuccessfulCallSiteLink & FailedCallSiteLink.
  • FailInvokeDynamicConstant is gone and as a result LinkableInvokeDynamicConstant is not necessary and also removed.
  • CallSiteLinkingFailure is gone.
  • AbstractStickyFailure is created to share the behaviour of all failures that need to be remembered:
    • condy and class directly in the constant pool (both are AbstractFailedConstant)
    • indy in the call-site list of a ResolvedInvokeDynamicConstant (as a FailedCallSiteLink)
  • ClassConstant.WithString & PreResolvedClassConstant were already unused and are removed.

Save linkage errors and rethrow them on further attempts.
Common out the stick error mechanism for class, indy, and condy.
Remove unused constant pool entry types.
Those should be remembered per call-site.
* `AbstractFailedConstant` fail when their value is accessed so it's not
  necessary to remember to call `checkFail`
* `ClassSiteLink` must be downcasted to the correct success/fail
  implementation to be able to access their data or throw their
  exception.
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 31, 2025
@graalvmbot graalvmbot closed this Jan 31, 2025
@graalvmbot graalvmbot deleted the gd/resolution-failure branch January 31, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants