aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/interpreter
diff options
context:
space:
mode:
authorcoleenp <none@none>2009-03-20 22:08:48 -0400
committercoleenp <none@none>2009-03-20 22:08:48 -0400
commit92016873b5a563473c37b35bd1020c17a34ae38a (patch)
treef07d00b24215e356ce21cfe1219ed6f47efbb963 /src/share/vm/interpreter
parent71ab8c6753ee4749844ad210e4c86344f99a6ee6 (diff)
downloadjdk8u_hotspot-92016873b5a563473c37b35bd1020c17a34ae38a.tar.gz
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
Diffstat (limited to 'src/share/vm/interpreter')
-rw-r--r--src/share/vm/interpreter/invocationCounter.cpp2
1 files changed, 2 insertions, 0 deletions
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);
}