From 9c147452e2029964487accabf63f55037ff341fa Mon Sep 17 00:00:00 2001 From: coleenp Date: Fri, 20 Mar 2009 22:08:48 -0400 Subject: [PATCH] 6805748: Assertion "don't reset to 0 -- could be mistaken for never-executed" in CompilationPolicy Summary: Resetting the invocation counter for a method invocation event was setting count to zero for CompileThreshold=1, making it look like a never executed method. Reviewed-by: phh, kamg, acorn, never --- src/share/vm/interpreter/invocationCounter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/share/vm/interpreter/invocationCounter.cpp b/src/share/vm/interpreter/invocationCounter.cpp index cb6507785..7ecc70d19 100644 --- a/src/share/vm/interpreter/invocationCounter.cpp +++ b/src/share/vm/interpreter/invocationCounter.cpp @@ -47,6 +47,8 @@ void InvocationCounter::set_carry() { // executed many more times before re-entering the VM. int old_count = count(); int new_count = MIN2(old_count, (int) (CompileThreshold / 2)); + // prevent from going to zero, to distinguish from never-executed methods + if (new_count == 0) new_count = 1; if (old_count != new_count) set(state(), new_count); } -- GitLab