8311591: Add SystemModulesPlugin test case that splits module descriptors with new local variables defined by DedupSetBuilder #15234
8311591: Add SystemModulesPlugin test case that splits module descriptors with new local variables defined by DedupSetBuilder #15234Siedlerchr wants to merge 25 commits into
Conversation
* origin/fix-8311591: Set module split size to 1
prepare methods for verifying
use parameter for jlink
|
👋 Welcome back Siedlerchr! A progress list of the required criteria for merging this PR into |
|
|
|
@Siedlerchr The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
@Siedlerchr Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
…tors with new local variables defined by DedupSetBuilder Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Webrevs
|
|
@Siedlerchr Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
|
We accidently pushed the full internal history - and "immediatly" squashed into one commit. From now on, we will update the branch "as usual" |
* upstream/master: (49 commits) 8313904: [macos] All signing tests which verifies unsigned app images are failing 8314139: TEST_BUG: runtime/os/THPsInThreadStackPreventionTest.java could fail on machine with large number of cores 8313798: [aarch64] sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java sometimes times out on aarch64 8313244: NM flags handling in configure process 8314113: G1: Remove unused G1CardSetInlinePtr::card_at 8311648: Refactor the Arena/Chunk/ChunkPool interface 8313224: Avoid calling JavaThread::current() in MemAllocator::Allocation constructor 8312461: JNI warnings in SunMSCApi provider 8312882: Update the CONTRIBUTING.md with pointers to lifecycle of a PR 8304292: Memory leak related to ClassLoader::update_class_path_entry_list 8313899: JVMCI exception Translation can fail in TranslatedException.<clinit> 8313633: [macOS] java/awt/dnd/NextDropActionTest/NextDropActionTest.java fails with java.lang.RuntimeException: wrong next drop action! 8312259: StatusResponseManager unused code clean up 8314061: [JVMCI] DeoptimizeALot stress logic breaks deferred barriers 8313905: Checked_cast assert in CDS compare_by_loader 8313654: Test WaitNotifySuspendedVThreadTest.java timed out 8312194: test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java cannot handle empty modules 8313616: support loading library members on AIX in os::dll_load 8313882: Fix -Wconversion warnings in runtime code 8313239: InetAddress.getCanonicalHostName may return ip address if reverse lookup fails ...
* origin/fix-8311591: 8311591: Add SystemModulesPlugin test case that splits module descriptors with new local variables defined by DedupSetBuilder
mlchung
left a comment
There was a problem hiding this comment.
Thanks for adding this case. The steps to extract from jimage and inspect the generated bytecode of SystemModules$all is for us to manually verify if the test does the work, i.e. each subX method adds more local variables due to deduplication. It's not needed in the test itself.
Since the batch size is 1, I would suggest that p4.Main can also load jdk.internal.module.SystemModules\$all and verify the expected numbers of subX methods (one per each module). To find all modules in the image, you can simply do ModuleFinder.ofSystem().findAll().
BTW, dedup/src/* files should also have the copyright header.
| provides ServiceInterface | ||
| with AInterface; |
There was a problem hiding this comment.
Nit: this can be in 1 line. No line break needed. Same for other module-info file.
| .output(src.resolve("out-jlink-dedup")) | ||
| .addMods("m1") | ||
| .addMods("m2") | ||
| .addMods("m2") |
| * jdk.jlink/jdk.tools.jimage | ||
| * jdk.compiler | ||
| * @build tests.* | ||
| * jdk.test.lib.compiler.CompilerUtils |
There was a problem hiding this comment.
This change is not needed, right?
| @@ -0,0 +1,145 @@ | |||
| /* | |||
| * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. | |||
There was a problem hiding this comment.
copyright header start year is 2023.
|
|
||
| public static void main(String[] args) throws Throwable { | ||
| compileAll(); | ||
| Path src = Paths.get("bug8311591"); |
There was a problem hiding this comment.
suggest to rename src to image to make it clear that it's the resulting image.
Revert unnecesary CompilerUtil
Assert number of module description generated sub modules Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Thanks for the suggestion. We added now a check in the main class for the number of generated sub methods. We put a fixed number, as we did not get the relation between the number of "require modules" statements and the total number of modules. |
mlchung
left a comment
There was a problem hiding this comment.
Looks good. Since the image is created with batchSize = 1, it means that one subX method is created for each module linked in the image. So the test can count the number of modules in the image and the number of subX methods should match the module count. I include the suggested code to check that.
| extractJImage(image); | ||
| decompileWitJavap(image); |
There was a problem hiding this comment.
No needed. These 2 lines along with the methods can be deleted.
| .output(image.resolve("out-jlink-dedup")) | ||
| .addMods("m1") | ||
| .addMods("m2") | ||
| .addMods("m2") |
There was a problem hiding this comment.
m2 is added twice. The duplicated line should be removed.
|
|
||
| /* | ||
| * @test | ||
| * @summary Make sure that modules can be linked using jlink and deduplication works correctly when creating sub methods |
| @@ -0,0 +1,13 @@ | |||
| package p1; | |||
Co-authored-by: Mandy Chung <mandy.chung@oracle.com>
Co-authored-by: Mandy Chung <mandy.chung@oracle.com>
Remove duplicated module in add mods call Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
* origin/fix-8311591: Update test/jdk/tools/jlink/dedup/src/m4/p4/Main.java Update test/jdk/tools/jlink/dedup/src/m4/p4/Main.java
|
Thanks a lot for your explanation and suggestions! Now we understood this :) |
mlchung
left a comment
There was a problem hiding this comment.
JLinkDedupTestBatchSizeOne.java line 115-144 can be deleted; otherwise, looks good.
| import java.util.ServiceLoader; | ||
|
|
||
| public class Main { | ||
| private final static int MODULE_SUB_METHOD_COUNT = 9; |
There was a problem hiding this comment.
This is leftover and should be deleted
There was a problem hiding this comment.
Ah yeah overlooked that!
|
|
@Siedlerchr 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 35 new commits pushed to the
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 (@mlchung) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
/integrate |
|
@Siedlerchr |
|
/sponsor |
|
Going to push as commit bc8e9f4.
Your commit was automatically rebased without conflicts. |
|
@mlchung @Siedlerchr Pushed as commit bc8e9f4. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
|
I created the backport PRs for JDK-8240567 and JDK-8311591. |
Add new test case with sample modules that contains some requires/exports/uses/provides.
We are just unsure if and how we should add some last step of verificaiton with the extracted and decompiled class.
Follow up task from #14408
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15234/head:pull/15234$ git checkout pull/15234Update a local copy of the PR:
$ git checkout pull/15234$ git pull https://git.openjdk.org/jdk.git pull/15234/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15234View PR using the GUI difftool:
$ git pr show -t 15234Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15234.diff
Webrev
Link to Webrev Comment