# HG changeset patch # User jiangli # Date 1365735993 14400 # Node ID 42a42da29fd71fc1859eac4b3f1d7ab3111a939c # Parent aeaca88565e66070fbd2b1fb62fe75046f04c088 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 diff -r aeaca88565e6 -r 42a42da29fd7 src/share/vm/runtime/compilationPolicy.cpp --- 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) {