Mercurial > hg > truffle
comparison src/share/vm/prims/jvmtiEnv.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 | 8b46b0196eb0 |
children | 836a62f43af9 b8860472c377 |
comparison
equal
deleted
inserted
replaced
10151:15a99ca4ee34 | 10152:c115fac239eb |
---|---|
257 // Not cached, we need to reconstitute the class file from the | 257 // Not cached, we need to reconstitute the class file from the |
258 // VM representation. We don't attach the reconstituted class | 258 // VM representation. We don't attach the reconstituted class |
259 // bytes to the InstanceKlass here because they have not been | 259 // bytes to the InstanceKlass here because they have not been |
260 // validated and we're not at a safepoint. | 260 // validated and we're not at a safepoint. |
261 constantPoolHandle constants(current_thread, ikh->constants()); | 261 constantPoolHandle constants(current_thread, ikh->constants()); |
262 MonitorLockerEx ml(constants->lock()); // lock constant pool while we query it | 262 oop cplock = constants->lock(); |
263 ObjectLocker ol(cplock, current_thread, cplock != NULL); // lock constant pool while we query it | |
263 | 264 |
264 JvmtiClassFileReconstituter reconstituter(ikh); | 265 JvmtiClassFileReconstituter reconstituter(ikh); |
265 if (reconstituter.get_error() != JVMTI_ERROR_NONE) { | 266 if (reconstituter.get_error() != JVMTI_ERROR_NONE) { |
266 return reconstituter.get_error(); | 267 return reconstituter.get_error(); |
267 } | 268 } |
2415 return JVMTI_ERROR_ABSENT_INFORMATION; | 2416 return JVMTI_ERROR_ABSENT_INFORMATION; |
2416 } | 2417 } |
2417 | 2418 |
2418 instanceKlassHandle ikh(thread, k_oop); | 2419 instanceKlassHandle ikh(thread, k_oop); |
2419 constantPoolHandle constants(thread, ikh->constants()); | 2420 constantPoolHandle constants(thread, ikh->constants()); |
2420 MonitorLockerEx ml(constants->lock()); // lock constant pool while we query it | 2421 oop cplock = constants->lock(); |
2422 ObjectLocker ol(cplock, thread, cplock != NULL); // lock constant pool while we query it | |
2421 | 2423 |
2422 JvmtiConstantPoolReconstituter reconstituter(ikh); | 2424 JvmtiConstantPoolReconstituter reconstituter(ikh); |
2423 if (reconstituter.get_error() != JVMTI_ERROR_NONE) { | 2425 if (reconstituter.get_error() != JVMTI_ERROR_NONE) { |
2424 return reconstituter.get_error(); | 2426 return reconstituter.get_error(); |
2425 } | 2427 } |