8012052: java/lang/invoke/6987555/Test6987555.java crashes with assert(mcs != NULL) failed: MethodCounters cannot be NULL.
authorjiangli
Thu, 11 Apr 2013 23:06:33 -0400
changeset 17001 1ce8485b1907
parent 17000 11bf92e571a2
child 17002 d86c9dfa4a5f
child 17094 29c4955396d2
8012052: java/lang/invoke/6987555/Test6987555.java crashes with assert(mcs != NULL) failed: MethodCounters cannot be NULL. Summary: Skip counter decay if the MethodCounters is NULL in NonTieredCompPolicy::delay_compilation(). Reviewed-by: kvn, dholmes
hotspot/src/share/vm/runtime/compilationPolicy.cpp
--- a/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Tue Apr 09 17:17:41 2013 -0400
+++ b/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Thu Apr 11 23:06:33 2013 -0400
@@ -297,9 +297,10 @@
 // that it's recommended to delay the complation of this method.
 void NonTieredCompPolicy::delay_compilation(Method* method) {
   MethodCounters* mcs = method->method_counters();
-  assert(mcs != NULL, "MethodCounters cannot be NULL");
-  mcs->invocation_counter()->decay();
-  mcs->backedge_counter()->decay();
+  if (mcs != NULL) {
+    mcs->invocation_counter()->decay();
+    mcs->backedge_counter()->decay();
+  }
 }
 
 void NonTieredCompPolicy::disable_compilation(Method* method) {