git: openjdk/leyden: premain: 3 new changesets

ioi.lam at oracle.com ioi.lam at oracle.com
Wed Feb 21 02:30:35 UTC 2024


Hi Ashutosh,

The assert is to guard against changing values in k->is_loader_alive(). 
It's needed in the general case.

For your use case, I think it's better to use a new iterator:

template<typename Function>
void 
DumpTimeSharedClassTable::iterate_all_classes_in_builtin_loaders(Function 
function) const {
   auto wrapper = [&] (InstanceKlass* k, DumpTimeClassInfo& info) {
     assert_lock_strong(DumpTimeTable_lock);
     if (k->loader() == ...builtin...) {
        assert(k->is_loader_alive(), "must be");
        function(k, info);
        assert(k->is_loader_alive(), "must be");
     }
   };
   DumpTimeSharedClassTableBaseType::iterate_all(wrapper);
}

Thanks

- Ioi

On 2/20/24 8:55 AM, Ashutosh Mehra wrote:
> Thank you for trying out the changes.
> I missed out running the tests with fastdebug. Thanks for pointing out 
> that bug.
> I pushed the suggested change with some comments to explain the reasoning.
>
> Thanks,
> Ashutosh Mehra
>
>
> On Fri, Feb 16, 2024 at 6:41 PM Vladimir Ivanov 
> <vladimir.x.ivanov at oracle.com> wrote:
>
>     Nice work, Ashutosh!
>
>     I gave it a try. It works fine in product build (<1k downcalls into
>     JVM_FindClass* on PetClinic), but with fastdebug build it hits an
>     assert
>     during
>     SystemDictionaryShared::create_loader_positive_lookup_cache() [1].
>
>     Best regards,
>     Vladimir Ivanov
>
>     [1]
>     diff --git a/src/hotspot/share/cds/dumpTimeClassInfo.inline.hpp
>     b/src/hotspot/share/cds/dumpTimeClassInfo.inline.hpp
>     index 6b46fe58916..d118400b25f 100644
>     --- a/src/hotspot/share/cds/dumpTimeClassInfo.inline.hpp
>     +++ b/src/hotspot/share/cds/dumpTimeClassInfo.inline.hpp
>     @@ -43,7 +43,7 @@
>       template<typename Function>
>       void DumpTimeSharedClassTable::iterate_all_live_classes(Function
>     function) const {
>         auto wrapper = [&] (InstanceKlass* k, DumpTimeClassInfo& info) {
>     -    assert(SafepointSynchronize::is_at_safepoint(), "invariant");
>     +//    assert(SafepointSynchronize::is_at_safepoint(), "invariant");
>           assert_lock_strong(DumpTimeTable_lock);
>           if (CDSConfig::is_dumping_final_static_archive() &&
>     !k->is_loaded()) {
>             assert(k->is_shared_unregistered_class(), "must be");
>
>
>     On 2/14/24 13:19, duke wrote:
>     > Changeset: b58e0e37
>     > Author:    Ashutosh Mehra <asmehra at redhat.com>
>     > Date:      2024-01-24 14:09:45 +0000
>     > URL:
>     https://git.openjdk.org/leyden/commit/b58e0e3738d803b51bd4ef25b30746048adcab40
>     >
>     > Add negative cache for built-in loaders
>     >
>     > Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>     >
>     > ! src/java.base/share/classes/java/lang/Class.java
>     > !
>     src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java
>     >
>     > Changeset: 393f79de
>     > Author:    Ashutosh Mehra <asmehra at redhat.com>
>     > Date:      2024-01-31 13:48:14 +0000
>     > URL:
>     https://git.openjdk.org/leyden/commit/393f79de5204a103bd60334e2910b9857639ad26
>     >
>     > Persist loader negative cache in CDS archive
>     >
>     > Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>     >
>     > ! src/hotspot/share/cds/classListParser.cpp
>     > ! src/hotspot/share/cds/classListParser.hpp
>     > ! src/hotspot/share/cds/classListWriter.cpp
>     > ! src/hotspot/share/cds/classListWriter.hpp
>     > ! src/hotspot/share/runtime/java.cpp
>     > ! src/java.base/share/classes/java/lang/Class.java
>     > !
>     src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java
>     >
>     > Changeset: 361fc8b0
>     > Author:    Ashutosh Mehra <asmehra at redhat.com>
>     > Date:      2024-02-09 12:35:14 +0000
>     > URL:
>     https://git.openjdk.org/leyden/commit/361fc8b0af9512ced9dfee6b348de01191b0a7fa
>     >
>     > Positive lookup cache for built-in loaders and some cleanup
>     >
>     > Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>     >
>     > ! src/hotspot/share/cds/cds_globals.hpp
>     > ! src/hotspot/share/cds/classListParser.cpp
>     > ! src/hotspot/share/cds/classListWriter.cpp
>     > ! src/hotspot/share/cds/metaspaceShared.cpp
>     > ! src/hotspot/share/classfile/systemDictionaryShared.cpp
>     > ! src/hotspot/share/classfile/systemDictionaryShared.hpp
>     > ! src/java.base/share/classes/java/lang/Class.java
>     > !
>     src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java
>     >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/leyden-dev/attachments/20240220/ad40a817/attachment.htm>


More information about the leyden-dev mailing list