RFR: 8261090: Store old classfiles in static CDS archive [v2]

Calvin Cheung ccheung at openjdk.java.net
Tue Apr 20 00:05:09 UTC 2021


On Mon, 19 Apr 2021 17:11:36 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Calvin Cheung has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:
>> 
>>  - review comments from @iklam
>>  - Merge branch 'master' into 8261090-store-old-classfiles
>>  - use is_written() instead of is_old_class() in constantPool.cpp
>>  - remove extraneous whitespace
>>  - Merge branch 'master' into 8261090-store-old-classfiles
>>  - add comments and some code simplification
>>  - 8261090: Store old classfiles in static CDS archive
>
> src/hotspot/share/oops/klassVtable.cpp line 54:
> 
>> 52: 
>> 53: bool klassVtable::is_preinitialized_vtable() {
>> 54:   return _klass->is_shared() && !MetaspaceShared::remapped_readwrite() && !MetaspaceShared::is_old_class(ik());
> 
> Maybe we can avoid calling `MetaspaceShared::is_old_class()` by adding an extra bit into klass.hpp:
> 
> 
> #if INCLUDE_CDS
>   // Flags of the current shared class.
>   u2     _shared_class_flags;
>   enum {
>     _archived_lambda_proxy_is_available = 2,
>     _has_value_based_class_annotation = 4,
> +   _is_shared_old_klass = 8
>   };
> #endif

I've added the bit and it will be set in `MetaspaceShared::linking_required`.
Also replaced calling `MetaspaceShared::is_old_class()` with `k->is_shared_old_klass()` in several places.

Thanks for your review.

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

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


More information about the hotspot-runtime-dev mailing list