comparison src/share/vm/code/codeCache.cpp @ 2457:527977d4f740

7033779: CodeCache::largest_free_block may need to hold the CodeCache lock Reviewed-by: kvn
author never
date Tue, 05 Apr 2011 19:16:52 -0700
parents c7f3d0b4570f
children 3f49d30f8184
comparison
equal deleted inserted replaced
2456:8e77e1f26188 2457:527977d4f740
962 " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'" 962 " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'"
963 " largest_free_block='" SIZE_FORMAT "'", 963 " largest_free_block='" SIZE_FORMAT "'",
964 nof_blobs(), nof_nmethods(), nof_adapters(), 964 nof_blobs(), nof_nmethods(), nof_adapters(),
965 unallocated_capacity(), largest_free_block()); 965 unallocated_capacity(), largest_free_block());
966 } 966 }
967
968 size_t CodeCache::largest_free_block() {
969 // This is called both with and without CodeCache_lock held so
970 // handle both cases.
971 if (CodeCache_lock->owned_by_self()) {
972 return _heap->largest_free_block();
973 } else {
974 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
975 return _heap->largest_free_block();
976 }
977 }