8262910: Cleanup THREAD/TRAPS/naming and typing issues in ObjectMonitor and related code

Reviewed-by: coleenp, pchilanomate, dcubed, cjplummer, sspitsyn
This commit is contained in:
David Holmes 2021-03-10 22:33:56 +00:00
parent 57f16f9fe5
commit c6d74bd933
18 changed files with 470 additions and 521 deletions

View file

@ -807,7 +807,7 @@ void InstanceKlass::eager_initialize_impl() {
EXCEPTION_MARK;
HandleMark hm(THREAD);
Handle h_init_lock(THREAD, init_lock());
ObjectLocker ol(h_init_lock, THREAD);
ObjectLocker ol(h_init_lock, THREAD->as_Java_thread());
// abort if someone beat us to the initialization
if (!is_not_initialized()) return; // note: not equivalent to is_initialized()
@ -943,7 +943,7 @@ bool InstanceKlass::link_class_impl(TRAPS) {
{
HandleMark hm(THREAD);
Handle h_init_lock(THREAD, init_lock());
ObjectLocker ol(h_init_lock, THREAD);
ObjectLocker ol(h_init_lock, jt);
// rewritten will have been set if loader constraint error found
// on an earlier link attempt
// don't verify or rewrite if already rewritten
@ -1068,7 +1068,7 @@ void InstanceKlass::initialize_impl(TRAPS) {
// Step 1
{
Handle h_init_lock(THREAD, init_lock());
ObjectLocker ol(h_init_lock, THREAD);
ObjectLocker ol(h_init_lock, jt);
// Step 2
// If we were to use wait() instead of waitInterruptibly() then
@ -1211,7 +1211,7 @@ void InstanceKlass::initialize_impl(TRAPS) {
void InstanceKlass::set_initialization_state_and_notify(ClassState state, TRAPS) {
Handle h_init_lock(THREAD, init_lock());
if (h_init_lock() != NULL) {
ObjectLocker ol(h_init_lock, THREAD);
ObjectLocker ol(h_init_lock, THREAD->as_Java_thread());
set_init_thread(NULL); // reset _init_thread before changing _init_state
set_init_state(state);
fence_and_clear_init_lock();