changeset 23759:561a3f3a9b99

C1 profiling of statically bindable method should mimic the interpreter
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 22 Sep 2016 13:15:59 -0700
parents ca5c97226d1c
children 655fd63024d0
files src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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");
--- 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");