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
--- 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) {