comparison src/share/vm/ci/ciEnv.cpp @ 10152:c115fac239eb

8008962: NPG: Memory regression: One extra Monitor per ConstantPool Summary: Re-use InstanceKlass::_init_lock locking ConstantPool as well. Reviewed-by: dholmes, coleenp, acorn
author iklam
date Thu, 25 Apr 2013 12:55:49 -0700
parents 2dec1d9bfbe1
children 9ce110b1d14a
comparison
equal deleted inserted replaced
10151:15a99ca4ee34 10152:c115fac239eb
481 // The klass has not been inserted into the constant pool. 481 // The klass has not been inserted into the constant pool.
482 // Try to look it up by name. 482 // Try to look it up by name.
483 { 483 {
484 // We have to lock the cpool to keep the oop from being resolved 484 // We have to lock the cpool to keep the oop from being resolved
485 // while we are accessing it. 485 // while we are accessing it.
486 MonitorLockerEx ml(cpool->lock()); 486 oop cplock = cpool->lock();
487 ObjectLocker ol(cplock, THREAD, cplock != NULL);
487 constantTag tag = cpool->tag_at(index); 488 constantTag tag = cpool->tag_at(index);
488 if (tag.is_klass()) { 489 if (tag.is_klass()) {
489 // The klass has been inserted into the constant pool 490 // The klass has been inserted into the constant pool
490 // very recently. 491 // very recently.
491 klass = KlassHandle(THREAD, cpool->resolved_klass_at(index)); 492 klass = KlassHandle(THREAD, cpool->resolved_klass_at(index));