Skip to content

Move Interpreter to test area#969

Closed
mabbay wants to merge 5 commits intoopenjdk:code-reflectionfrom
mabbay:mv-interpreter
Closed

Move Interpreter to test area#969
mabbay wants to merge 5 commits intoopenjdk:code-reflectionfrom
mabbay:mv-interpreter

Conversation

@mabbay
Copy link
Member

@mabbay mabbay commented Mar 14, 2026

We move Interpreter to the location of runtime tests alongside a copy of ArithmeticAndConvOpImpls. Runtime tests that depends on Interpreter refer to it via @library tag.
The original copy of ArithmeticAndConvOpImpls is kept in the internal package as it's used by op evaluation API. We remove methods from internal.ArithmeticAndConvOpImpls that are not used by the op evaluation API.


Progress

  • Change must not contain extraneous whitespace

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 969

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/babylon/pull/969.diff

Using Webrev

Link to Webrev Comment

@mabbay mabbay self-assigned this Mar 14, 2026
@bridgekeeper
Copy link

bridgekeeper bot commented Mar 14, 2026

👋 Welcome back mabbay! A progress list of the required criteria for merging this PR into code-reflection will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

# Conflicts:
#	test/jdk/jdk/incubator/code/TestSwitchExpressionOp.java
@openjdk
Copy link

openjdk bot commented Mar 14, 2026

@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:

Move Interpreter to test area

Reviewed-by: mcimadamore

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 6 new commits pushed to the code-reflection branch:

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 code-reflection branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Mar 14, 2026

@mabbay this pull request can not be integrated into code-reflection due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout mv-interpreter
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

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch rfr Pull request is ready for review ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels Mar 14, 2026
@mlbridge
Copy link

mlbridge bot commented Mar 14, 2026

Webrevs

"TestLambdaCapture.java", // plain junit test
"ReflectableLambdaSameInstanceTest.java", // plain junit test
"CodeModelSameInstanceTest.java" // plain junit test
"LocalClassTest.java" // name of local classes is not stable at annotation processing time
Copy link
Collaborator

Choose a reason for hiding this comment

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

I tried locally -- and effectively these seem to work fine -- I remember I excluded them because otherwise they would fail because of the testng imports -- but they look fine now. Odd.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe because we migrated from TestNG to JUnit

Copy link
Collaborator

Choose a reason for hiding this comment

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

Likely

Copy link
Collaborator

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

Overall looks good. The only doubt I have is whether we should really duplicate the ArithmeticAndConvOp class. Note that we can use the @modules tag to give test access to non-exported package:

@modules jdk.incubator.code/<package name>

This would allow to keep only one copy (and keep it in a non-exported package)

@mabbay
Copy link
Member Author

mabbay commented Mar 17, 2026

Overall looks good. The only doubt I have is whether we should really duplicate the ArithmeticAndConvOp class. Note that we can use the @modules tag to give test access to non-exported package:

@modules jdk.incubator.code/<package name>

This would allow to keep only one copy (and keep it in a non-exported package)

ArithmeticAndConvOp used by Interpreter has few methods more then the class used by operation evaluation API.

Copy link
Collaborator

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

For now looks ok -- if we notice that code starts diverging too much, or that we need to keep the internal version of ArithmenticAndConvOp in sync with the test/interpreter one, we might revisit.

@PaulSandoz
Copy link
Member

For now looks ok -- if we notice that code starts diverging too much, or that we need to keep the internal version of ArithmenticAndConvOp in sync with the test/interpreter one, we might revisit.

The divergence is due to the lifter of bytecode to code models, where the use of primitive conversion operation is extended to support conversion between boolean values, and then the Interpreter is used to test such lifted models. We need to revisit the lifter and also leave appropriate comments to remind us.

import java.lang.invoke.MethodType;
import java.util.List;

public final class ArithmeticAndConvOpImpls {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment as to why we need to duplicate and extend the non-test version?

@mabbay
Copy link
Member Author

mabbay commented Mar 24, 2026

/integrate

@openjdk
Copy link

openjdk bot commented Mar 24, 2026

Going to push as commit 2075f10.
Since your change was applied there have been 6 commits pushed to the code-reflection branch:

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 24, 2026

@mabbay Pushed as commit 2075f10.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants