Skip to content
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

8332109: Convert remaining tests using com.sun.tools.classfile to ClassFile API #19206

Closed
wants to merge 2 commits into from

Conversation

liach
Copy link
Member

@liach liach commented May 12, 2024

Some tests are not migrated to the ClassFile API in previous migrations.

  • Some are simple oversights that didn't remove usages of com.sun.tools.classfile;
  • The CallerSensitive ones used an old utility, replaced by CF API-based new code;
  • many in javac are because the files are compiled with older source compatibility. Those patches are converted to have the source code stored in text blocks and compiled within tests using ToolBox#writeJavaFiles and CompilerUtils.compile;
  • As described in the JBS issue, there are a few other tests not covered; one is in 8331855: Convert jdk.jdeps jdeprscan and jdeps to use the Classfile API #19193 while the others are blocked by CreateSymbols migration or bugs.

Testing: all modified tests pass.


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

  • JDK-8332109: Convert remaining tests using com.sun.tools.classfile to ClassFile API (Sub-task - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19206

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19206.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 12, 2024

👋 Welcome back liach! 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
Copy link

openjdk bot commented May 12, 2024

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

8332109: Convert remaining tests using com.sun.tools.classfile to ClassFile API

Reviewed-by: asotona

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

  • 0b0445b: 8331724: Refactor j.l.constant implementation to internal package
  • d84a8fd: 8332327: Return _methods_jmethod_ids field back in VMStructs
  • f1ce9b0: 8331557: Serial: Refactor SerialHeap::do_collection
  • 14198f5: 8329653: JLILaunchTest fails on AIX after JDK-8329131
  • ae999ea: 8129418: JShell: better highlighting of errors in imports on demand
  • 6422efa: 8332394: Add friendly output when @ir rule missing value
  • 9160ef8: 8332237: [nmt] Remove the need for ThreadStackTracker::track_as_vm()
  • 7c750fd: 8331746: Create a test to verify that the cmm id is not ignored
  • de57d4b: 8332257: Shenandoah: Move evacuation methods to implementation file
  • da9c23a: 8325384: sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java failing intermittently when main thread is a virtual thread
  • ... and 55 more: https://git.openjdk.org/jdk/compare/32c7681cf310c87669c502c4a8b62a7fecc93360...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@jonathan-gibbons, @asotona) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label May 12, 2024
@openjdk
Copy link

openjdk bot commented May 12, 2024

@liach The following labels will be automatically applied to this pull request:

  • compiler
  • core-libs
  • javadoc

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added javadoc javadoc-dev@openjdk.org core-libs core-libs-dev@openjdk.org compiler compiler-dev@openjdk.org labels May 12, 2024
@mlbridge
Copy link

mlbridge bot commented May 12, 2024

Webrevs

Copy link
Contributor

@jonathan-gibbons jonathan-gibbons left a comment

Choose a reason for hiding this comment

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

javadoc test change looks OK.

continue;

boolean needsCsm = false;
for (var element : code) {
Copy link
Member

Choose a reason for hiding this comment

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

Scanning the instructions is a bit different approach than in the original test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Same as the other method name check, it was manually extracted ReferenceFinder logic, we should retire ReferenceFinder with the old class file library.

Comment on lines +121 to +125
if (element instanceof InvokeInstruction invoke
&& invoke.opcode() == Opcode.INVOKESTATIC
&& invoke.method() instanceof MethodRefEntry ref
&& ref.owner().name().equalsString(className)
&& ref.name().equalsString(methodName)) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this additional test necessary, I don't see it in the original test.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was part of the now-removed ReferenceFinder logic; it scans cp as a fast path and then does instruction scan for all methods to find relevant methods to pass to visitor.

Path out = Path.of("out");
ToolBox toolBox = new ToolBox();
toolBox.writeJavaFiles(in, SOURCE);
CompilerUtils.compile(in, out, "--release", "16");
Copy link
Member

Choose a reason for hiding this comment

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

Smart move 👍

Copy link
Member

@asotona asotona left a comment

Choose a reason for hiding this comment

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

Looks good to me, great job, thanks!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 17, 2024
@liach
Copy link
Member Author

liach commented May 17, 2024

Thanks for the review!

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 17, 2024
@openjdk
Copy link

openjdk bot commented May 17, 2024

@liach
Your change (at version 4880f3a) is now ready to be sponsored by a Committer.

@asotona
Copy link
Member

asotona commented May 17, 2024

/sponsor

@openjdk
Copy link

openjdk bot commented May 17, 2024

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

  • e0d1c4b: 8321428: Deprecate for removal the package java.beans.beancontext
  • 0b0445b: 8331724: Refactor j.l.constant implementation to internal package
  • d84a8fd: 8332327: Return _methods_jmethod_ids field back in VMStructs
  • f1ce9b0: 8331557: Serial: Refactor SerialHeap::do_collection
  • 14198f5: 8329653: JLILaunchTest fails on AIX after JDK-8329131
  • ae999ea: 8129418: JShell: better highlighting of errors in imports on demand
  • 6422efa: 8332394: Add friendly output when @ir rule missing value
  • 9160ef8: 8332237: [nmt] Remove the need for ThreadStackTracker::track_as_vm()
  • 7c750fd: 8331746: Create a test to verify that the cmm id is not ignored
  • de57d4b: 8332257: Shenandoah: Move evacuation methods to implementation file
  • ... and 56 more: https://git.openjdk.org/jdk/compare/32c7681cf310c87669c502c4a8b62a7fecc93360...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 17, 2024
@openjdk openjdk bot closed this May 17, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels May 17, 2024
@openjdk
Copy link

openjdk bot commented May 17, 2024

@asotona @liach Pushed as commit beeffd4.

💡 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
compiler compiler-dev@openjdk.org core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated javadoc javadoc-dev@openjdk.org
3 participants