RFR: 8276184: Exclude lambda proxy class from the CDS archive if its caller class is excluded [v5]
David Holmes
dholmes at openjdk.java.net
Wed Nov 10 22:04:38 UTC 2021
On Tue, 9 Nov 2021 19:56:13 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> The proposed patch has been redone completely to address the problem when a caller class is being excluded
>> from the archive, the associated lambda proxy class(es) was not excluded.
>>
>> The caller class could be excluded if:
>> - it is signed;
>> - it has been redefined after its lambda proxy class was created.
>
> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
>
> fix a bug in Hello.java, update SignedJar.java to perform more checks on output
Hi Calvin,
I really don't like the existing style of this code in relation to warn_excluded and adding the additional "silent" parameter just makes this worse in my opinion. It is not clear why you only want to log a warning in some cases.
David
src/hotspot/share/classfile/systemDictionaryShared.cpp line 217:
> 215:
> 216: if (!info->has_checked_exclusion()) {
> 217: if (check_for_exclusion_impl(k, false)) {
Please comment false argument.
src/hotspot/share/classfile/systemDictionaryShared.cpp line 227:
> 225:
> 226: // Returns true so the caller can do: return warn_excluded(".....");
> 227: bool SystemDictionaryShared::warn_excluded(InstanceKlass* k, const char* reason, bool silent) {
This is an odd function. It is a bool but only ever returns true - so should be void. It is intended to log a warning but takes a "silent" parameter - seems the caller should simply skip the call in that case.
src/hotspot/share/classfile/systemDictionaryShared.cpp line 274:
> 272: bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k, bool silent) {
> 273: if (k->is_in_error_state()) {
> 274: return warn_excluded(k, "In error state", silent);
I do not like this coding style at all! All these "return warn_excluded" simply return true! And that "true" has nothing to do with the "warn" aspect.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6205
More information about the hotspot-runtime-dev
mailing list