From a80ab4dd5a9048f377fb794dee5a9f91e0421631 Mon Sep 17 00:00:00 2001 From: kvn Date: Thu, 15 May 2008 22:40:43 -0700 Subject: [PATCH] 6700102: c2 assertion "counter_changed,"failed dependencies, but counter didn't change")" with AggressiveOpts Summary: Bytecode Escape Analyzer does not have the check for the case described in 6389127. Reviewed-by: never --- src/share/vm/ci/bcEscapeAnalyzer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/share/vm/ci/bcEscapeAnalyzer.cpp b/src/share/vm/ci/bcEscapeAnalyzer.cpp index fc875ca55..70b0844da 100644 --- a/src/share/vm/ci/bcEscapeAnalyzer.cpp +++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp @@ -218,6 +218,13 @@ void BCEscapeAnalyzer::invoke(StateInfo &state, Bytecodes::Code code, ciMethod* ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder); ciInstanceKlass* actual_recv = callee_holder; + // some methods are obviously bindable without any type checks so + // convert them directly to an invokespecial. + if (target->is_loaded() && !target->is_abstract() && + target->can_be_statically_bound() && code == Bytecodes::_invokevirtual) { + code = Bytecodes::_invokespecial; + } + // compute size of arguments int arg_size = target->arg_size(); if (!target->is_loaded() && code == Bytecodes::_invokestatic) { -- GitLab