diff src/share/vm/code/codeCache.cpp @ 10319:91eba9f82325

8012371: Adjust Tiered compile threshold according to available space in code cache Summary: Added command line parameter to define a threshold at which C1 compilation threshold for is increased. Reviewed-by: kvn, iveresov
author anoll
date Thu, 16 May 2013 15:46:49 +0200
parents 0cfa93c2fcc4
children f2110083203d
line wrap: on
line diff
--- a/src/share/vm/code/codeCache.cpp	Fri May 17 09:10:04 2013 -0700
+++ b/src/share/vm/code/codeCache.cpp	Thu May 16 15:46:49 2013 +0200
@@ -622,6 +622,15 @@
   return (address)_heap->high();
 }
 
+/**
+ * Returns the reverse free ratio. E.g., if 25% (1/4) of the code cache
+ * is free, reverse_free_ratio() returns 4.
+ */
+double CodeCache::reverse_free_ratio() {
+  double unallocated_capacity = (double)(CodeCache::unallocated_capacity() - CodeCacheMinimumFreeSpace);
+  double max_capacity = (double)CodeCache::max_capacity();
+  return max_capacity / unallocated_capacity;
+}
 
 void icache_init();