-
Notifications
You must be signed in to change notification settings - Fork 14
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
Lower SwitchExpressionOp #45
Conversation
👋 Welcome back mabbay! A progress list of the required criteria for merging this PR into |
@mabbay 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:
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 9 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
How do we distinguish (lowering of) complex switch expressions from basic tableswitch and lookupswitch? |
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.
That looks a good start. Also add a test case for a switch expression with case statement that falls through to the next case statement. (See constantCaseLabelFallthrough
in SwitchExpressionTest
).
Also, what if the switch target is null
?
Do you mean generating bytecode similar to what javac would? If so in this case the lowering should always produce ops in the core dialect, from which we can generate bytecode (program behavior preserved), but not of the same quality as javac. To do the latter we will need a more nuanced approach to generating bytecode, where some ops are lowered to core ops and some are not and are directly operated on by the bytecode generator. I don't know if the current modeling of switch is sufficient for generating equivalent bytecode. I suspect it will take a few rounds of modeling to get it right. |
@mabbay this pull request can not be integrated into git checkout lower-switch-expr
git fetch https://git.openjdk.org/babylon.git code-reflection
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge code-reflection"
git push |
# Conflicts: # src/java.base/share/classes/java/lang/reflect/code/op/ExtendedOp.java
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 looks good. Just some minor code changes. Subsequent PRs can add more test cases.
/integrate |
Going to push as commit deebe32.
Your commit was automatically rebased without conflicts. |
Lowering of SwitchExpressionOp
Progress
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/babylon.git pull/45/head:pull/45
$ git checkout pull/45
Update a local copy of the PR:
$ git checkout pull/45
$ git pull https://git.openjdk.org/babylon.git pull/45/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 45
View PR using the GUI difftool:
$ git pr show -t 45
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/babylon/pull/45.diff
Webrev
Link to Webrev Comment