Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
/ jdk19 Public archive

8288120: VerifyError with JEP 405 pattern match #34

Closed
wants to merge 2 commits into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Jun 17, 2022

When pattern matching is looking up the accessor methods, it currently uses Scope.findFirst. This method may find a method with the same name from the record's supertype. The proposal is to use Resolve.resolveInternalMethod which should lookup the methods based on the ordinary rules, and should find the accessor from the record.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk19 pull/34/head:pull/34
$ git checkout pull/34

Update a local copy of the PR:
$ git checkout pull/34
$ git pull https://git.openjdk.org/jdk19 pull/34/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 34

View PR using the GUI difftool:
$ git pr show -t 34

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk19/pull/34.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 17, 2022

👋 Welcome back jlahoda! 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 Pull request is ready for review label Jun 17, 2022
@openjdk
Copy link

openjdk bot commented Jun 17, 2022

@lahodaj 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 compiler-dev@openjdk.org label Jun 17, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 17, 2022

Webrevs

.findFirst(component.name, s -> s.kind == Kind.MTH &&
((MethodSymbol) s).params.isEmpty());
MethodSymbol realAccessor =
rs.resolveInternalMethod(pos, env, component.owner.type,
Copy link

@vicente-romero-oracle vicente-romero-oracle Jun 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I think that you can just read the accessor field in the record component, it should point to the accessor's symbol which is what you want here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I didn't realize that! Fixed now.

@@ -359,7 +356,7 @@ private MethodSymbol getAccessor(RecordComponent component) {
type,
currentClass);
JCStatement accessorStatement =
make.Return(make.App(make.Select(make.Ident(proxy.params().head), realAccessor)));
make.Return(make.App(make.Select(make.Ident(proxy.params().head), c.accessor)));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I let this to your consideration: it could be worth as part of this patch to check if there are other places in the record patterns code that can benefit from this simplification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but I don't recall other places in the current pattern matching code that would be looking up the accessors.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok sounds good

Copy link

@vicente-romero-oracle vicente-romero-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@openjdk
Copy link

openjdk bot commented Jun 21, 2022

@lahodaj 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 details.

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

8288120: VerifyError with JEP 405 pattern match

Reviewed-by: vromero

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 17 new commits pushed to the master branch:

  • b9c3966: 8288671: Problematic fix for font boosting
  • 453e8be: 8288527: broken link in java.base/java/util/zip/package-summary.html
  • 33d0363: 8288741: JFR: Change package name of snippet files
  • 0408f9c: 8288663: JFR: Disabling the JfrThreadSampler commits only a partially disabled state
  • 1cf83a4: 8287800: JFR: Incorrect error message when starting recording with missing .jfc file
  • 09da87c: 8288485: jni/nullCaller/NullCallerTest.java failing (ppc64)
  • ed714af: 8288564: C2: LShiftLNode::Ideal produces wrong result after JDK-8278114
  • ae030bc: 8288397: AArch64: Fix register issues in SVE backend match rules
  • f12d044: 8288692: jdk/javadoc/doclet/testTagMisuse/TestTagMisuse.java fails after JDK-8288545
  • 97544be: 8268398: 15% increase in JFR footprint in Noop-Base
  • ... and 7 more: https://git.openjdk.org/jdk19/compare/f3b1f60a29d0d48346988239f15437780642f562...master

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 Pull request is ready to be integrated label Jun 21, 2022
@lahodaj
Copy link
Contributor Author

lahodaj commented Jun 24, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Jun 24, 2022

Going to push as commit bdf9902.
Since your change was applied there have been 38 commits pushed to the master branch:

  • b0db333: 8288528: broken links in java.desktop
  • 651cbeb: 8288080: (fc) FileChannel::map for MemorySegments should state it always throws UOE
  • 1f9521e: 8287076: Document.normalizeDocument() produces different results
  • a716f79: 8288589: Files.readString ignores encoding errors for UTF-16
  • 4c9ea7e: 8286580: serviceability/jvmti/vthread/GetSetLocalTest failed with assert: Not supported for heap frames
  • 3f5e48a: 8288781: C1: LIR_OpVisitState::maxNumberOfOperands too small
  • 6458ebc: 8288988: ProblemList serviceability/jvmti/vthread/ContStackDepthTest/ContStackDepthTest.java in -Xcomp mode
  • 6037ccd: 8288846: misc tests fail "assert(ms < 1000) failed: Un-interruptable sleep, short time use only"
  • 8fa46c8: 8288840: StructureViolationException should not link to fork method
  • 7cf71bc: 8287982: Concurrent implicit attach from native threads crashes VM
  • ... and 28 more: https://git.openjdk.org/jdk19/compare/f3b1f60a29d0d48346988239f15437780642f562...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 24, 2022
@openjdk openjdk bot closed this Jun 24, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 24, 2022
@openjdk
Copy link

openjdk bot commented Jun 24, 2022

@lahodaj Pushed as commit bdf9902.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler compiler-dev@openjdk.org integrated Pull request has been integrated
2 participants