comparison src/share/vm/interpreter/invocationCounter.cpp @ 654:c664a0794f85

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
author coleenp
date Fri, 20 Mar 2009 22:08:48 -0400
parents a61af66fc99e
children bd02caa94611
comparison
equal deleted inserted replaced
653:e55bcaf3a6a1 654:c664a0794f85
45 // The carry bit now indicates that this counter had achieved a very 45 // The carry bit now indicates that this counter had achieved a very
46 // large value. Now reduce the value, so that the method can be 46 // large value. Now reduce the value, so that the method can be
47 // executed many more times before re-entering the VM. 47 // executed many more times before re-entering the VM.
48 int old_count = count(); 48 int old_count = count();
49 int new_count = MIN2(old_count, (int) (CompileThreshold / 2)); 49 int new_count = MIN2(old_count, (int) (CompileThreshold / 2));
50 // prevent from going to zero, to distinguish from never-executed methods
51 if (new_count == 0) new_count = 1;
50 if (old_count != new_count) set(state(), new_count); 52 if (old_count != new_count) set(state(), new_count);
51 } 53 }
52 54
53 55
54 void InvocationCounter::set_state(State state) { 56 void InvocationCounter::set_state(State state) {