-
Notifications
You must be signed in to change notification settings - Fork 50
8333725: Compiler Prototyping for Deconstructors #94
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
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 <angelos.bimpoudis@oracle.com> Co-authored-by: Jan Lahoda <jan.lahoda@oracle.com> Co-authored-by: Vicente Romero <vicente.romero@oracle.com>
a19eff9
to
4c7b0ba
Compare
…o matchers-experiment # Conflicts: # src/java.base/share/classes/java/lang/Class.java
…or partial deconstructor exhaustiveness groups yet. (#15) * Attempting to add match-failed + partial deconstructors. No support for partial deconstructor exhaustiveness groups yet. * Error recovery.
Co-authored-by: Jan Lahoda <jan.lahoda@oracle.com>
* Erase pattern signature for records * Erase pattern signature for deconstructors
# Conflicts: # src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
…d mangled name calculation
…and match candidate yet. (#20) * First round of instance patterns. No patterns with separate instance and match candidate yet. * A very (VERY!) basic support for instance pattern with split receiver and match candidate. * Align calling convention between instance patterns and deconstructors * Fix adjustment of `syntheticPattern` computation --------- Co-authored-by: Angelos Bimpoudis <angelos.bimpoudis@oracle.com>
…23) * Instance patterns represented by instance methods in the translation * Second Approach: rely on the mangled name
@biboudis This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
/open |
@biboudis This pull request is now open |
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