8013036: vm/runtime/simpleThresholdPolicy.cpp: assert(mcs != NULL).
authorjiangli
Fri, 26 Apr 2013 16:21:03 -0400
changeset 17130 6853aae617cb
parent 17127 3665c17d4fba
child 17131 37e5d5c5cc5a
8013036: vm/runtime/simpleThresholdPolicy.cpp: assert(mcs != NULL). Summary: Change the assert to if check as MethodCounters could be NULL under TieredCompilation. Reviewed-by: kvn, twisti
hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp
--- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp	Fri Apr 26 08:33:39 2013 -0700
+++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp	Fri Apr 26 16:21:03 2013 -0400
@@ -154,9 +154,10 @@
 // Set carry flags on the counters if necessary
 void SimpleThresholdPolicy::handle_counter_overflow(Method* method) {
   MethodCounters *mcs = method->method_counters();
-  assert(mcs != NULL, "");
-  set_carry_if_necessary(mcs->invocation_counter());
-  set_carry_if_necessary(mcs->backedge_counter());
+  if (mcs != NULL) {
+    set_carry_if_necessary(mcs->invocation_counter());
+    set_carry_if_necessary(mcs->backedge_counter());
+  }
   MethodData* mdo = method->method_data();
   if (mdo != NULL) {
     set_carry_if_necessary(mdo->invocation_counter());