# HG changeset patch # User Tom Rodriguez # Date 1474575359 25200 # Node ID 561a3f3a9b998a56b49d27034ad66a7311b4eb62 # Parent ca5c97226d1c4df5ad0cecf1fb30863d3f821a6e C1 profiling of statically bindable method should mimic the interpreter diff -r ca5c97226d1c -r 561a3f3a9b99 src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp --- a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp Wed Sep 21 20:15:14 2016 -0700 +++ b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp Thu Sep 22 13:15:59 2016 -0700 @@ -3028,8 +3028,10 @@ Bytecodes::Code bc = method->java_code_at_bci(bci); const bool callee_is_static = callee->is_loaded() && callee->is_static(); // Perform additional virtual call profiling for invokevirtual and - // invokeinterface bytecodes - if ((bc == Bytecodes::_invokevirtual || bc == Bytecodes::_invokeinterface) && + // invokeinterface bytecodes. For invokevirtual don't update the profile if + // the method can_be_statically_bound(). See + // InterpreterMacroAssembler::profile_final_call. + if (((bc == Bytecodes::_invokevirtual && !callee->can_be_statically_bound()) || bc == Bytecodes::_invokeinterface) && !callee_is_static && // required for optimized MH invokes C1ProfileVirtualCalls) { assert(op->recv()->is_single_cpu(), "recv must be allocated"); diff -r ca5c97226d1c -r 561a3f3a9b99 src/cpu/x86/vm/c1_LIRAssembler_x86.cpp --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Wed Sep 21 20:15:14 2016 -0700 +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Thu Sep 22 13:15:59 2016 -0700 @@ -3594,8 +3594,10 @@ Bytecodes::Code bc = method->java_code_at_bci(bci); const bool callee_is_static = callee->is_loaded() && callee->is_static(); // Perform additional virtual call profiling for invokevirtual and - // invokeinterface bytecodes - if ((bc == Bytecodes::_invokevirtual || bc == Bytecodes::_invokeinterface) && + // invokeinterface bytecodes. For invokevirtual don't update the profile if + // the method can_be_statically_bound(). See + // InterpreterMacroAssembler::profile_final_call. + if (((bc == Bytecodes::_invokevirtual && !callee->can_be_statically_bound()) || bc == Bytecodes::_invokeinterface) && !callee_is_static && // required for optimized MH invokes C1ProfileVirtualCalls) { assert(op->recv()->is_single_cpu(), "recv must be allocated");