-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8332340: Add JavacBench as a test case for CDS #19256
8332340: Add JavacBench as a test case for CDS #19256
Conversation
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
@iklam 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 89 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. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
list.add(s); | ||
} | ||
|
||
return list.toArray(new String[list.size()]); |
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.
I thought we have been preferring ot use new String[0]
for toArray calls. Also for simplicity, we can change the implementation to:
var list = new ArrayList<>(Arrays.asList(prefix));
Collections.addAll(list, extra);
return list.toArray(new String[0]);
or for performance:
String[] ret = new String[prefix.length + extra.length];
System.arraycopy(prefix, 0, ret, 0, prefix.length);
System.arraycopy(extra, 0, ret, prefix.length, extra.length);
return ret;
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.
Thanks for the suggestion. I used your arraycopy
version. I also added some javadocs about the intended use of these concat()
methods.
…ocessBuilder() instead of createLimitedTestJavaProcessBuilder()
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.
A few minor comments.
|
||
import jdk.test.lib.cds.CDSAppTester; | ||
import jdk.test.lib.helpers.ClassFileInstaller; | ||
import jdk.test.lib.process.OutputAnalyzer; |
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.
Is this import needed?
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.
Removed.
long elapsed = System.currentTimeMillis() - started; | ||
if (System.getProperty("JavacBenchApp.silent") == null) { |
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.
Should line 221 be inside the 'if' block?
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.
I moved it inside the 'if' block.
} | ||
} | ||
|
||
throw new RuntimeException("Must have exactly one command line argument: STATIC or DYNAMIC"); |
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.
Why not check the number of args at the beginning of the method?
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.
Fixed.
@@ -0,0 +1,77 @@ | |||
/* | |||
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. |
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.
Since this is a new file, should the copyright year be only 2024?
(same for other files)
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.
The file was first added in the Leyden repo in 2023, so I think we should use that as the initial copyright year.
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.
Updates look good. Thanks!
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.
LGTM, and thanks for the new utilities! That should make writing CDS tests a lot easier. I have a few style considerations but you can take them or leave them.
return output; | ||
} | ||
|
||
private OutputAnalyzer dumpStaticArchive() throws Exception { |
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.
The code from 156 to 162 is repeated 3 times here, is it worth making another function for this?
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.
Thanks for the suggestion. I've refactored the code a bit to make it easier to write new execution modes (which will be needed in Leyden).
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.
Changes look good
Thanks @liach @calvinccheung @matias9927 for the review |
Going to push as commit 7fd9d6c.
Your commit was automatically rebased without conflicts. |
JavacBench is a test program that compiles 90 Java source files. It uses a fair amount of invokedynamic callsites, so it's good for testing CDS support for indy and lambda expressions.
This test was first integrated into the leyden repo. Hence some of the files have copyrights in 2023.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19256/head:pull/19256
$ git checkout pull/19256
Update a local copy of the PR:
$ git checkout pull/19256
$ git pull https://git.openjdk.org/jdk.git pull/19256/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19256
View PR using the GUI difftool:
$ git pr show -t 19256
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19256.diff
Webrev
Link to Webrev Comment