-
Enhancement
-
Resolution: Fixed
-
P4
-
22
-
b16
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8322611 | 21.0.3 | Goetz Lindenmaier | P4 | Resolved | Fixed | b01 |
JDK-8341582 | 17.0.14 | Goetz Lindenmaier | P4 | Resolved | Fixed | b01 |
The change in JDK-8306582 revealed that the state of the resolved references array is not checked in the CDS archive.
If we want to add a test case, I would suggest adding a WhiteBox method like:
public native Object[] getResolvedReferences(Class<?> c);
This would return the resolved_references array for this class.
The test class would look like this:
class TestApp {
static String foo = "fooString";
static String bar = "barString";
public void main(String args[]) {
Object[] resolvedReferences = wb.getResolvedReferences(TestApp.class);
... resolvedReferences must be non null for classes in the static archive
... the test needs to have @requires vm.cds.write.archived.java.heap
bool foundFoo = false;
bool foundBar = false;
for (Object o : resolvedReferences) {
foundFoo |= (o == foo);
foundBar |= (o == bar);
}
... foo and bar must have been found
... CDS resolves all of the string literals used by the TestApp and stores
... them inside the resolvedReferences array.
}
The new test can live under test/hotspot/jtreg/runtime/cds/appcds/sharedStrings
If we want to add a test case, I would suggest adding a WhiteBox method like:
public native Object[] getResolvedReferences(Class<?> c);
This would return the resolved_references array for this class.
The test class would look like this:
class TestApp {
static String foo = "fooString";
static String bar = "barString";
public void main(String args[]) {
Object[] resolvedReferences = wb.getResolvedReferences(TestApp.class);
... resolvedReferences must be non null for classes in the static archive
... the test needs to have @requires vm.cds.write.archived.java.heap
bool foundFoo = false;
bool foundBar = false;
for (Object o : resolvedReferences) {
foundFoo |= (o == foo);
foundBar |= (o == bar);
}
... foo and bar must have been found
... CDS resolves all of the string literals used by the TestApp and stores
... them inside the resolvedReferences array.
}
The new test can live under test/hotspot/jtreg/runtime/cds/appcds/sharedStrings
- backported by
-
JDK-8322611 Add test for dump of resolved references
- Resolved
-
JDK-8341582 Add test for dump of resolved references
- Resolved
- links to
-
Commit openjdk/jdk21u-dev/15459679
-
Commit openjdk/jdk/83dca629
-
Commit(master) openjdk/jdk17u-dev/c1efd753
-
Review openjdk/jdk21u-dev/59
-
Review openjdk/jdk/15686
-
Review(master) openjdk/jdk17u-dev/2924
(3 links to)