[16] RFR(S) 8246546 Simplify SystemDictionary::is_shared_class_visible

Ioi Lam ioi.lam at oracle.com
Tue Jun 16 22:53:43 UTC 2020


The current implementation of SystemDictionary::is_shared_class_visible 
has grown more and more complex over time. Now it has checks for many 
special cases and the code is hard to understand.

I have simplified the logic to:

Between dump time and run time, if a class:

   - has the same class loader
   - belongs to the same module
   - is loaded from the same location

... then this class is visible at run time.

The new check should be more robust and faster.

For validation, I kept the old implementation and assert that the new 
code produces the exact same result. I will remove 
SystemDictionary::is_shared_class_visible_impl_old() and 
SystemDictionaryShared::is_shared_class_visible_for_classloader() when I 
do the actual push.

Testing -- all CDS tests passed locally. Running mach5 tiers 1-4 now.

- Ioi

More information about the hotspot-runtime-dev mailing list