changeset 4570:42a42da29fd7

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
author jiangli
date Thu, 11 Apr 2013 23:06:33 -0400
parents aeaca88565e6
children 8df6ddda8090
files src/share/vm/runtime/compilationPolicy.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/compilationPolicy.cpp	Tue Apr 09 17:17:41 2013 -0400
+++ b/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) {