RFR: 8261455: Automatically generate the CDS archive if necessary [v9]

Calvin Cheung ccheung at openjdk.java.net
Tue Jan 11 22:51:29 UTC 2022


On Tue, 11 Jan 2022 16:39:05 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> This patch is re-coded after serial fixes related: 8275846, 8276787, 8279018 etc.
>> original description(PR 5997):
>> `----------------------------------------------------------------------------------`
>> When shared archive (dynamic archive) failed to map due to damage of the archive file, dump/run jdk version mismatch or non-existence file etc, the new patch will automatically create a new shared archive if -XX:+AutoCreateSharedArchive specified with the name based on SharedArchiveFile.
>> This is a revised patch based on the old PR: 5077 and after bug 8273152 integrated.
>> `-----------------------------------------------------------------------------------`
>> 
>> Tests: tier1,tier2,tier3,tier4
>> 
>> Thanks
>> Yumin
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Clean further for nits and warning

Looks good. Some minor nits.

src/hotspot/share/runtime/java.cpp line 2:

> 1: /*
> 2:  * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.

You can revert the copyright header change since there's no other changes in this file.

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java line 43:

> 41:  *
> 42:  *  (A) Test with default base archive -XX:+SharedArchiveFile=<archive>
> 43:  *  (B) Test with the base archive is specified: -XX:SharedArchiveFile=<base>:<top>

The "is" is extra.

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java line 72:

> 70:  *     not create dynamic archive at exit with -XX:+VerifySharedSpaces
> 71:  *
> 72:  * 16 run with an archive of only containing magic in the file (size of 4 bytes)

Please delete the "of" after "archive".

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java line 85:

> 83:  *   21.01 if version of top archive is higher than CDS_GENERIC_HEADER_SUPPORTED_MIN_VERSION, the archive cannot be shared and will be
> 84:  *         regenerated at exit.
> 85:  *   21.02 if version of top archive is lower than CDS_GENERIC_HEADER_SUPPORTED_MIN_VERSION, the archive cannot be shared abd will be

s/abd/and

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java line 154:

> 152:         boolean fileModified = false;
> 153: 
> 154:         String VerifySharedSpaces = verifyOn ? "-XX:+VerifySharedSpaces" : "-XX:-VerifySharedSpaces";

A local variable name usually starts with lowercase.
Suggest changing VerifySharedSpaces to verifySharedSpaces.

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java line 279:

> 277:         fileModified = !ft1.equals(ft2);
> 278:         if (fileModified) {
> 279:             throw new RuntimeException("Shared archive " + modMagic + " should automatically be generated");

Should the message be: “… should not be automatically generated”?

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java line 578:

> 576:         fileModified = !ft1.equals(ft2);
> 577:         if (!fileModified) {
> 578:             throw new RuntimeException("Shared archive " + magicOnly + " should not be created at exit");

Should the message be: “… should be created at exit”?

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java line 690:

> 688:         fileModified = !ft1.equals(ft2);
> 689:         if (fileModified) {
> 690:             throw new RuntimeException("Shared archive " + TOP_NAME + " should be created at exit");

Should the message be: “…should not be created at exit”?

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveNoDefaultArchive.java line 126:

> 124:             jsaFile.delete();
> 125:         }
> 126:         System.out.println("======= run with no default shared archive should no create shared archive at exit");

Typo: should no create -> should not create

-------------

PR: https://git.openjdk.java.net/jdk/pull/6920


More information about the hotspot-runtime-dev mailing list