RFR: 8259068: Streamline class loader locking [v2]
Coleen Phillimore
coleenp at openjdk.java.net
Fri Jan 15 13:12:21 UTC 2021
> The system_loader_lock_object is never actually acquired when loading a class with a parallelCapable class loader, which includes the bootloader (class_loader == NULL), except in one place before restore_unshareable_info is called. In this case, the per-class lock (BuiltinLoader.getClassLoadingLock) is held or the placeholder for LOAD_INSTANCE is present which implements mutual exclusion. Ioi and I separately verified this while chasing down another bug.
> This change removes the system_loader_lock_obj and extraneous code around compute_loader_lock_object to make it consistent. This also removes the bool argument to ObjectLocker. If the oop passed into ObjectLocker is null, we don't lock the object, which is consistent with the Mutex class. This change also passes the class_loader to define_class to save an OopStorage.resolve() call.
> Tested with tier1-8.
Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
Changes for code review comments.
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/2071/files
- new: https://git.openjdk.java.net/jdk/pull/2071/files/ccc8281c..bb90fded
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2071&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2071&range=00-01
Stats: 19 lines in 2 files changed: 1 ins; 11 del; 7 mod
Patch: https://git.openjdk.java.net/jdk/pull/2071.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2071/head:pull/2071
PR: https://git.openjdk.java.net/jdk/pull/2071
More information about the hotspot-dev
mailing list