8077279: assert(ic->is_clean()) failed: IC should be clean
authorsjohanss
Mon, 15 Jun 2015 10:24:38 +0200
changeset 31348 c28f02c7abb5
parent 31347 0fec61c9d330
child 31349 db7a609d1faa
8077279: assert(ic->is_clean()) failed: IC should be clean Reviewed-by: rbackman, thartmann
hotspot/src/share/vm/code/codeCache.hpp
hotspot/src/share/vm/code/nmethod.cpp
hotspot/src/share/vm/runtime/sweeper.cpp
--- a/hotspot/src/share/vm/code/codeCache.hpp	Mon Jun 15 01:38:42 2015 -0400
+++ b/hotspot/src/share/vm/code/codeCache.hpp	Mon Jun 15 10:24:38 2015 +0200
@@ -190,7 +190,12 @@
   static void set_needs_cache_clean(bool v)           { _needs_cache_clean = v;    }
   static void clear_inline_caches();                  // clear all inline caches
 
-  // Returns the CodeBlobType for nmethods of the given compilation level
+  // Returns the CodeBlobType for the given nmethod
+  static int get_code_blob_type(nmethod* nm) {
+    return get_code_heap(nm)->code_blob_type();
+  }
+
+  // Returns the CodeBlobType for the given compilation level
   static int get_code_blob_type(int comp_level) {
     if (comp_level == CompLevel_none ||
         comp_level == CompLevel_simple ||
@@ -287,7 +292,7 @@
       // Iterate over all CodeBlobs
       _code_blob_type = CodeBlobType::All;
     } else if (nm != NULL) {
-      _code_blob_type = CodeCache::get_code_blob_type(nm->comp_level());
+      _code_blob_type = CodeCache::get_code_blob_type(nm);
     } else {
       // Only iterate over method code heaps, starting with non-profiled
       _code_blob_type = CodeBlobType::MethodNonProfiled;
--- a/hotspot/src/share/vm/code/nmethod.cpp	Mon Jun 15 01:38:42 2015 -0400
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Mon Jun 15 10:24:38 2015 +0200
@@ -1421,7 +1421,7 @@
   Events::log(JavaThread::current(), "flushing nmethod " INTPTR_FORMAT, this);
   if (PrintMethodFlushing) {
     tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT "/Free CodeCache:" SIZE_FORMAT "Kb",
-        _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity(CodeCache::get_code_blob_type(_comp_level))/1024);
+        _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity(CodeCache::get_code_blob_type(this))/1024);
   }
 
   // We need to deallocate any ExceptionCache data.
--- a/hotspot/src/share/vm/runtime/sweeper.cpp	Mon Jun 15 01:38:42 2015 -0400
+++ b/hotspot/src/share/vm/runtime/sweeper.cpp	Mon Jun 15 10:24:38 2015 +0200
@@ -678,7 +678,7 @@
       // ReservedCodeCacheSize
       int reset_val = hotness_counter_reset_val();
       int time_since_reset = reset_val - nm->hotness_counter();
-      int code_blob_type = (CodeCache::get_code_blob_type(nm->comp_level()));
+      int code_blob_type = CodeCache::get_code_blob_type(nm);
       double threshold = -reset_val + (CodeCache::reverse_free_ratio(code_blob_type) * NmethodSweepActivity);
       // The less free space in the code cache we have - the bigger reverse_free_ratio() is.
       // I.e., 'threshold' increases with lower available space in the code cache and a higher