-
Notifications
You must be signed in to change notification settings - Fork 49
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
8333725: Compiler Prototyping for Deconstructors #94
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back abimpoudis! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@biboudis this pull request can not be integrated into git checkout matchers-experiment
git fetch https://git.openjdk.org/amber.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
d635684
to
ccc44d4
Compare
@@ -4286,6 +4366,70 @@ public void visitRecordPattern(JCRecordPattern tree) { | |||
matchBindings = new MatchBindings(outBindings.toList(), List.nil()); | |||
} | |||
|
|||
// todo: follow the protocol in Resolve::selectBest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method I think belongs in Resolve
@@ -2779,6 +2779,32 @@ public void visitMethodDef(JCMethodDecl tree) { | |||
syms.methodClass); | |||
} | |||
|
|||
if (tree.sym.isPattern()) { | |||
tree.sym.flags_field |= STATIC; | |||
tree.sym.flags_field |= SYNTHETIC; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are making synthetic an AST that actually appears in the source?
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
Outdated
Show resolved
Hide resolved
expectedRecordTypes = record.getRecordComponents() | ||
.stream() | ||
.map(rc -> types.memberType(site, rc)) | ||
.map(t -> types.upward(t, types.captures(t)).baseType()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why the upward projection is used here
6138923
to
5246297
Compare
bf45138
to
250d702
Compare
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MemberEnter.java
Outdated
Show resolved
Hide resolved
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
Outdated
Show resolved
Hide resolved
@@ -201,7 +202,7 @@ int putName(Name name) { | |||
* Puts a name and type pair into the pool and returns its index. | |||
*/ | |||
int putNameAndType(Symbol s) { | |||
return pool.writeIfNeeded(new NameAndType(s.name, descriptorType(s))); | |||
return pool.writeIfNeeded(new NameAndType(s instanceof MethodSymbol ms ? ms.externalName(types) : s.name, descriptorType(s))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same not sure why you need this change
250d702
to
a19eff9
Compare
Co-authored-by: Angelos Bimpoudis <[email protected]> Co-authored-by: Jan Lahoda <[email protected]> Co-authored-by: Vicente Romero <[email protected]>
a19eff9
to
4c7b0ba
Compare
…o matchers-experiment # Conflicts: # src/java.base/share/classes/java/lang/Class.java
<!-- Start of TOU acceptance message header -->
Hi @Rick-24, thanks for making a comment in an OpenJDK project!
All comments and discussions in the OpenJDK Community must be made available under the OpenJDK [Terms of Use](https://openjdk.java.net/legal/tou/). If you already are an OpenJDK [Author](https://openjdk.java.net/bylaws#author), [Committer](https://openjdk.java.net/bylaws#committer) or [Reviewer](https://openjdk.java.net/bylaws#reviewer), please click [here](https://bugs.openjdk.java.net/secure/CreateIssue.jspa?pid=11300&issuetype=1) to open a new issue so that we can record that fact. Please Use "Add GitHub user Rick-24" for the summary.
If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.
<!-- End of TOU acceptance message header -->
- [ ] I agree to the [OpenJDK Terms of Use](https://openjdk.java.net/legal/tou/) for all comments I make in a project in the [OpenJDK GitHub organization](https://github.com/openjdk).
<!-- Start of TOU acceptance message footer -->
Your comment will be automatically restored once you have accepted the OpenJDK [Terms of Use](https://openjdk.java.net/legal/tou/).
<!-- End of TOU acceptance message footer -->
<!-- Original message to be restored:
%E6%82%A8%E5%A5%BD%EF%BC%8C%E6%82%A8%E7%9A%84%E6%9D%A5%E4%BF%A1%E6%88%91%E5%B7%B2%E6%94%B6%E5%88%B0%EF%BC%8C%E6%88%91%E4%BC%9A%E5%B0%BD%E5%BF%AB%E5%A4%84%E7%90%86%E3%80%82%C2%A0+%C2%A0+%C2%A0+%E7%A5%9D%E5%A5%BD%EF%BC%81
-->
|
Definitely keep it open :D |
…periment # Conflicts: # src/java.base/share/classes/java/lang/classfile/AccessFlags.java # src/java.base/share/classes/java/lang/classfile/Attribute.java # src/java.base/share/classes/java/lang/classfile/AttributedElement.java # src/java.base/share/classes/java/lang/classfile/MethodElement.java # src/java.base/share/classes/java/lang/reflect/ReflectAccess.java # src/java.base/share/classes/jdk/internal/classfile/impl/ClassRemapperImpl.java # src/java.base/share/classes/jdk/internal/classfile/impl/UnboundAttribute.java # src/java.base/share/native/libjava/Class.c # src/java.compiler/share/classes/javax/lang/model/element/Modifier.java # src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitorPreview.java # src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java # src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java # test/jdk/jdk/classfile/StackMapsTest.java
a3133eb
to
f5c926b
Compare
…periment # Conflicts: # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
b856cb6
to
7fbda10
Compare
- Fix crash when assigning to bindings - Disallow pattern no matching on all control paths Co-authored-by: Jan Lahoda <[email protected]>
7fbda10
to
522cf97
Compare
… to deconstructors
# Conflicts: # test/jdk/jdk/classfile/StackMapsTest.java
…periment # Conflicts: # src/java.base/share/classes/java/lang/reflect/Constructor.java
…periment # Conflicts: # src/java.base/share/classes/java/lang/Class.java # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java
…periment # Conflicts: # test/jdk/jdk/classfile/helpers/RebuildingTransformation.java
@biboudis This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Most definitely keep it open :D |
…periment # Conflicts: # src/java.base/share/classes/java/lang/Class.java # test/jdk/jdk/classfile/helpers/RebuildingTransformation.java
Work-in-progress prototyping of deconstructors.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/amber.git pull/94/head:pull/94
$ git checkout pull/94
Update a local copy of the PR:
$ git checkout pull/94
$ git pull https://git.openjdk.org/amber.git pull/94/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 94
View PR using the GUI difftool:
$ git pr show -t 94
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/amber/pull/94.diff