From 100048e8d883a455f8cdd40d2fe91a9ee3ef438a Mon Sep 17 00:00:00 2001 From: jiangli Date: Thu, 11 Apr 2013 23:06:33 -0400 Subject: [PATCH] 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 --- src/share/vm/runtime/compilationPolicy.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/share/vm/runtime/compilationPolicy.cpp b/src/share/vm/runtime/compilationPolicy.cpp index cec42ae91..3d670d6a2 100644 --- a/src/share/vm/runtime/compilationPolicy.cpp +++ b/src/share/vm/runtime/compilationPolicy.cpp @@ -297,9 +297,10 @@ void NonTieredCompPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) { // 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) { -- GitLab