提交 9c147452 编写于 作者: C coleenp

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
上级 4310c3a6
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册