-
Notifications
You must be signed in to change notification settings - Fork 109
8352068: [lworld] test StrictFinalInstanceFieldsTest.java needs to be updated after fix for JDK-8351951 #1449
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
base: lworld
Are you sure you want to change the base?
Conversation
👋 Welcome back matsaave! A progress list of the required criteria for merging this PR into |
@matias9927 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
test/hotspot/jtreg/ProblemList.txt
Outdated
@@ -139,6 +139,7 @@ runtime/AccModule/ConstModule.java 8294051 generic-all | |||
runtime/valhalla/inlinetypes/CircularityTest.java 8349037 generic-all | |||
runtime/valhalla/inlinetypes/PreloadCircularityTest.java 8349631 linux-aarch64-debug | |||
runtime/valhalla/inlinetypes/ValuePreloadTest.java 8349630 linux-aarch64-debug | |||
runtime/valhalla/inlinetypes/verifier/StrictInstanceFieldsTest.java generic-all |
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.
Does this require a bug number?
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.
Maybe CODETOOLS-7903081 will work.
For jasm tests, do we usually include a Xxx.test which includes the source to generate the basic jasm with asmtools, and then include comments in jasm to indicate where the class is modified from the original? |
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.
Just noticed these jasm and jcod are from StrictInstanceFieldsTest. Should be all good.
@matias9927 this pull request can not be integrated into git checkout new_strict_tests_8352068
git fetch https://git.openjdk.org/valhalla.git lworld
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge lworld"
git push |
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.
Maintaining jasm and jcod files can be a pain. The less those files contain, the better as it is less classfile / bytecode to try to build in your head while debugging.
One option for set of common tests like this that all have x & y fields, as well as getter methods and a complicated toString, is to use an abstract parent class:
abstract JasmParent extends Parent {
abstract int get_x();
abstract int get_y();
public String toString() {
return "x: " + get_x() + "\n" + "y: " + get_y() + "\n" + super.toString();
}
}
and have all the .jasm file class extend this class instead of using Parent directly. This will move all the bootstrap methods & indy related code out of jasm files and hopefully result in something simpler to look at.
Another option is to keep Parent as it is, but have its toString() use Reflection like: this.getClass().getDeclaredFeilds()
to find all the fields and print them. Any solution that moves code out of jasm / jcod files makes the code easier to maintain and understand longterm
test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/BadChild.jasm
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/BadChild1.jasm
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/BadChild1.jasm
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/ControlFlowChildBad.jasm
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/EndsInEarlyLarval.jcod
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/NestedEarlyLarval.jcod
Show resolved
Hide resolved
test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/StrictFieldsNotSubset.jcod
Outdated
Show resolved
Hide resolved
Thanks for this suggestion! I've opted to use reflection for toString() so I can get rid of get_x() and get_y(). The jasm and jcod files have been cleaned up and now include the equivalent java source code as a comment to better illustrate what is being tested. I snuck in a logging improvement as well. |
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
Updates to javac prevent it from creating classes with improper uses of strict fields. Additionally, non-final strict fields are now allowed so
StrictFinalInstanceFieldsTest.java
needs to updated with new test cases. This patch adds new cases for final and non-final stricts as well as negative test cases using asmtools that check improper use of strict fields and early larval stack map frames.During testing, it was revealed that the new verify errors added in JDK-8354694 do not work properly so a fix is included in this patch.
Note: This cannot be integrated until jtreg is updated with a recent build of asmtools which can handle strict fields and can generate early_larval frames.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1449/head:pull/1449
$ git checkout pull/1449
Update a local copy of the PR:
$ git checkout pull/1449
$ git pull https://git.openjdk.org/valhalla.git pull/1449/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1449
View PR using the GUI difftool:
$ git pr show -t 1449
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1449.diff
Using Webrev
Link to Webrev Comment