8262046: Clean up parallel class loading code and comments #3200
This change reduces the length of SystemDictionary::resolve_instance_class_or_null, the main class loading function to 4 pages on my screen, down from ~6. Some functions are made static inside systemDictionary.hpp.
The only executable change is that handle_parallel_super_load used to have a wait while the class's superclass was being loaded after calling resolve_super_or_fail. It was similar to the subsequent code that waited for the LOAD_INSTANCE placeholder, immediately following the return from handle_parallel_super_load. I consolidated this code to wait for both conditions and kept the comment from handle_parallel_super_load. This wait is now in the function handle_parallel_loading.
I also added a new load_instance_class that calls load_instance_class_impl. The new load_instance_class does constraint checking and bookkeeping after it is called so that it can return with CHECK_NULL and not check pending exceptions. These functions aren't called outside of systemDictionary.cpp.
I added a test to show why handle_parallel_super_load is needed (see bug for details of the deadlock that this test would get if not for handle_parallel_super_load).
This updates comments to:
Ran tier1-3 testing, jck vm, jck lang and our internal parallel class loading tests. Retesting with tiers 4-8 in progress (I tested an earlier version of this with no failures).
iklam left a comment
I like the refactoring that combines two similar code paths into the single
@coleenp This change now passes all automated pre-integration checks.
After integration, the commit message for the final commit will be:
At the time when this comment was updated there had been 103 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
@coleenp Since your change was applied there have been 103 commits pushed to the
Your commit was automatically rebased without conflicts.
Pushed as commit 5e59d28.